armmaps

package module
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2022 License: MIT Imports: 16 Imported by: 1

README

Azure Maps Module for Go

PkgGoDev

The armmaps module provides operations for working with Azure Maps.

Source code

Getting started

Prerequisites

Install the package

This project uses Go modules for versioning and dependency management.

Install the Azure Maps module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maps/armmaps

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Maps. The azidentity module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.

cred, err := azidentity.NewDefaultAzureCredential(nil)

For more information on authentication, please see the documentation for azidentity at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity.

Clients

Azure Maps modules consist of one or more clients. A client groups a set of related APIs, providing access to its functionality within the specified subscription. Create one or more clients to access the APIs you require using your credential.

client, err := armmaps.NewCreatorsClient(<subscription ID>, cred, nil)

You can use ClientOptions in package github.com/Azure/azure-sdk-for-go/sdk/azcore/arm to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for azcore at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore.

options := arm.ClientOptions {
    ClientOptions: azcore.ClientOptions {
        Cloud: cloud.AzureChina,
    },
}
client, err := armmaps.NewCreatorsClient(<subscription ID>, cred, &options)

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the Maps label.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account added in v0.2.0

type Account struct {
	// REQUIRED; The geo-location where the resource lives
	Location *string `json:"location,omitempty"`

	// REQUIRED; The SKU of this account.
	SKU *SKU `json:"sku,omitempty"`

	// Sets the identity property for maps account.
	Identity *ManagedServiceIdentity `json:"identity,omitempty"`

	// Get or Set Kind property.
	Kind *Kind `json:"kind,omitempty"`

	// The map account properties.
	Properties *AccountProperties `json:"properties,omitempty"`

	// Resource tags.
	Tags map[string]*string `json:"tags,omitempty"`

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The system meta data relating to this resource.
	SystemData *SystemData `json:"systemData,omitempty" azure:"ro"`

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty" azure:"ro"`
}

Account - An Azure resource which represents access to a suite of Maps REST APIs.

func (Account) MarshalJSON added in v0.2.0

func (a Account) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Account.

type AccountKeys added in v0.2.0

type AccountKeys struct {
	// READ-ONLY; The primary key for accessing the Maps REST APIs.
	PrimaryKey *string `json:"primaryKey,omitempty" azure:"ro"`

	// READ-ONLY; The last updated date and time of the primary key.
	PrimaryKeyLastUpdated *string `json:"primaryKeyLastUpdated,omitempty" azure:"ro"`

	// READ-ONLY; The secondary key for accessing the Maps REST APIs.
	SecondaryKey *string `json:"secondaryKey,omitempty" azure:"ro"`

	// READ-ONLY; The last updated date and time of the secondary key.
	SecondaryKeyLastUpdated *string `json:"secondaryKeyLastUpdated,omitempty" azure:"ro"`
}

AccountKeys - The set of keys which can be used to access the Maps REST APIs. Two keys are provided for key rotation without interruption.

type AccountProperties added in v0.2.0

type AccountProperties struct {
	// Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no CorsRule
	// elements are included in the request body, all CORS rules will be deleted, and
	// CORS will be disabled for the Blob service.
	Cors *CorsRules `json:"cors,omitempty"`

	// Allows toggle functionality on Azure Policy to disable Azure Maps local authentication support. This will disable Shared
	// Keys authentication from any usage.
	DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"`

	// Sets the resources to be used for Managed Identities based operations for the Map account resource.
	LinkedResources []*LinkedResource `json:"linkedResources,omitempty"`

	// READ-ONLY; The provisioning state of the Map account resource.
	ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"`

	// READ-ONLY; A unique identifier for the maps account
	UniqueID *string `json:"uniqueId,omitempty" azure:"ro"`
}

AccountProperties - Additional Map account properties

func (AccountProperties) MarshalJSON added in v0.2.0

func (a AccountProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AccountProperties.

type AccountSasParameters

type AccountSasParameters struct {
	// REQUIRED; The date time offset of when the token validity expires. For example "2017-05-24T10:42:03.1567373Z"
	Expiry *string `json:"expiry,omitempty"`

	// REQUIRED; Required parameter which represents the desired maximum request per second to allowed for the given SAS token.
	// This does not guarantee perfect accuracy in measurements but provides application safe
	// guards of abuse with eventual enforcement.
	MaxRatePerSecond *int32 `json:"maxRatePerSecond,omitempty"`

	// REQUIRED; The principal Id also known as the object Id of a User Assigned Managed Identity currently assigned to the Map
	// Account. To assign a Managed Identity of the account, use operation Create or Update an
	// assign a User Assigned Identity resource Id.
	PrincipalID *string `json:"principalId,omitempty"`

	// REQUIRED; The Map account key to use for signing.
	SigningKey *SigningKey `json:"signingKey,omitempty"`

	// REQUIRED; The date time offset of when the token validity begins. For example "2017-05-24T10:42:03.1567373Z".
	Start *string `json:"start,omitempty"`

	// Optional, allows control of which region locations are permitted access to Azure Maps REST APIs with the SAS token. Example:
	// "eastus", "westus2". Omitting this parameter will allow all region
	// locations to be accessible.
	Regions []*string `json:"regions,omitempty"`
}

AccountSasParameters - Parameters used to create an account Shared Access Signature (SAS) token. The REST API access control is provided by Azure Maps Role Based Access (RBAC) identity and access.

func (AccountSasParameters) MarshalJSON

func (a AccountSasParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AccountSasParameters.

type AccountSasToken added in v0.2.0

type AccountSasToken struct {
	// READ-ONLY; The shared access signature access token.
	AccountSasToken *string `json:"accountSasToken,omitempty" azure:"ro"`
}

AccountSasToken - A new Sas token which can be used to access the Maps REST APIs and is controlled by the specified Managed identity permissions on Azure (IAM) Role Based Access Control.

type AccountUpdateParameters added in v0.2.0

type AccountUpdateParameters struct {
	// Sets the identity property for maps account.
	Identity *ManagedServiceIdentity `json:"identity,omitempty"`

	// Get or Set Kind property.
	Kind *Kind `json:"kind,omitempty"`

	// The map account properties.
	Properties *AccountProperties `json:"properties,omitempty"`

	// The SKU of this account.
	SKU *SKU `json:"sku,omitempty"`

	// Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this
	// resource (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters.
	Tags map[string]*string `json:"tags,omitempty"`
}

AccountUpdateParameters - Parameters used to update an existing Maps Account.

func (AccountUpdateParameters) MarshalJSON added in v0.2.0

func (a AccountUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AccountUpdateParameters.

type Accounts added in v0.2.0

type Accounts struct {
	// URL client should use to fetch the next page (per server side paging). It's null for now, added for future use.
	NextLink *string `json:"nextLink,omitempty"`

	// READ-ONLY; a Maps Account.
	Value []*Account `json:"value,omitempty" azure:"ro"`
}

Accounts - A list of Maps Accounts.

type AccountsClient

type AccountsClient struct {
	// contains filtered or unexported fields
}

AccountsClient contains the methods for the Accounts group. Don't use this type directly, use NewAccountsClient() instead.

func NewAccountsClient

func NewAccountsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AccountsClient, error)

NewAccountsClient creates a new instance of AccountsClient with the specified values. subscriptionID - The ID of the target subscription. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.

func (*AccountsClient) CreateOrUpdate

func (client *AccountsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, mapsAccount Account, options *AccountsClientCreateOrUpdateOptions) (AccountsClientCreateOrUpdateResponse, error)

CreateOrUpdate - Create or update a Maps Account. A Maps Account holds the keys which allow access to the Maps REST APIs. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-12-01-preview resourceGroupName - The name of the resource group. The name is case insensitive. accountName - The name of the Maps Account. mapsAccount - The new or updated parameters for the Maps Account. options - AccountsClientCreateOrUpdateOptions contains the optional parameters for the AccountsClient.CreateOrUpdate method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/CreateAccountManagedIdentity.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maps/armmaps"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armmaps.NewAccountsClient("21a9967a-e8a9-4656-a70b-96ff1c4d05a0", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.CreateOrUpdate(ctx,
		"myResourceGroup",
		"myMapsAccount",
		armmaps.Account{
			Location: to.Ptr("eastus"),
			Tags: map[string]*string{
				"test": to.Ptr("true"),
			},
			Identity: &armmaps.ManagedServiceIdentity{
				Type: to.Ptr(armmaps.ResourceIdentityTypeSystemAssignedUserAssigned),
				UserAssignedIdentities: map[string]*armmaps.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{
					"/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName": {},
				},
			},
			Kind: to.Ptr(armmaps.KindGen2),
			Properties: &armmaps.AccountProperties{
				DisableLocalAuth: to.Ptr(false),
				LinkedResources: []*armmaps.LinkedResource{
					{
						ID:         to.Ptr("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Storage/accounts/mystorageacc"),
						UniqueName: to.Ptr("myBatchStorageAccount"),
					},
					{
						ID:         to.Ptr("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Storage/accounts/mystorageacc"),
						UniqueName: to.Ptr("myBlobDataSource"),
					}},
			},
			SKU: &armmaps.SKU{
				Name: to.Ptr(armmaps.NameG2),
			},
		},
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*AccountsClient) Delete

func (client *AccountsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientDeleteOptions) (AccountsClientDeleteResponse, error)

Delete - Delete a Maps Account. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-12-01-preview resourceGroupName - The name of the resource group. The name is case insensitive. accountName - The name of the Maps Account. options - AccountsClientDeleteOptions contains the optional parameters for the AccountsClient.Delete method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/DeleteAccount.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maps/armmaps"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armmaps.NewAccountsClient("21a9967a-e8a9-4656-a70b-96ff1c4d05a0", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = client.Delete(ctx,
		"myResourceGroup",
		"myMapsAccount",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*AccountsClient) Get

func (client *AccountsClient) Get(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientGetOptions) (AccountsClientGetResponse, error)

Get - Get a Maps Account. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-12-01-preview resourceGroupName - The name of the resource group. The name is case insensitive. accountName - The name of the Maps Account. options - AccountsClientGetOptions contains the optional parameters for the AccountsClient.Get method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/GetAccount.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maps/armmaps"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armmaps.NewAccountsClient("21a9967a-e8a9-4656-a70b-96ff1c4d05a0", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Get(ctx,
		"myResourceGroup",
		"myMapsAccount",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*AccountsClient) ListKeys

func (client *AccountsClient) ListKeys(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientListKeysOptions) (AccountsClientListKeysResponse, error)

ListKeys - Get the keys to use with the Maps APIs. A key is used to authenticate and authorize access to the Maps REST APIs. Only one key is needed at a time; two are given to provide seamless key regeneration. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-12-01-preview resourceGroupName - The name of the resource group. The name is case insensitive. accountName - The name of the Maps Account. options - AccountsClientListKeysOptions contains the optional parameters for the AccountsClient.ListKeys method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/ListKeys.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maps/armmaps"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armmaps.NewAccountsClient("21a9967a-e8a9-4656-a70b-96ff1c4d05a0", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.ListKeys(ctx,
		"myResourceGroup",
		"myMapsAccount",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*AccountsClient) ListSas

func (client *AccountsClient) ListSas(ctx context.Context, resourceGroupName string, accountName string, mapsAccountSasParameters AccountSasParameters, options *AccountsClientListSasOptions) (AccountsClientListSasResponse, error)

ListSas - Create and list an account shared access signature token. Use this SAS token for authentication to Azure Maps REST APIs through various Azure Maps SDKs. As prerequisite to create a SAS Token. Prerequisites: 1. Create or have an existing User Assigned Managed Identity in the same Azure region as the account. 2. Create or update an Azure Map account with the same Azure region as the User Assigned Managed Identity is placed. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-12-01-preview resourceGroupName - The name of the resource group. The name is case insensitive. accountName - The name of the Maps Account. mapsAccountSasParameters - The updated parameters for the Maps Account. options - AccountsClientListSasOptions contains the optional parameters for the AccountsClient.ListSas method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/AccountListSAS.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maps/armmaps"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armmaps.NewAccountsClient("21a9967a-e8a9-4656-a70b-96ff1c4d05a0", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.ListSas(ctx,
		"myResourceGroup",
		"myMapsAccount",
		armmaps.AccountSasParameters{
			Expiry:           to.Ptr("2017-05-24T11:42:03.1567373Z"),
			MaxRatePerSecond: to.Ptr[int32](500),
			PrincipalID:      to.Ptr("e917f87b-324d-4728-98ed-e31d311a7d65"),
			Regions: []*string{
				to.Ptr("eastus")},
			SigningKey: to.Ptr(armmaps.SigningKeyPrimaryKey),
			Start:      to.Ptr("2017-05-24T10:42:03.1567373Z"),
		},
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*AccountsClient) NewListByResourceGroupPager added in v0.4.0

func (client *AccountsClient) NewListByResourceGroupPager(resourceGroupName string, options *AccountsClientListByResourceGroupOptions) *runtime.Pager[AccountsClientListByResourceGroupResponse]

NewListByResourceGroupPager - Get all Maps Accounts in a Resource Group If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-12-01-preview resourceGroupName - The name of the resource group. The name is case insensitive. options - AccountsClientListByResourceGroupOptions contains the optional parameters for the AccountsClient.ListByResourceGroup method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/ListAccountsByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maps/armmaps"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armmaps.NewAccountsClient("21a9967a-e8a9-4656-a70b-96ff1c4d05a0", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListByResourceGroupPager("myResourceGroup",
		nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

func (*AccountsClient) NewListBySubscriptionPager added in v0.4.0

NewListBySubscriptionPager - Get all Maps Accounts in a Subscription If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-12-01-preview options - AccountsClientListBySubscriptionOptions contains the optional parameters for the AccountsClient.ListBySubscription method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/ListAccountsBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maps/armmaps"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armmaps.NewAccountsClient("21a9967a-e8a9-4656-a70b-96ff1c4d05a0", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListBySubscriptionPager(nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

func (*AccountsClient) RegenerateKeys

func (client *AccountsClient) RegenerateKeys(ctx context.Context, resourceGroupName string, accountName string, keySpecification KeySpecification, options *AccountsClientRegenerateKeysOptions) (AccountsClientRegenerateKeysResponse, error)

RegenerateKeys - Regenerate either the primary or secondary key for use with the Maps APIs. The old key will stop working immediately. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-12-01-preview resourceGroupName - The name of the resource group. The name is case insensitive. accountName - The name of the Maps Account. keySpecification - Which key to regenerate: primary or secondary. options - AccountsClientRegenerateKeysOptions contains the optional parameters for the AccountsClient.RegenerateKeys method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/RegenerateKey.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maps/armmaps"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armmaps.NewAccountsClient("21a9967a-e8a9-4656-a70b-96ff1c4d05a0", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.RegenerateKeys(ctx,
		"myResourceGroup",
		"myMapsAccount",
		armmaps.KeySpecification{
			KeyType: to.Ptr(armmaps.KeyTypePrimary),
		},
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*AccountsClient) Update

func (client *AccountsClient) Update(ctx context.Context, resourceGroupName string, accountName string, mapsAccountUpdateParameters AccountUpdateParameters, options *AccountsClientUpdateOptions) (AccountsClientUpdateResponse, error)

Update - Updates a Maps Account. Only a subset of the parameters may be updated after creation, such as Sku, Tags, Properties. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-12-01-preview resourceGroupName - The name of the resource group. The name is case insensitive. accountName - The name of the Maps Account. mapsAccountUpdateParameters - The updated parameters for the Maps Account. options - AccountsClientUpdateOptions contains the optional parameters for the AccountsClient.Update method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/UpdateAccountManagedIdentity.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maps/armmaps"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armmaps.NewAccountsClient("21a9967a-e8a9-4656-a70b-96ff1c4d05a0", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Update(ctx,
		"myResourceGroup",
		"myMapsAccount",
		armmaps.AccountUpdateParameters{
			Identity: &armmaps.ManagedServiceIdentity{
				Type: to.Ptr(armmaps.ResourceIdentityTypeSystemAssignedUserAssigned),
				UserAssignedIdentities: map[string]*armmaps.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{
					"/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName": {},
				},
			},
			Kind: to.Ptr(armmaps.KindGen2),
			Properties: &armmaps.AccountProperties{
				LinkedResources: []*armmaps.LinkedResource{
					{
						ID:         to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/accounts/{storageName}"),
						UniqueName: to.Ptr("myBatchStorageAccount"),
					}},
			},
			SKU: &armmaps.SKU{
				Name: to.Ptr(armmaps.NameG2),
			},
		},
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

type AccountsClientCreateOrUpdateOptions added in v0.2.0

type AccountsClientCreateOrUpdateOptions struct {
}

AccountsClientCreateOrUpdateOptions contains the optional parameters for the AccountsClient.CreateOrUpdate method.

type AccountsClientCreateOrUpdateResponse added in v0.2.0

type AccountsClientCreateOrUpdateResponse struct {
	Account
}

AccountsClientCreateOrUpdateResponse contains the response from method AccountsClient.CreateOrUpdate.

type AccountsClientDeleteOptions added in v0.2.0

type AccountsClientDeleteOptions struct {
}

AccountsClientDeleteOptions contains the optional parameters for the AccountsClient.Delete method.

type AccountsClientDeleteResponse added in v0.2.0

type AccountsClientDeleteResponse struct {
}

AccountsClientDeleteResponse contains the response from method AccountsClient.Delete.

type AccountsClientGetOptions added in v0.2.0

type AccountsClientGetOptions struct {
}

AccountsClientGetOptions contains the optional parameters for the AccountsClient.Get method.

type AccountsClientGetResponse added in v0.2.0

type AccountsClientGetResponse struct {
	Account
}

AccountsClientGetResponse contains the response from method AccountsClient.Get.

type AccountsClientListByResourceGroupOptions added in v0.2.0

type AccountsClientListByResourceGroupOptions struct {
}

AccountsClientListByResourceGroupOptions contains the optional parameters for the AccountsClient.ListByResourceGroup method.

type AccountsClientListByResourceGroupResponse added in v0.2.0

type AccountsClientListByResourceGroupResponse struct {
	Accounts
}

AccountsClientListByResourceGroupResponse contains the response from method AccountsClient.ListByResourceGroup.

type AccountsClientListBySubscriptionOptions added in v0.2.0

type AccountsClientListBySubscriptionOptions struct {
}

AccountsClientListBySubscriptionOptions contains the optional parameters for the AccountsClient.ListBySubscription method.

type AccountsClientListBySubscriptionResponse added in v0.2.0

type AccountsClientListBySubscriptionResponse struct {
	Accounts
}

AccountsClientListBySubscriptionResponse contains the response from method AccountsClient.ListBySubscription.

type AccountsClientListKeysOptions added in v0.2.0

type AccountsClientListKeysOptions struct {
}

AccountsClientListKeysOptions contains the optional parameters for the AccountsClient.ListKeys method.

type AccountsClientListKeysResponse added in v0.2.0

type AccountsClientListKeysResponse struct {
	AccountKeys
}

AccountsClientListKeysResponse contains the response from method AccountsClient.ListKeys.

type AccountsClientListSasOptions added in v0.2.0

type AccountsClientListSasOptions struct {
}

AccountsClientListSasOptions contains the optional parameters for the AccountsClient.ListSas method.

type AccountsClientListSasResponse added in v0.2.0

type AccountsClientListSasResponse struct {
	AccountSasToken
}

AccountsClientListSasResponse contains the response from method AccountsClient.ListSas.

type AccountsClientRegenerateKeysOptions added in v0.2.0

type AccountsClientRegenerateKeysOptions struct {
}

AccountsClientRegenerateKeysOptions contains the optional parameters for the AccountsClient.RegenerateKeys method.

type AccountsClientRegenerateKeysResponse added in v0.2.0

type AccountsClientRegenerateKeysResponse struct {
	AccountKeys
}

AccountsClientRegenerateKeysResponse contains the response from method AccountsClient.RegenerateKeys.

type AccountsClientUpdateOptions added in v0.2.0

type AccountsClientUpdateOptions struct {
}

AccountsClientUpdateOptions contains the optional parameters for the AccountsClient.Update method.

type AccountsClientUpdateResponse added in v0.2.0

type AccountsClientUpdateResponse struct {
	Account
}

AccountsClientUpdateResponse contains the response from method AccountsClient.Update.

type Client added in v0.2.0

type Client struct {
	// contains filtered or unexported fields
}

Client contains the methods for the Maps group. Don't use this type directly, use NewClient() instead.

func NewClient added in v0.2.0

func NewClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*Client, error)

NewClient creates a new instance of Client with the specified values. subscriptionID - The ID of the target subscription. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.

func (*Client) NewListOperationsPager added in v0.4.0

func (client *Client) NewListOperationsPager(options *ClientListOperationsOptions) *runtime.Pager[ClientListOperationsResponse]

NewListOperationsPager - List operations available for the Maps Resource Provider If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-12-01-preview options - ClientListOperationsOptions contains the optional parameters for the Client.ListOperations method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/GetOperations.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maps/armmaps"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armmaps.NewClient("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListOperationsPager(nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

func (*Client) NewListSubscriptionOperationsPager added in v0.4.0

func (client *Client) NewListSubscriptionOperationsPager(options *ClientListSubscriptionOperationsOptions) *runtime.Pager[ClientListSubscriptionOperationsResponse]

NewListSubscriptionOperationsPager - List operations available for the Maps Resource Provider If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-12-01-preview options - ClientListSubscriptionOperationsOptions contains the optional parameters for the Client.ListSubscriptionOperations method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/GetOperationsSubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maps/armmaps"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armmaps.NewClient("21a9967a-e8a9-4656-a70b-96ff1c4d05a0", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListSubscriptionOperationsPager(nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

type ClientListOperationsOptions added in v0.2.0

type ClientListOperationsOptions struct {
}

ClientListOperationsOptions contains the optional parameters for the Client.ListOperations method.

type ClientListOperationsResponse added in v0.2.0

type ClientListOperationsResponse struct {
	Operations
}

ClientListOperationsResponse contains the response from method Client.ListOperations.

type ClientListSubscriptionOperationsOptions added in v0.2.0

type ClientListSubscriptionOperationsOptions struct {
}

ClientListSubscriptionOperationsOptions contains the optional parameters for the Client.ListSubscriptionOperations method.

type ClientListSubscriptionOperationsResponse added in v0.2.0

type ClientListSubscriptionOperationsResponse struct {
	Operations
}

ClientListSubscriptionOperationsResponse contains the response from method Client.ListSubscriptionOperations.

type Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties

type Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties struct {
	// READ-ONLY; The client id of user assigned identity.
	ClientID *string `json:"clientId,omitempty" azure:"ro"`

	// READ-ONLY; The principal id of user assigned identity.
	PrincipalID *string `json:"principalId,omitempty" azure:"ro"`
}

type CorsRule

type CorsRule struct {
	// REQUIRED; Required if CorsRule element is present. A list of origin domains that will be allowed via CORS, or "*" to allow
	// all domains
	AllowedOrigins []*string `json:"allowedOrigins,omitempty"`
}

CorsRule - Specifies a CORS rule for the Map Account.

func (CorsRule) MarshalJSON

func (c CorsRule) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CorsRule.

type CorsRules

type CorsRules struct {
	// The list of CORS rules. You can include up to five CorsRule elements in the request.
	CorsRules []*CorsRule `json:"corsRules,omitempty"`
}

CorsRules - Sets the CORS rules. You can include up to five CorsRule elements in the request.

func (CorsRules) MarshalJSON

func (c CorsRules) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CorsRules.

type CreatedByType

type CreatedByType string

CreatedByType - The type of identity that created the resource.

const (
	CreatedByTypeApplication     CreatedByType = "Application"
	CreatedByTypeKey             CreatedByType = "Key"
	CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity"
	CreatedByTypeUser            CreatedByType = "User"
)

func PossibleCreatedByTypeValues

func PossibleCreatedByTypeValues() []CreatedByType

PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.

type Creator

type Creator struct {
	// REQUIRED; The geo-location where the resource lives
	Location *string `json:"location,omitempty"`

	// REQUIRED; The Creator resource properties.
	Properties *CreatorProperties `json:"properties,omitempty"`

	// Resource tags.
	Tags map[string]*string `json:"tags,omitempty"`

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The system meta data relating to this resource.
	SystemData *SystemData `json:"systemData,omitempty" azure:"ro"`

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty" azure:"ro"`
}

Creator - An Azure resource which represents Maps Creator product and provides ability to manage private location data.

func (Creator) MarshalJSON

func (c Creator) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Creator.

type CreatorList

type CreatorList struct {
	// URL client should use to fetch the next page (per server side paging). It's null for now, added for future use.
	NextLink *string `json:"nextLink,omitempty"`

	// READ-ONLY; a Creator account.
	Value []*Creator `json:"value,omitempty" azure:"ro"`
}

CreatorList - A list of Creator resources.

type CreatorProperties

type CreatorProperties struct {
	// REQUIRED; The storage units to be allocated. Integer values from 1 to 100, inclusive.
	StorageUnits *int32 `json:"storageUnits,omitempty"`

	// READ-ONLY; The state of the resource provisioning, terminal states: Succeeded, Failed, Canceled
	ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"`
}

CreatorProperties - Creator resource properties

type CreatorUpdateParameters

type CreatorUpdateParameters struct {
	// Creator resource properties.
	Properties *CreatorProperties `json:"properties,omitempty"`

	// Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this
	// resource (across resource groups). A maximum of 15 tags can be provided for a
	// resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters.
	Tags map[string]*string `json:"tags,omitempty"`
}

CreatorUpdateParameters - Parameters used to update an existing Creator resource.

func (CreatorUpdateParameters) MarshalJSON

func (c CreatorUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CreatorUpdateParameters.

type CreatorsClient

type CreatorsClient struct {
	// contains filtered or unexported fields
}

CreatorsClient contains the methods for the Creators group. Don't use this type directly, use NewCreatorsClient() instead.

func NewCreatorsClient

func NewCreatorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CreatorsClient, error)

NewCreatorsClient creates a new instance of CreatorsClient with the specified values. subscriptionID - The ID of the target subscription. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.

func (*CreatorsClient) CreateOrUpdate

func (client *CreatorsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, creatorName string, creatorResource Creator, options *CreatorsClientCreateOrUpdateOptions) (CreatorsClientCreateOrUpdateResponse, error)

CreateOrUpdate - Create or update a Maps Creator resource. Creator resource will manage Azure resources required to populate a custom set of mapping data. It requires an account to exist before it can be created. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-12-01-preview resourceGroupName - The name of the resource group. The name is case insensitive. accountName - The name of the Maps Account. creatorName - The name of the Maps Creator instance. creatorResource - The new or updated parameters for the Creator resource. options - CreatorsClientCreateOrUpdateOptions contains the optional parameters for the CreatorsClient.CreateOrUpdate method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/CreateMapsCreator.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maps/armmaps"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armmaps.NewCreatorsClient("21a9967a-e8a9-4656-a70b-96ff1c4d05a0", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.CreateOrUpdate(ctx,
		"myResourceGroup",
		"myMapsAccount",
		"myCreator",
		armmaps.Creator{
			Location: to.Ptr("eastus2"),
			Tags: map[string]*string{
				"test": to.Ptr("true"),
			},
			Properties: &armmaps.CreatorProperties{
				StorageUnits: to.Ptr[int32](5),
			},
		},
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*CreatorsClient) Delete

func (client *CreatorsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, creatorName string, options *CreatorsClientDeleteOptions) (CreatorsClientDeleteResponse, error)

Delete - Delete a Maps Creator resource. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-12-01-preview resourceGroupName - The name of the resource group. The name is case insensitive. accountName - The name of the Maps Account. creatorName - The name of the Maps Creator instance. options - CreatorsClientDeleteOptions contains the optional parameters for the CreatorsClient.Delete method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/DeleteMapsCreator.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maps/armmaps"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armmaps.NewCreatorsClient("21a9967a-e8a9-4656-a70b-96ff1c4d05a0", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = client.Delete(ctx,
		"myResourceGroup",
		"myMapsAccount",
		"myCreator",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*CreatorsClient) Get

func (client *CreatorsClient) Get(ctx context.Context, resourceGroupName string, accountName string, creatorName string, options *CreatorsClientGetOptions) (CreatorsClientGetResponse, error)

Get - Get a Maps Creator resource. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-12-01-preview resourceGroupName - The name of the resource group. The name is case insensitive. accountName - The name of the Maps Account. creatorName - The name of the Maps Creator instance. options - CreatorsClientGetOptions contains the optional parameters for the CreatorsClient.Get method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/GetMapsCreator.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maps/armmaps"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armmaps.NewCreatorsClient("21a9967a-e8a9-4656-a70b-96ff1c4d05a0", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Get(ctx,
		"myResourceGroup",
		"myMapsAccount",
		"myCreator",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*CreatorsClient) NewListByAccountPager added in v0.4.0

func (client *CreatorsClient) NewListByAccountPager(resourceGroupName string, accountName string, options *CreatorsClientListByAccountOptions) *runtime.Pager[CreatorsClientListByAccountResponse]

NewListByAccountPager - Get all Creator instances for an Azure Maps Account If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-12-01-preview resourceGroupName - The name of the resource group. The name is case insensitive. accountName - The name of the Maps Account. options - CreatorsClientListByAccountOptions contains the optional parameters for the CreatorsClient.ListByAccount method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/ListMapsCreatorsByAccount.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maps/armmaps"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armmaps.NewCreatorsClient("21a9967a-e8a9-4656-a70b-96ff1c4d05a0", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListByAccountPager("myResourceGroup",
		"myMapsAccount",
		nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

func (*CreatorsClient) Update

func (client *CreatorsClient) Update(ctx context.Context, resourceGroupName string, accountName string, creatorName string, creatorUpdateParameters CreatorUpdateParameters, options *CreatorsClientUpdateOptions) (CreatorsClientUpdateResponse, error)

Update - Updates the Maps Creator resource. Only a subset of the parameters may be updated after creation, such as Tags. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-12-01-preview resourceGroupName - The name of the resource group. The name is case insensitive. accountName - The name of the Maps Account. creatorName - The name of the Maps Creator instance. creatorUpdateParameters - The update parameters for Maps Creator. options - CreatorsClientUpdateOptions contains the optional parameters for the CreatorsClient.Update method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/UpdateMapsCreator.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maps/armmaps"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armmaps.NewCreatorsClient("21a9967a-e8a9-4656-a70b-96ff1c4d05a0", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Update(ctx,
		"myResourceGroup",
		"myMapsAccount",
		"myCreator",
		armmaps.CreatorUpdateParameters{
			Properties: &armmaps.CreatorProperties{
				StorageUnits: to.Ptr[int32](10),
			},
			Tags: map[string]*string{
				"specialTag": to.Ptr("true"),
			},
		},
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

type CreatorsClientCreateOrUpdateOptions added in v0.2.0

type CreatorsClientCreateOrUpdateOptions struct {
}

CreatorsClientCreateOrUpdateOptions contains the optional parameters for the CreatorsClient.CreateOrUpdate method.

type CreatorsClientCreateOrUpdateResponse added in v0.2.0

type CreatorsClientCreateOrUpdateResponse struct {
	Creator
}

CreatorsClientCreateOrUpdateResponse contains the response from method CreatorsClient.CreateOrUpdate.

type CreatorsClientDeleteOptions added in v0.2.0

type CreatorsClientDeleteOptions struct {
}

CreatorsClientDeleteOptions contains the optional parameters for the CreatorsClient.Delete method.

type CreatorsClientDeleteResponse added in v0.2.0

type CreatorsClientDeleteResponse struct {
}

CreatorsClientDeleteResponse contains the response from method CreatorsClient.Delete.

type CreatorsClientGetOptions added in v0.2.0

type CreatorsClientGetOptions struct {
}

CreatorsClientGetOptions contains the optional parameters for the CreatorsClient.Get method.

type CreatorsClientGetResponse added in v0.2.0

type CreatorsClientGetResponse struct {
	Creator
}

CreatorsClientGetResponse contains the response from method CreatorsClient.Get.

type CreatorsClientListByAccountOptions added in v0.2.0

type CreatorsClientListByAccountOptions struct {
}

CreatorsClientListByAccountOptions contains the optional parameters for the CreatorsClient.ListByAccount method.

type CreatorsClientListByAccountResponse added in v0.2.0

type CreatorsClientListByAccountResponse struct {
	CreatorList
}

CreatorsClientListByAccountResponse contains the response from method CreatorsClient.ListByAccount.

type CreatorsClientUpdateOptions added in v0.2.0

type CreatorsClientUpdateOptions struct {
}

CreatorsClientUpdateOptions contains the optional parameters for the CreatorsClient.Update method.

type CreatorsClientUpdateResponse added in v0.2.0

type CreatorsClientUpdateResponse struct {
	Creator
}

CreatorsClientUpdateResponse contains the response from method CreatorsClient.Update.

type Dimension

type Dimension struct {
	// Display name of dimension.
	DisplayName *string `json:"displayName,omitempty"`

	// Internal metric name of the dimension.
	InternalMetricName *string `json:"internalMetricName,omitempty"`

	// Internal name of the dimension.
	InternalName *string `json:"internalName,omitempty"`

	// Display name of dimension.
	Name *string `json:"name,omitempty"`

	// Source Mdm Namespace of the dimension.
	SourceMdmNamespace *string `json:"sourceMdmNamespace,omitempty"`

	// Flag to indicate exporting to Azure Monitor.
	ToBeExportedToShoebox *bool `json:"toBeExportedToShoebox,omitempty"`
}

Dimension of map account, for example API Category, Api Name, Result Type, and Response Code.

type ErrorAdditionalInfo

type ErrorAdditionalInfo struct {
	// READ-ONLY; The additional info.
	Info interface{} `json:"info,omitempty" azure:"ro"`

	// READ-ONLY; The additional info type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ErrorAdditionalInfo - The resource management error additional info.

type ErrorDetail

type ErrorDetail struct {
	// READ-ONLY; The error additional info.
	AdditionalInfo []*ErrorAdditionalInfo `json:"additionalInfo,omitempty" azure:"ro"`

	// READ-ONLY; The error code.
	Code *string `json:"code,omitempty" azure:"ro"`

	// READ-ONLY; The error details.
	Details []*ErrorDetail `json:"details,omitempty" azure:"ro"`

	// READ-ONLY; The error message.
	Message *string `json:"message,omitempty" azure:"ro"`

	// READ-ONLY; The error target.
	Target *string `json:"target,omitempty" azure:"ro"`
}

ErrorDetail - The error detail.

type ErrorResponse

type ErrorResponse struct {
	// The error object.
	Error *ErrorDetail `json:"error,omitempty"`
}

ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).

type KeySpecification added in v0.2.0

type KeySpecification struct {
	// REQUIRED; Whether the operation refers to the primary or secondary key.
	KeyType *KeyType `json:"keyType,omitempty"`
}

KeySpecification - Whether the operation refers to the primary or secondary key.

type KeyType

type KeyType string

KeyType - Whether the operation refers to the primary or secondary key.

const (
	KeyTypePrimary   KeyType = "primary"
	KeyTypeSecondary KeyType = "secondary"
)

func PossibleKeyTypeValues

func PossibleKeyTypeValues() []KeyType

PossibleKeyTypeValues returns the possible values for the KeyType const type.

type Kind

type Kind string

Kind - The Kind of the Maps Account.

const (
	KindGen1 Kind = "Gen1"
	KindGen2 Kind = "Gen2"
)

func PossibleKindValues

func PossibleKindValues() []Kind

PossibleKindValues returns the possible values for the Kind const type.

type LinkedResource

type LinkedResource struct {
	// REQUIRED; ARM resource id in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/accounts/{storageName}'.
	ID *string `json:"id,omitempty"`

	// REQUIRED; A provided name which uniquely identifies the linked resource.
	UniqueName *string `json:"uniqueName,omitempty"`
}

LinkedResource - Linked resource is reference to a resource deployed in an Azure subscription, add the linked resource uniqueName value as an optional parameter for operations on Azure Maps Geospatial REST APIs.

type ManagedServiceIdentity

type ManagedServiceIdentity struct {
	// The identity type.
	Type *ResourceIdentityType `json:"type,omitempty"`

	// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource
	// ids in the form:
	// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
	UserAssignedIdentities map[string]*Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties `json:"userAssignedIdentities,omitempty"`

	// READ-ONLY; The principal ID of resource identity.
	PrincipalID *string `json:"principalId,omitempty" azure:"ro"`

	// READ-ONLY; The tenant ID of resource.
	TenantID *string `json:"tenantId,omitempty" azure:"ro"`
}

ManagedServiceIdentity - Identity for the resource.

func (ManagedServiceIdentity) MarshalJSON

func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity.

type MetricSpecification

type MetricSpecification struct {
	// Aggregation type could be Average.
	AggregationType *string `json:"aggregationType,omitempty"`

	// The category this metric specification belong to, could be Capacity.
	Category *string `json:"category,omitempty"`

	// Dimensions of map account.
	Dimensions []*Dimension `json:"dimensions,omitempty"`

	// Display description of metric specification.
	DisplayDescription *string `json:"displayDescription,omitempty"`

	// Display name of metric specification.
	DisplayName *string `json:"displayName,omitempty"`

	// The property to decide fill gap with zero or not.
	FillGapWithZero *bool `json:"fillGapWithZero,omitempty"`

	// Internal metric name.
	InternalMetricName *string `json:"internalMetricName,omitempty"`

	// Name of metric specification.
	Name *string `json:"name,omitempty"`

	// Account Resource Id.
	ResourceIDDimensionNameOverride *string `json:"resourceIdDimensionNameOverride,omitempty"`

	// Source metrics account.
	SourceMdmAccount *string `json:"sourceMdmAccount,omitempty"`

	// Unit could be Count.
	Unit *string `json:"unit,omitempty"`
}

MetricSpecification - Metric specification of operation.

type Name

type Name string

Name - The name of the SKU, in standard format (such as S0).

const (
	NameG2 Name = "G2"
	NameS0 Name = "S0"
	NameS1 Name = "S1"
)

func PossibleNameValues

func PossibleNameValues() []Name

PossibleNameValues returns the possible values for the Name const type.

type OperationDetail

type OperationDetail struct {
	// Display of the operation
	Display *OperationDisplay `json:"display,omitempty"`

	// Indicates whether the operation is a data action
	IsDataAction *bool `json:"isDataAction,omitempty"`

	// Name of the operation
	Name *string `json:"name,omitempty"`

	// Origin of the operation
	Origin *string `json:"origin,omitempty"`

	// Properties of the operation
	Properties *OperationProperties `json:"properties,omitempty"`
}

OperationDetail - Operation detail payload

type OperationDisplay

type OperationDisplay struct {
	// Localized friendly description for the operation
	Description *string `json:"description,omitempty"`

	// Localized friendly name for the operation
	Operation *string `json:"operation,omitempty"`

	// Resource provider of the operation
	Provider *string `json:"provider,omitempty"`

	// Resource of the operation
	Resource *string `json:"resource,omitempty"`
}

OperationDisplay - Operation display payload

type OperationProperties

type OperationProperties struct {
	// One property of operation, include metric specifications.
	ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"`
}

OperationProperties - Properties of operation, include metric specifications.

type Operations added in v0.2.0

type Operations struct {
	// URL client should use to fetch the next page (per server side paging). It's null for now, added for future use.
	NextLink *string `json:"nextLink,omitempty"`

	// READ-ONLY; An operation available for Maps.
	Value []*OperationDetail `json:"value,omitempty" azure:"ro"`
}

Operations - The set of operations available for Maps.

type Resource

type Resource struct {
	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty" azure:"ro"`
}

Resource - Common fields that are returned in the response for all Azure Resource Manager resources

type ResourceIdentityType

type ResourceIdentityType string

ResourceIdentityType - The identity type.

const (
	ResourceIdentityTypeSystemAssigned             ResourceIdentityType = "SystemAssigned"
	ResourceIdentityTypeUserAssigned               ResourceIdentityType = "UserAssigned"
	ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned"
	ResourceIdentityTypeNone                       ResourceIdentityType = "None"
)

func PossibleResourceIdentityTypeValues

func PossibleResourceIdentityTypeValues() []ResourceIdentityType

PossibleResourceIdentityTypeValues returns the possible values for the ResourceIdentityType const type.

type SKU

type SKU struct {
	// REQUIRED; The name of the SKU, in standard format (such as S0).
	Name *Name `json:"name,omitempty"`

	// READ-ONLY; Gets the sku tier. This is based on the SKU name.
	Tier *string `json:"tier,omitempty" azure:"ro"`
}

SKU - The SKU of the Maps Account.

type ServiceSpecification

type ServiceSpecification struct {
	// Metric specifications of operation.
	MetricSpecifications []*MetricSpecification `json:"metricSpecifications,omitempty"`
}

ServiceSpecification - One property of operation, include metric specifications.

type SigningKey

type SigningKey string

SigningKey - The Map account key to use for signing.

const (
	SigningKeyPrimaryKey   SigningKey = "primaryKey"
	SigningKeySecondaryKey SigningKey = "secondaryKey"
)

func PossibleSigningKeyValues

func PossibleSigningKeyValues() []SigningKey

PossibleSigningKeyValues returns the possible values for the SigningKey const type.

type SystemData

type SystemData struct {
	// The timestamp of resource creation (UTC).
	CreatedAt *time.Time `json:"createdAt,omitempty"`

	// The identity that created the resource.
	CreatedBy *string `json:"createdBy,omitempty"`

	// The type of identity that created the resource.
	CreatedByType *CreatedByType `json:"createdByType,omitempty"`

	// The timestamp of resource last modification (UTC)
	LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"`

	// The identity that last modified the resource.
	LastModifiedBy *string `json:"lastModifiedBy,omitempty"`

	// The type of identity that last modified the resource.
	LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"`
}

SystemData - Metadata pertaining to creation and last modification of the resource.

func (SystemData) MarshalJSON

func (s SystemData) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SystemData.

func (*SystemData) UnmarshalJSON

func (s *SystemData) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.

type TrackedResource

type TrackedResource struct {
	// REQUIRED; The geo-location where the resource lives
	Location *string `json:"location,omitempty"`

	// Resource tags.
	Tags map[string]*string `json:"tags,omitempty"`

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty" azure:"ro"`
}

TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'

func (TrackedResource) MarshalJSON

func (t TrackedResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TrackedResource.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL