armmaps

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 14 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

  • an Azure subscription
  • Go 1.18 or above (You could download and install the latest version of Go from here. It will replace the existing Go on your machine. If you want to install multiple Go versions on the same machine, you could refer this doc.)

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.

Client Factory

Azure Maps module consists of one or more clients. We provide a client factory which could be used to create any client in this module.

clientFactory, err := armmaps.NewClientFactory(<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,
    },
}
clientFactory, err := armmaps.NewClientFactory(<subscription ID>, cred, &options)

Clients

A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory.

client := clientFactory.NewClient()

Fakes

The fake package contains types used for constructing in-memory fake servers used in unit tests. This allows writing tests to cover various success/error conditions without the need for connecting to a live service.

Please see https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/samples/fakes for details and examples on how to use fakes.

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

	// REQUIRED; The SKU of this account.
	SKU *SKU

	// Managed service identity (system assigned and/or user assigned identities)
	Identity *ManagedServiceIdentity

	// Get or Set Kind property.
	Kind *Kind

	// The map account properties.
	Properties *AccountProperties

	// Resource tags.
	Tags map[string]*string

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; Metadata pertaining to creation and last modification of the resource.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

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.

func (*Account) UnmarshalJSON added in v0.6.0

func (a *Account) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller 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

	// READ-ONLY; The last updated date and time of the primary key.
	PrimaryKeyLastUpdated *string

	// READ-ONLY; The secondary key for accessing the Maps REST APIs.
	SecondaryKey *string

	// READ-ONLY; The last updated date and time of the secondary key.
	SecondaryKeyLastUpdated *string
}

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

func (AccountKeys) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type AccountKeys.

func (*AccountKeys) UnmarshalJSON added in v0.6.0

func (a *AccountKeys) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AccountKeys.

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

	// Allows toggle functionality on Azure Policy to disable Azure Maps local authentication support. This will disable Shared
	// Keys and Shared Access Signature Token authentication from any usage.
	DisableLocalAuth *bool

	// (Optional) Discouraged to include in resource definition. Only needed where it is possible to disable platform (AKA infrastructure)
	// encryption. Azure SQL TDE is an example of this. Values are enabled
	// and disabled.
	Encryption *Encryption

	// The array of associated resources to the Map account. Linked resource in the array cannot individually update, you must
	// update all linked resources in the array together. These resources may be used
	// on operations on the Azure Maps REST API. Access is controlled by the Map Account Managed Identity(s) permissions to those
	// resource(s).
	LinkedResources []*LinkedResource

	// READ-ONLY; The provisioning state of the Map account resource, Account updates can only be performed on terminal states.
	// Terminal states: Succeeded and Failed
	ProvisioningState *string

	// READ-ONLY; A unique identifier for the maps account
	UniqueID *string
}

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.

func (*AccountProperties) UnmarshalJSON added in v0.6.0

func (a *AccountProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller 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". Maximum
	// duration allowed is 24 hours between start and expiry.
	Expiry *string

	// 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

	// 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

	// REQUIRED; The Map account key to use for signing. Picking primaryKey or secondaryKey will use the Map account Shared Keys,
	// and using managedIdentity will use the auto-renewed private key to sign the SAS.
	SigningKey *SigningKey

	// REQUIRED; The date time offset of when the token validity begins. For example "2017-05-24T10:42:03.1567373Z". Maximum duration
	// allowed is 24 hours between start and expiry.
	Start *string

	// 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
}

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.

func (*AccountSasParameters) UnmarshalJSON added in v0.6.0

func (a *AccountSasParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AccountSasParameters.

type AccountSasToken added in v0.2.0

type AccountSasToken struct {
	// READ-ONLY; The shared access signature access token.
	AccountSasToken *string
}

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.

func (AccountSasToken) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type AccountSasToken.

func (*AccountSasToken) UnmarshalJSON added in v0.6.0

func (a *AccountSasToken) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AccountSasToken.

type AccountUpdateParameters added in v0.2.0

type AccountUpdateParameters struct {
	// Managed service identity (system assigned and/or user assigned identities)
	Identity *ManagedServiceIdentity

	// Get or Set Kind property.
	Kind *Kind

	// The map account properties.
	Properties *AccountProperties

	// The SKU of this account.
	SKU *SKU

	// 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
}

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.

func (*AccountUpdateParameters) UnmarshalJSON added in v0.6.0

func (a *AccountUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller 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

	// READ-ONLY; a Maps Account.
	Value []*Account
}

Accounts - A list of Maps Accounts.

func (Accounts) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type Accounts.

func (*Accounts) UnmarshalJSON added in v0.6.0

func (a *Accounts) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type 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 2023-06-01

  • 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 (CreateAccountWithEncryption)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9403296f0b0e112b0d8222ad05fd1d79ee10e03/specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/CreateAccountEncryption.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()
	clientFactory, err := armmaps.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAccountsClient().CreateOrUpdate(ctx, "myResourceGroup", "myMapsAccount", armmaps.Account{
		Location: to.Ptr("eastus"),
		Identity: &armmaps.ManagedServiceIdentity{
			Type: to.Ptr(armmaps.ManagedServiceIdentityTypeUserAssigned),
			UserAssignedIdentities: map[string]*armmaps.UserAssignedIdentity{
				"/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName": {},
			},
		},
		Kind: to.Ptr(armmaps.KindGen2),
		Properties: &armmaps.AccountProperties{
			Encryption: &armmaps.Encryption{
				CustomerManagedKeyEncryption: &armmaps.CustomerManagedKeyEncryption{
					KeyEncryptionKeyIdentity: &armmaps.CustomerManagedKeyEncryptionKeyIdentity{
						IdentityType:                   to.Ptr(armmaps.IdentityTypeUserAssignedIdentity),
						UserAssignedIdentityResourceID: to.Ptr("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName"),
					},
					KeyEncryptionKeyURL: to.Ptr("https://contosovault.vault.azure.net/keys/contosokek"),
				},
			},
		},
		SKU: &armmaps.SKU{
			Name: to.Ptr(armmaps.NameG2),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Account = armmaps.Account{
	// 	Name: to.Ptr("myMapsAccount"),
	// 	Type: to.Ptr("Microsoft.Maps/accounts"),
	// 	ID: to.Ptr("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount"),
	// 	Location: to.Ptr("eastus"),
	// 	Tags: map[string]*string{
	// 		"test": to.Ptr("true"),
	// 	},
	// 	Identity: &armmaps.ManagedServiceIdentity{
	// 		Type: to.Ptr(armmaps.ManagedServiceIdentityTypeUserAssigned),
	// 		PrincipalID: to.Ptr("77f72dac-e0aa-484e-9acd-e5e7075310ef"),
	// 		TenantID: to.Ptr("06006684-60c1-4954-a20c-ffd8fbea7276"),
	// 		UserAssignedIdentities: map[string]*armmaps.UserAssignedIdentity{
	// 			"/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName": &armmaps.UserAssignedIdentity{
	// 				ClientID: to.Ptr("b602d315-01b5-4265-af23-859edc4f2431"),
	// 				PrincipalID: to.Ptr("ac287332-364a-41d9-a567-9ad86b9fc299"),
	// 			},
	// 		},
	// 	},
	// 	Kind: to.Ptr(armmaps.KindGen2),
	// 	Properties: &armmaps.AccountProperties{
	// 		Encryption: &armmaps.Encryption{
	// 			CustomerManagedKeyEncryption: &armmaps.CustomerManagedKeyEncryption{
	// 				KeyEncryptionKeyIdentity: &armmaps.CustomerManagedKeyEncryptionKeyIdentity{
	// 					IdentityType: to.Ptr(armmaps.IdentityTypeUserAssignedIdentity),
	// 					UserAssignedIdentityResourceID: to.Ptr("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName"),
	// 				},
	// 				KeyEncryptionKeyURL: to.Ptr("https://contosovault.vault.azure.net/keys/contosokek"),
	// 			},
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UniqueID: to.Ptr("b2e763e6-d6f3-4858-9e2b-7cf8df85c593"),
	// 	},
	// 	SKU: &armmaps.SKU{
	// 		Name: to.Ptr(armmaps.NameG2),
	// 		Tier: to.Ptr("Standard"),
	// 	},
	// 	SystemData: &armmaps.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-02T01:01:01.107Z"); return t}()),
	// 		CreatedBy: to.Ptr("string"),
	// 		CreatedByType: to.Ptr(armmaps.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-02T01:01:01.107Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("string"),
	// 		LastModifiedByType: to.Ptr(armmaps.CreatedByTypeApplication),
	// 	},
	// }
}
Output:

Example (CreateAccountWithManagedIdentities)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9403296f0b0e112b0d8222ad05fd1d79ee10e03/specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/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()
	clientFactory, err := armmaps.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAccountsClient().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.ManagedServiceIdentityTypeSystemAssignedUserAssigned),
			UserAssignedIdentities: map[string]*armmaps.UserAssignedIdentity{
				"/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)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Account = armmaps.Account{
	// 	Name: to.Ptr("myMapsAccount"),
	// 	Type: to.Ptr("Microsoft.Maps/accounts"),
	// 	ID: to.Ptr("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount"),
	// 	Location: to.Ptr("eastus"),
	// 	Tags: map[string]*string{
	// 		"test": to.Ptr("true"),
	// 	},
	// 	Identity: &armmaps.ManagedServiceIdentity{
	// 		Type: to.Ptr(armmaps.ManagedServiceIdentityTypeSystemAssignedUserAssigned),
	// 		PrincipalID: to.Ptr("77f72dac-e0aa-484e-9acd-e5e7075310ef"),
	// 		TenantID: to.Ptr("06006684-60c1-4954-a20c-ffd8fbea7276"),
	// 		UserAssignedIdentities: map[string]*armmaps.UserAssignedIdentity{
	// 			"/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName": &armmaps.UserAssignedIdentity{
	// 				ClientID: to.Ptr("b602d315-01b5-4265-af23-859edc4f2431"),
	// 				PrincipalID: to.Ptr("ac287332-364a-41d9-a567-9ad86b9fc299"),
	// 			},
	// 		},
	// 	},
	// 	Kind: to.Ptr(armmaps.KindGen2),
	// 	Properties: &armmaps.AccountProperties{
	// 		DisableLocalAuth: to.Ptr(true),
	// 		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"),
	// 		}},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UniqueID: to.Ptr("b2e763e6-d6f3-4858-9e2b-7cf8df85c593"),
	// 	},
	// 	SKU: &armmaps.SKU{
	// 		Name: to.Ptr(armmaps.NameG2),
	// 		Tier: to.Ptr("Standard"),
	// 	},
	// 	SystemData: &armmaps.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-02T01:01:01.107Z"); return t}()),
	// 		CreatedBy: to.Ptr("string"),
	// 		CreatedByType: to.Ptr(armmaps.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-02T01:01:01.107Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("string"),
	// 		LastModifiedByType: to.Ptr(armmaps.CreatedByTypeApplication),
	// 	},
	// }
}
Output:

Example (CreateGen1Account)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9403296f0b0e112b0d8222ad05fd1d79ee10e03/specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/CreateAccount.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()
	clientFactory, err := armmaps.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAccountsClient().CreateOrUpdate(ctx, "myResourceGroup", "myMapsAccount", armmaps.Account{
		Location: to.Ptr("eastus"),
		Tags: map[string]*string{
			"test": to.Ptr("true"),
		},
		Kind: to.Ptr(armmaps.KindGen1),
		Properties: &armmaps.AccountProperties{
			Cors: &armmaps.CorsRules{
				CorsRules: []*armmaps.CorsRule{
					{
						AllowedOrigins: []*string{
							to.Ptr("http://www.contoso.com"),
							to.Ptr("http://www.fabrikam.com")},
					}},
			},
			DisableLocalAuth: to.Ptr(false),
		},
		SKU: &armmaps.SKU{
			Name: to.Ptr(armmaps.NameS0),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Account = armmaps.Account{
	// 	Name: to.Ptr("myMapsAccount"),
	// 	Type: to.Ptr("Microsoft.Maps/accounts"),
	// 	ID: to.Ptr("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount"),
	// 	Location: to.Ptr("eastus"),
	// 	Tags: map[string]*string{
	// 		"test": to.Ptr("true"),
	// 	},
	// 	Kind: to.Ptr(armmaps.KindGen1),
	// 	Properties: &armmaps.AccountProperties{
	// 		Cors: &armmaps.CorsRules{
	// 			CorsRules: []*armmaps.CorsRule{
	// 				{
	// 					AllowedOrigins: []*string{
	// 						to.Ptr("http://www.contoso.com"),
	// 						to.Ptr("http://www.fabrikam.com")},
	// 				}},
	// 			},
	// 			DisableLocalAuth: to.Ptr(false),
	// 			ProvisioningState: to.Ptr("Succeeded"),
	// 			UniqueID: to.Ptr("b2e763e6-d6f3-4858-9e2b-7cf8df85c593"),
	// 		},
	// 		SKU: &armmaps.SKU{
	// 			Name: to.Ptr(armmaps.NameS0),
	// 			Tier: to.Ptr("Standard"),
	// 		},
	// 		SystemData: &armmaps.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-02T01:01:01.107Z"); return t}()),
	// 			CreatedBy: to.Ptr("string"),
	// 			CreatedByType: to.Ptr(armmaps.CreatedByTypeApplication),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-02T01:01:01.107Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("string"),
	// 			LastModifiedByType: to.Ptr(armmaps.CreatedByTypeApplication),
	// 		},
	// 	}
}
Output:

Example (CreateGen2Account)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9403296f0b0e112b0d8222ad05fd1d79ee10e03/specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/CreateAccountGen2.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()
	clientFactory, err := armmaps.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAccountsClient().CreateOrUpdate(ctx, "myResourceGroup", "myMapsAccount", armmaps.Account{
		Location: to.Ptr("eastus"),
		Tags: map[string]*string{
			"test": to.Ptr("true"),
		},
		Kind: to.Ptr(armmaps.KindGen2),
		Properties: &armmaps.AccountProperties{
			Cors: &armmaps.CorsRules{
				CorsRules: []*armmaps.CorsRule{
					{
						AllowedOrigins: []*string{
							to.Ptr("http://www.contoso.com"),
							to.Ptr("http://www.fabrikam.com")},
					}},
			},
			DisableLocalAuth: to.Ptr(true),
		},
		SKU: &armmaps.SKU{
			Name: to.Ptr(armmaps.NameG2),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Account = armmaps.Account{
	// 	Name: to.Ptr("myMapsAccount"),
	// 	Type: to.Ptr("Microsoft.Maps/accounts"),
	// 	ID: to.Ptr("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount"),
	// 	Location: to.Ptr("eastus"),
	// 	Tags: map[string]*string{
	// 		"test": to.Ptr("true"),
	// 	},
	// 	Kind: to.Ptr(armmaps.KindGen2),
	// 	Properties: &armmaps.AccountProperties{
	// 		Cors: &armmaps.CorsRules{
	// 			CorsRules: []*armmaps.CorsRule{
	// 				{
	// 					AllowedOrigins: []*string{
	// 						to.Ptr("http://www.contoso.com"),
	// 						to.Ptr("http://www.fabrikam.com")},
	// 				}},
	// 			},
	// 			DisableLocalAuth: to.Ptr(true),
	// 			ProvisioningState: to.Ptr("Succeeded"),
	// 			UniqueID: to.Ptr("b2e763e6-d6f3-4858-9e2b-7cf8df85c593"),
	// 		},
	// 		SKU: &armmaps.SKU{
	// 			Name: to.Ptr(armmaps.NameG2),
	// 			Tier: to.Ptr("Standard"),
	// 		},
	// 		SystemData: &armmaps.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-02T01:01:01.107Z"); return t}()),
	// 			CreatedBy: to.Ptr("string"),
	// 			CreatedByType: to.Ptr(armmaps.CreatedByTypeApplication),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-02T01:01:01.107Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("string"),
	// 			LastModifiedByType: to.Ptr(armmaps.CreatedByTypeApplication),
	// 		},
	// 	}
}
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 2023-06-01

  • 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/blob/b9403296f0b0e112b0d8222ad05fd1d79ee10e03/specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/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()
	clientFactory, err := armmaps.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewAccountsClient().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 2023-06-01

  • 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/blob/b9403296f0b0e112b0d8222ad05fd1d79ee10e03/specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/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()
	clientFactory, err := armmaps.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAccountsClient().Get(ctx, "myResourceGroup", "myMapsAccount", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Account = armmaps.Account{
	// 	Name: to.Ptr("myMapsAccount"),
	// 	Type: to.Ptr("Microsoft.Maps/accounts"),
	// 	ID: to.Ptr("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount"),
	// 	Location: to.Ptr("eastus"),
	// 	Tags: map[string]*string{
	// 		"test": to.Ptr("true"),
	// 	},
	// 	Kind: to.Ptr(armmaps.KindGen1),
	// 	Properties: &armmaps.AccountProperties{
	// 		DisableLocalAuth: to.Ptr(false),
	// 		LinkedResources: []*armmaps.LinkedResource{
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UniqueID: to.Ptr("string"),
	// 	},
	// 	SKU: &armmaps.SKU{
	// 		Name: to.Ptr(armmaps.NameS0),
	// 		Tier: to.Ptr("Standard"),
	// 	},
	// 	SystemData: &armmaps.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-02T01:01:01.107Z"); return t}()),
	// 		CreatedBy: to.Ptr("string"),
	// 		CreatedByType: to.Ptr(armmaps.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-02T01:01:01.107Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("string"),
	// 		LastModifiedByType: to.Ptr(armmaps.CreatedByTypeApplication),
	// 	},
	// }
}
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 2023-06-01

  • 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/blob/b9403296f0b0e112b0d8222ad05fd1d79ee10e03/specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/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()
	clientFactory, err := armmaps.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAccountsClient().ListKeys(ctx, "myResourceGroup", "myMapsAccount", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.AccountKeys = armmaps.AccountKeys{
	// 	PrimaryKey: to.Ptr("<primaryKey>"),
	// 	PrimaryKeyLastUpdated: to.Ptr("2021-07-02T01:01:01.1075056Z"),
	// 	SecondaryKey: to.Ptr("<secondaryKey>"),
	// 	SecondaryKeyLastUpdated: to.Ptr("2021-07-02T01:01:01.1075056Z"),
	// }
}
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 2023-06-01

  • 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/blob/b9403296f0b0e112b0d8222ad05fd1d79ee10e03/specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/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()
	clientFactory, err := armmaps.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAccountsClient().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)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.AccountSasToken = armmaps.AccountSasToken{
	// 	AccountSasToken: to.Ptr("accountSasToken"),
	// }
}
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

Generated from API version 2023-06-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • options - AccountsClientListByResourceGroupOptions contains the optional parameters for the AccountsClient.NewListByResourceGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9403296f0b0e112b0d8222ad05fd1d79ee10e03/specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/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()
	clientFactory, err := armmaps.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAccountsClient().NewListByResourceGroupPager("myResourceGroup", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.Accounts = armmaps.Accounts{
		// 	Value: []*armmaps.Account{
		// 		{
		// 			Name: to.Ptr("myMapsAccount2"),
		// 			Type: to.Ptr("Microsoft.Maps/accounts"),
		// 			ID: to.Ptr("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount2"),
		// 			Location: to.Ptr("eastus"),
		// 			Tags: map[string]*string{
		// 				"test": to.Ptr("true"),
		// 			},
		// 			Kind: to.Ptr(armmaps.KindGen1),
		// 			Properties: &armmaps.AccountProperties{
		// 				DisableLocalAuth: to.Ptr(false),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				UniqueID: to.Ptr("b2e763e6-d6f3-4858-9e2b-7cf8df85c593"),
		// 			},
		// 			SKU: &armmaps.SKU{
		// 				Name: to.Ptr(armmaps.NameS0),
		// 				Tier: to.Ptr("Standard"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("myMapsAccount"),
		// 			Type: to.Ptr("Microsoft.Maps/accounts"),
		// 			ID: to.Ptr("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount"),
		// 			Location: to.Ptr("eastus"),
		// 			Tags: map[string]*string{
		// 				"test": to.Ptr("true"),
		// 			},
		// 			Kind: to.Ptr(armmaps.KindGen2),
		// 			Properties: &armmaps.AccountProperties{
		// 				DisableLocalAuth: to.Ptr(true),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				UniqueID: to.Ptr("b2e763e6-d6f3-4858-9e2b-7cf8df85c592"),
		// 			},
		// 			SKU: &armmaps.SKU{
		// 				Name: to.Ptr(armmaps.NameG2),
		// 				Tier: to.Ptr("Standard"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*AccountsClient) NewListBySubscriptionPager added in v0.4.0

NewListBySubscriptionPager - Get all Maps Accounts in a Subscription

Generated from API version 2023-06-01

  • options - AccountsClientListBySubscriptionOptions contains the optional parameters for the AccountsClient.NewListBySubscriptionPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9403296f0b0e112b0d8222ad05fd1d79ee10e03/specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/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()
	clientFactory, err := armmaps.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAccountsClient().NewListBySubscriptionPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.Accounts = armmaps.Accounts{
		// 	Value: []*armmaps.Account{
		// 		{
		// 			Name: to.Ptr("myMapsAccount2"),
		// 			Type: to.Ptr("Microsoft.Maps/accounts"),
		// 			ID: to.Ptr("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount2"),
		// 			Location: to.Ptr("eastus"),
		// 			Tags: map[string]*string{
		// 				"test": to.Ptr("true"),
		// 			},
		// 			Kind: to.Ptr(armmaps.KindGen1),
		// 			Properties: &armmaps.AccountProperties{
		// 				DisableLocalAuth: to.Ptr(false),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				UniqueID: to.Ptr("b2e763e6-d6f3-4858-9e2b-7cf8df85c593"),
		// 			},
		// 			SKU: &armmaps.SKU{
		// 				Name: to.Ptr(armmaps.NameS0),
		// 				Tier: to.Ptr("Standard"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("myMapsAccount"),
		// 			Type: to.Ptr("Microsoft.Maps/accounts"),
		// 			ID: to.Ptr("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount"),
		// 			Location: to.Ptr("eastus"),
		// 			Tags: map[string]*string{
		// 				"test": to.Ptr("true"),
		// 			},
		// 			Kind: to.Ptr(armmaps.KindGen2),
		// 			Properties: &armmaps.AccountProperties{
		// 				DisableLocalAuth: to.Ptr(true),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				UniqueID: to.Ptr("b2e763e6-d6f3-4858-9e2b-7cf8df85c592"),
		// 			},
		// 			SKU: &armmaps.SKU{
		// 				Name: to.Ptr(armmaps.NameG2),
		// 				Tier: to.Ptr("Standard"),
		// 			},
		// 	}},
		// }
	}
}
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 2023-06-01

  • 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/blob/b9403296f0b0e112b0d8222ad05fd1d79ee10e03/specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/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()
	clientFactory, err := armmaps.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAccountsClient().RegenerateKeys(ctx, "myResourceGroup", "myMapsAccount", armmaps.KeySpecification{
		KeyType: to.Ptr(armmaps.KeyTypePrimary),
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.AccountKeys = armmaps.AccountKeys{
	// 	PrimaryKey: to.Ptr("<primaryKey>"),
	// 	PrimaryKeyLastUpdated: to.Ptr("2021-07-02T01:01:01.1075056Z"),
	// 	SecondaryKey: to.Ptr("<secondaryKey>"),
	// 	SecondaryKeyLastUpdated: to.Ptr("2021-07-02T01:01:01.1075056Z"),
	// }
}
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 2023-06-01

  • 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 (UpdateAccountEncryption)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9403296f0b0e112b0d8222ad05fd1d79ee10e03/specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/UpdateAccountEncryption.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()
	clientFactory, err := armmaps.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAccountsClient().Update(ctx, "myResourceGroup", "myMapsAccount", armmaps.AccountUpdateParameters{
		Identity: &armmaps.ManagedServiceIdentity{
			Type: to.Ptr(armmaps.ManagedServiceIdentityTypeSystemAssigned),
			UserAssignedIdentities: map[string]*armmaps.UserAssignedIdentity{
				"/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName": nil,
			},
		},
		Properties: &armmaps.AccountProperties{
			Encryption: &armmaps.Encryption{
				CustomerManagedKeyEncryption: &armmaps.CustomerManagedKeyEncryption{
					KeyEncryptionKeyIdentity: &armmaps.CustomerManagedKeyEncryptionKeyIdentity{
						IdentityType: to.Ptr(armmaps.IdentityTypeSystemAssignedIdentity),
					},
					KeyEncryptionKeyURL: to.Ptr("https://contosovault.vault.azure.net/keys/contosokek"),
				},
			},
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Account = armmaps.Account{
	// 	Name: to.Ptr("myMapsAccount"),
	// 	Type: to.Ptr("Microsoft.Maps/accounts"),
	// 	ID: to.Ptr("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount"),
	// 	Location: to.Ptr("eastus"),
	// 	Identity: &armmaps.ManagedServiceIdentity{
	// 		Type: to.Ptr(armmaps.ManagedServiceIdentityTypeSystemAssigned),
	// 		PrincipalID: to.Ptr("77f72dac-e0aa-484e-9acd-e5e7075310ef"),
	// 		TenantID: to.Ptr("06006684-60c1-4954-a20c-ffd8fbea7276"),
	// 		UserAssignedIdentities: map[string]*armmaps.UserAssignedIdentity{
	// 			"/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName": &armmaps.UserAssignedIdentity{
	// 				ClientID: to.Ptr("b602d315-01b5-4265-af23-859edc4f2431"),
	// 				PrincipalID: to.Ptr("ac287332-364a-41d9-a567-9ad86b9fc299"),
	// 			},
	// 		},
	// 	},
	// 	Kind: to.Ptr(armmaps.KindGen2),
	// 	Properties: &armmaps.AccountProperties{
	// 		Encryption: &armmaps.Encryption{
	// 			CustomerManagedKeyEncryption: &armmaps.CustomerManagedKeyEncryption{
	// 				KeyEncryptionKeyIdentity: &armmaps.CustomerManagedKeyEncryptionKeyIdentity{
	// 					IdentityType: to.Ptr(armmaps.IdentityTypeSystemAssignedIdentity),
	// 				},
	// 				KeyEncryptionKeyURL: to.Ptr("https://contosovault.vault.azure.net/keys/contosokek"),
	// 			},
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UniqueID: to.Ptr("b2e763e6-d6f3-4858-9e2b-7cf8df85c593"),
	// 	},
	// 	SKU: &armmaps.SKU{
	// 		Name: to.Ptr(armmaps.NameG2),
	// 		Tier: to.Ptr("Standard"),
	// 	},
	// 	SystemData: &armmaps.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-02T01:01:01.107Z"); return t}()),
	// 		CreatedBy: to.Ptr("string"),
	// 		CreatedByType: to.Ptr(armmaps.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-02T01:01:01.107Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("string"),
	// 		LastModifiedByType: to.Ptr(armmaps.CreatedByTypeApplication),
	// 	},
	// }
}
Output:

Example (UpdateAccountManagedIdentities)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9403296f0b0e112b0d8222ad05fd1d79ee10e03/specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/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()
	clientFactory, err := armmaps.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAccountsClient().Update(ctx, "myResourceGroup", "myMapsAccount", armmaps.AccountUpdateParameters{
		Identity: &armmaps.ManagedServiceIdentity{
			Type: to.Ptr(armmaps.ManagedServiceIdentityTypeSystemAssignedUserAssigned),
			UserAssignedIdentities: map[string]*armmaps.UserAssignedIdentity{
				"/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)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Account = armmaps.Account{
	// 	Name: to.Ptr("myMapsAccount"),
	// 	Type: to.Ptr("Microsoft.Maps/accounts"),
	// 	ID: to.Ptr("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount"),
	// 	Location: to.Ptr("eastus"),
	// 	Identity: &armmaps.ManagedServiceIdentity{
	// 		Type: to.Ptr(armmaps.ManagedServiceIdentityTypeSystemAssignedUserAssigned),
	// 		PrincipalID: to.Ptr("77f72dac-e0aa-484e-9acd-e5e7075310ef"),
	// 		TenantID: to.Ptr("06006684-60c1-4954-a20c-ffd8fbea7276"),
	// 		UserAssignedIdentities: map[string]*armmaps.UserAssignedIdentity{
	// 			"/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName": &armmaps.UserAssignedIdentity{
	// 				ClientID: to.Ptr("b602d315-01b5-4265-af23-859edc4f2431"),
	// 				PrincipalID: to.Ptr("ac287332-364a-41d9-a567-9ad86b9fc299"),
	// 			},
	// 		},
	// 	},
	// 	Kind: to.Ptr(armmaps.KindGen2),
	// 	Properties: &armmaps.AccountProperties{
	// 		DisableLocalAuth: to.Ptr(false),
	// 		LinkedResources: []*armmaps.LinkedResource{
	// 			{
	// 				ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/accounts/{storageName}"),
	// 				UniqueName: to.Ptr("myBatchStorageAccount"),
	// 		}},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UniqueID: to.Ptr("b2e763e6-d6f3-4858-9e2b-7cf8df85c593"),
	// 	},
	// 	SKU: &armmaps.SKU{
	// 		Name: to.Ptr(armmaps.NameG2),
	// 		Tier: to.Ptr("Standard"),
	// 	},
	// 	SystemData: &armmaps.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-02T01:01:01.107Z"); return t}()),
	// 		CreatedBy: to.Ptr("string"),
	// 		CreatedByType: to.Ptr(armmaps.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-02T01:01:01.107Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("string"),
	// 		LastModifiedByType: to.Ptr(armmaps.CreatedByTypeApplication),
	// 	},
	// }
}
Output:

Example (UpdateAccountTags)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9403296f0b0e112b0d8222ad05fd1d79ee10e03/specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/UpdateAccount.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()
	clientFactory, err := armmaps.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAccountsClient().Update(ctx, "myResourceGroup", "myMapsAccount", armmaps.AccountUpdateParameters{
		Tags: map[string]*string{
			"specialTag": to.Ptr("true"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Account = armmaps.Account{
	// 	Name: to.Ptr("myMapsAccount"),
	// 	Type: to.Ptr("Microsoft.Maps/accounts"),
	// 	ID: to.Ptr("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount"),
	// 	Location: to.Ptr("eastus"),
	// 	Tags: map[string]*string{
	// 		"specialTag": to.Ptr("true"),
	// 	},
	// 	Kind: to.Ptr(armmaps.KindGen1),
	// 	Properties: &armmaps.AccountProperties{
	// 		DisableLocalAuth: to.Ptr(false),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UniqueID: to.Ptr("b2e763e6-d6f3-4858-9e2b-7cf8df85c593"),
	// 	},
	// 	SKU: &armmaps.SKU{
	// 		Name: to.Ptr(armmaps.NameS0),
	// 		Tier: to.Ptr("Standard"),
	// 	},
	// 	SystemData: &armmaps.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-02T01:01:01.107Z"); return t}()),
	// 		CreatedBy: to.Ptr("string"),
	// 		CreatedByType: to.Ptr(armmaps.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-02T01:01:01.107Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("string"),
	// 		LastModifiedByType: to.Ptr(armmaps.CreatedByTypeApplication),
	// 	},
	// }
}
Output:

Example (UpdateToGen1Account)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9403296f0b0e112b0d8222ad05fd1d79ee10e03/specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/UpdateAccountGen1.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()
	clientFactory, err := armmaps.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAccountsClient().Update(ctx, "myResourceGroup", "myMapsAccount", armmaps.AccountUpdateParameters{
		Kind: to.Ptr(armmaps.KindGen1),
		SKU: &armmaps.SKU{
			Name: to.Ptr(armmaps.NameS1),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Account = armmaps.Account{
	// 	Name: to.Ptr("myMapsAccount"),
	// 	Type: to.Ptr("Microsoft.Maps/accounts"),
	// 	ID: to.Ptr("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount"),
	// 	Location: to.Ptr("eastus"),
	// 	Kind: to.Ptr(armmaps.KindGen1),
	// 	Properties: &armmaps.AccountProperties{
	// 		DisableLocalAuth: to.Ptr(false),
	// 		LinkedResources: []*armmaps.LinkedResource{
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UniqueID: to.Ptr("b2e763e6-d6f3-4858-9e2b-7cf8df85c593"),
	// 	},
	// 	SKU: &armmaps.SKU{
	// 		Name: to.Ptr(armmaps.NameS1),
	// 		Tier: to.Ptr("Standard"),
	// 	},
	// 	SystemData: &armmaps.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-02T01:01:01.107Z"); return t}()),
	// 		CreatedBy: to.Ptr("string"),
	// 		CreatedByType: to.Ptr(armmaps.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-02T01:01:01.107Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("string"),
	// 		LastModifiedByType: to.Ptr(armmaps.CreatedByTypeApplication),
	// 	},
	// }
}
Output:

Example (UpdateToGen2Account)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9403296f0b0e112b0d8222ad05fd1d79ee10e03/specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/UpdateAccountGen2.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()
	clientFactory, err := armmaps.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAccountsClient().Update(ctx, "myResourceGroup", "myMapsAccount", armmaps.AccountUpdateParameters{
		Kind: to.Ptr(armmaps.KindGen2),
		SKU: &armmaps.SKU{
			Name: to.Ptr(armmaps.NameG2),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Account = armmaps.Account{
	// 	Name: to.Ptr("myMapsAccount"),
	// 	Type: to.Ptr("Microsoft.Maps/accounts"),
	// 	ID: to.Ptr("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount"),
	// 	Location: to.Ptr("eastus"),
	// 	Kind: to.Ptr(armmaps.KindGen2),
	// 	Properties: &armmaps.AccountProperties{
	// 		DisableLocalAuth: to.Ptr(false),
	// 		LinkedResources: []*armmaps.LinkedResource{
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UniqueID: to.Ptr("b2e763e6-d6f3-4858-9e2b-7cf8df85c593"),
	// 	},
	// 	SKU: &armmaps.SKU{
	// 		Name: to.Ptr(armmaps.NameG2),
	// 		Tier: to.Ptr("Standard"),
	// 	},
	// 	SystemData: &armmaps.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-02T01:01:01.107Z"); return t}()),
	// 		CreatedBy: to.Ptr("string"),
	// 		CreatedByType: to.Ptr(armmaps.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-07-02T01:01:01.107Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("string"),
	// 		LastModifiedByType: to.Ptr(armmaps.CreatedByTypeApplication),
	// 	},
	// }
}
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 {
	// An Azure resource which represents access to a suite of Maps REST APIs.
	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 {
	// An Azure resource which represents access to a suite of Maps REST APIs.
	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.NewListByResourceGroupPager method.

type AccountsClientListByResourceGroupResponse added in v0.2.0

type AccountsClientListByResourceGroupResponse struct {
	// A list of Maps Accounts.
	Accounts
}

AccountsClientListByResourceGroupResponse contains the response from method AccountsClient.NewListByResourceGroupPager.

type AccountsClientListBySubscriptionOptions added in v0.2.0

type AccountsClientListBySubscriptionOptions struct {
}

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

type AccountsClientListBySubscriptionResponse added in v0.2.0

type AccountsClientListBySubscriptionResponse struct {
	// A list of Maps Accounts.
	Accounts
}

AccountsClientListBySubscriptionResponse contains the response from method AccountsClient.NewListBySubscriptionPager.

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 {
	// The set of keys which can be used to access the Maps REST APIs. Two keys are provided for key rotation without interruption.
	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 {
	// 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.
	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 {
	// The set of keys which can be used to access the Maps REST APIs. Two keys are provided for key rotation without interruption.
	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 {
	// An Azure resource which represents access to a suite of Maps REST APIs.
	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

Generated from API version 2023-06-01

  • options - ClientListOperationsOptions contains the optional parameters for the Client.NewListOperationsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9403296f0b0e112b0d8222ad05fd1d79ee10e03/specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/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()
	clientFactory, err := armmaps.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewClient().NewListOperationsPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.Operations = armmaps.Operations{
		// 	Value: []*armmaps.OperationDetail{
		// 		{
		// 			Name: to.Ptr("Microsoft.Maps/register/action"),
		// 			Display: &armmaps.OperationDisplay{
		// 				Description: to.Ptr("Register the provider"),
		// 				Operation: to.Ptr("Register the provider"),
		// 				Provider: to.Ptr("Microsoft Maps"),
		// 				Resource: to.Ptr("Maps Account"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Maps/accounts/write"),
		// 			Display: &armmaps.OperationDisplay{
		// 				Description: to.Ptr("Create or update a Maps Account."),
		// 				Operation: to.Ptr("Create or update a Maps Account."),
		// 				Provider: to.Ptr("Microsoft Maps"),
		// 				Resource: to.Ptr("Maps Account"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Maps/accounts/read"),
		// 			Display: &armmaps.OperationDisplay{
		// 				Description: to.Ptr("Get a Maps Account."),
		// 				Operation: to.Ptr("Get a Maps Account."),
		// 				Provider: to.Ptr("Microsoft Maps"),
		// 				Resource: to.Ptr("Maps Account"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Maps/accounts/delete"),
		// 			Display: &armmaps.OperationDisplay{
		// 				Description: to.Ptr("Delete a Maps Account."),
		// 				Operation: to.Ptr("Delete a Maps Account."),
		// 				Provider: to.Ptr("Microsoft Maps"),
		// 				Resource: to.Ptr("Maps Account"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Maps/accounts/listKeys/action"),
		// 			Display: &armmaps.OperationDisplay{
		// 				Description: to.Ptr("List Maps Account keys"),
		// 				Operation: to.Ptr("List keys"),
		// 				Provider: to.Ptr("Microsoft Maps"),
		// 				Resource: to.Ptr("Maps Account"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Maps/accounts/regenerateKey/action"),
		// 			Display: &armmaps.OperationDisplay{
		// 				Description: to.Ptr("Generate new Maps Account primary or secondary key"),
		// 				Operation: to.Ptr("Generate new primary or secondary key"),
		// 				Provider: to.Ptr("Microsoft Maps"),
		// 				Resource: to.Ptr("Maps Account"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Maps/accounts/creators/write"),
		// 			Display: &armmaps.OperationDisplay{
		// 				Description: to.Ptr("Create or update a Maps Creator."),
		// 				Operation: to.Ptr("Create or update a Maps Creator."),
		// 				Provider: to.Ptr("Microsoft Maps"),
		// 				Resource: to.Ptr("Creator"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Maps/accounts/creators/read"),
		// 			Display: &armmaps.OperationDisplay{
		// 				Description: to.Ptr("Get a Maps Creator."),
		// 				Operation: to.Ptr("Get a Maps Creator."),
		// 				Provider: to.Ptr("Microsoft Maps"),
		// 				Resource: to.Ptr("Creator"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Maps/accounts/creators/delete"),
		// 			Display: &armmaps.OperationDisplay{
		// 				Description: to.Ptr("Delete a Maps Creator."),
		// 				Operation: to.Ptr("Delete a Maps Creator."),
		// 				Provider: to.Ptr("Microsoft Maps"),
		// 				Resource: to.Ptr("Creator"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 	}},
		// }
	}
}
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

Generated from API version 2023-06-01

  • options - ClientListSubscriptionOperationsOptions contains the optional parameters for the Client.NewListSubscriptionOperationsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9403296f0b0e112b0d8222ad05fd1d79ee10e03/specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/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()
	clientFactory, err := armmaps.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewClient().NewListSubscriptionOperationsPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.Operations = armmaps.Operations{
		// 	Value: []*armmaps.OperationDetail{
		// 		{
		// 			Name: to.Ptr("Microsoft.Maps/register/action"),
		// 			Display: &armmaps.OperationDisplay{
		// 				Description: to.Ptr("Register the provider"),
		// 				Operation: to.Ptr("Register the provider"),
		// 				Provider: to.Ptr("Microsoft Maps"),
		// 				Resource: to.Ptr("Maps Account"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Maps/accounts/write"),
		// 			Display: &armmaps.OperationDisplay{
		// 				Description: to.Ptr("Create or update a Maps Account."),
		// 				Operation: to.Ptr("Create or update a Maps Account."),
		// 				Provider: to.Ptr("Microsoft Maps"),
		// 				Resource: to.Ptr("Maps Account"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Maps/accounts/read"),
		// 			Display: &armmaps.OperationDisplay{
		// 				Description: to.Ptr("Get a Maps Account."),
		// 				Operation: to.Ptr("Get a Maps Account."),
		// 				Provider: to.Ptr("Microsoft Maps"),
		// 				Resource: to.Ptr("Maps Account"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Maps/accounts/delete"),
		// 			Display: &armmaps.OperationDisplay{
		// 				Description: to.Ptr("Delete a Maps Account."),
		// 				Operation: to.Ptr("Delete a Maps Account."),
		// 				Provider: to.Ptr("Microsoft Maps"),
		// 				Resource: to.Ptr("Maps Account"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Maps/accounts/listKeys/action"),
		// 			Display: &armmaps.OperationDisplay{
		// 				Description: to.Ptr("List Maps Account keys"),
		// 				Operation: to.Ptr("List keys"),
		// 				Provider: to.Ptr("Microsoft Maps"),
		// 				Resource: to.Ptr("Maps Account"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Maps/accounts/regenerateKey/action"),
		// 			Display: &armmaps.OperationDisplay{
		// 				Description: to.Ptr("Generate new Maps Account primary or secondary key"),
		// 				Operation: to.Ptr("Generate new primary or secondary key"),
		// 				Provider: to.Ptr("Microsoft Maps"),
		// 				Resource: to.Ptr("Maps Account"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Maps/accounts/creators/write"),
		// 			Display: &armmaps.OperationDisplay{
		// 				Description: to.Ptr("Create or update a Maps Creator."),
		// 				Operation: to.Ptr("Create or update a Maps Creator."),
		// 				Provider: to.Ptr("Microsoft Maps"),
		// 				Resource: to.Ptr("Creator"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Maps/accounts/creators/read"),
		// 			Display: &armmaps.OperationDisplay{
		// 				Description: to.Ptr("Get a Maps Creator."),
		// 				Operation: to.Ptr("Get a Maps Creator."),
		// 				Provider: to.Ptr("Microsoft Maps"),
		// 				Resource: to.Ptr("Creator"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Maps/accounts/creators/delete"),
		// 			Display: &armmaps.OperationDisplay{
		// 				Description: to.Ptr("Delete a Maps Creator."),
		// 				Operation: to.Ptr("Delete a Maps Creator."),
		// 				Provider: to.Ptr("Microsoft Maps"),
		// 				Resource: to.Ptr("Creator"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 	}},
		// }
	}
}
Output:

type ClientFactory added in v0.6.0

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

ClientFactory is a client factory used to create any client in this module. Don't use this type directly, use NewClientFactory instead.

func NewClientFactory added in v0.6.0

func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error)

NewClientFactory creates a new instance of ClientFactory with the specified values. The parameter values will be propagated to any client created from this factory.

  • 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 (*ClientFactory) NewAccountsClient added in v0.6.0

func (c *ClientFactory) NewAccountsClient() *AccountsClient

NewAccountsClient creates a new instance of AccountsClient.

func (*ClientFactory) NewClient added in v0.6.0

func (c *ClientFactory) NewClient() *Client

NewClient creates a new instance of Client.

func (*ClientFactory) NewCreatorsClient added in v0.6.0

func (c *ClientFactory) NewCreatorsClient() *CreatorsClient

NewCreatorsClient creates a new instance of CreatorsClient.

type ClientListOperationsOptions added in v0.2.0

type ClientListOperationsOptions struct {
}

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

type ClientListOperationsResponse added in v0.2.0

type ClientListOperationsResponse struct {
	// The set of operations available for Maps.
	Operations
}

ClientListOperationsResponse contains the response from method Client.NewListOperationsPager.

type ClientListSubscriptionOperationsOptions added in v0.2.0

type ClientListSubscriptionOperationsOptions struct {
}

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

type ClientListSubscriptionOperationsResponse added in v0.2.0

type ClientListSubscriptionOperationsResponse struct {
	// The set of operations available for Maps.
	Operations
}

ClientListSubscriptionOperationsResponse contains the response from method Client.NewListSubscriptionOperationsPager.

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
}

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.

func (*CorsRule) UnmarshalJSON added in v0.6.0

func (c *CorsRule) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller 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
}

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.

func (*CorsRules) UnmarshalJSON added in v0.6.0

func (c *CorsRules) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller 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

	// REQUIRED; The Creator resource properties.
	Properties *CreatorProperties

	// Resource tags.
	Tags map[string]*string

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; The system meta data relating to this resource.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

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.

func (*Creator) UnmarshalJSON added in v0.6.0

func (c *Creator) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller 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

	// READ-ONLY; a Creator account.
	Value []*Creator
}

CreatorList - A list of Creator resources.

func (CreatorList) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CreatorList.

func (*CreatorList) UnmarshalJSON added in v0.6.0

func (c *CreatorList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CreatorList.

type CreatorProperties

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

	// READ-ONLY; The state of the resource provisioning, terminal states: Succeeded, Failed, Canceled
	ProvisioningState *string
}

CreatorProperties - Creator resource properties

func (CreatorProperties) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type CreatorProperties.

func (*CreatorProperties) UnmarshalJSON added in v0.6.0

func (c *CreatorProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CreatorProperties.

type CreatorUpdateParameters

type CreatorUpdateParameters struct {
	// Creator resource properties.
	Properties *CreatorProperties

	// 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
}

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.

func (*CreatorUpdateParameters) UnmarshalJSON added in v0.6.0

func (c *CreatorUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller 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 2023-06-01

  • 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/blob/b9403296f0b0e112b0d8222ad05fd1d79ee10e03/specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/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()
	clientFactory, err := armmaps.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewCreatorsClient().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)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Creator = armmaps.Creator{
	// 	Name: to.Ptr("myCreator"),
	// 	Type: to.Ptr("Microsoft.Maps/accounts/creators"),
	// 	ID: to.Ptr("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount/creators/myCreator"),
	// 	Location: to.Ptr("eastus2"),
	// 	Tags: map[string]*string{
	// 		"test": to.Ptr("true"),
	// 	},
	// 	Properties: &armmaps.CreatorProperties{
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		StorageUnits: to.Ptr[int32](5),
	// 	},
	// }
}
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 2023-06-01

  • 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/blob/b9403296f0b0e112b0d8222ad05fd1d79ee10e03/specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/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()
	clientFactory, err := armmaps.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewCreatorsClient().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 2023-06-01

  • 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/blob/b9403296f0b0e112b0d8222ad05fd1d79ee10e03/specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/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()
	clientFactory, err := armmaps.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewCreatorsClient().Get(ctx, "myResourceGroup", "myMapsAccount", "myCreator", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Creator = armmaps.Creator{
	// 	Name: to.Ptr("myCreator"),
	// 	Type: to.Ptr("Microsoft.Maps/accounts/creators"),
	// 	ID: to.Ptr("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount/creators/myCreator"),
	// 	Location: to.Ptr("eastus2"),
	// 	Tags: map[string]*string{
	// 		"test": to.Ptr("true"),
	// 	},
	// 	Properties: &armmaps.CreatorProperties{
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		StorageUnits: to.Ptr[int32](5),
	// 	},
	// }
}
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

Generated from API version 2023-06-01

  • 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.NewListByAccountPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9403296f0b0e112b0d8222ad05fd1d79ee10e03/specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/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()
	clientFactory, err := armmaps.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewCreatorsClient().NewListByAccountPager("myResourceGroup", "myMapsAccount", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.CreatorList = armmaps.CreatorList{
		// 	Value: []*armmaps.Creator{
		// 		{
		// 			Name: to.Ptr("myCreator"),
		// 			Type: to.Ptr("Microsoft.Maps/accounts/creators"),
		// 			ID: to.Ptr("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount/creators/myCreator"),
		// 			Location: to.Ptr("eastus2"),
		// 			Tags: map[string]*string{
		// 				"test": to.Ptr("true"),
		// 			},
		// 			Properties: &armmaps.CreatorProperties{
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				StorageUnits: to.Ptr[int32](5),
		// 			},
		// 	}},
		// }
	}
}
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 2023-06-01

  • 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/blob/b9403296f0b0e112b0d8222ad05fd1d79ee10e03/specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/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()
	clientFactory, err := armmaps.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewCreatorsClient().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)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Creator = armmaps.Creator{
	// 	Name: to.Ptr("myCreator"),
	// 	Type: to.Ptr("Microsoft.Maps/accounts/creators"),
	// 	ID: to.Ptr("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.Maps/accounts/myMapsAccount/creators/myCreator"),
	// 	Location: to.Ptr("eastus2"),
	// 	Tags: map[string]*string{
	// 		"specialTag": to.Ptr("true"),
	// 	},
	// 	Properties: &armmaps.CreatorProperties{
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		StorageUnits: to.Ptr[int32](10),
	// 	},
	// }
}
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 {
	// An Azure resource which represents Maps Creator product and provides ability to manage private location data.
	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 {
	// An Azure resource which represents Maps Creator product and provides ability to manage private location data.
	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.NewListByAccountPager method.

type CreatorsClientListByAccountResponse added in v0.2.0

type CreatorsClientListByAccountResponse struct {
	// A list of Creator resources.
	CreatorList
}

CreatorsClientListByAccountResponse contains the response from method CreatorsClient.NewListByAccountPager.

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 {
	// An Azure resource which represents Maps Creator product and provides ability to manage private location data.
	Creator
}

CreatorsClientUpdateResponse contains the response from method CreatorsClient.Update.

type CustomerManagedKeyEncryption added in v1.0.0

type CustomerManagedKeyEncryption struct {
	// All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault.
	KeyEncryptionKeyIdentity *CustomerManagedKeyEncryptionKeyIdentity

	// key encryption key Url, versioned or non-versioned. Ex: https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78
	// or https://contosovault.vault.azure.net/keys/contosokek.
	KeyEncryptionKeyURL *string
}

CustomerManagedKeyEncryption - All Customer-managed key encryption properties for the resource.

func (CustomerManagedKeyEncryption) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type CustomerManagedKeyEncryption.

func (*CustomerManagedKeyEncryption) UnmarshalJSON added in v1.0.0

func (c *CustomerManagedKeyEncryption) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CustomerManagedKeyEncryption.

type CustomerManagedKeyEncryptionKeyIdentity added in v1.0.0

type CustomerManagedKeyEncryptionKeyIdentity struct {
	// delegated identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId.
	// Mutually exclusive with identityType systemAssignedIdentity and userAssignedIdentity - internal use only.
	DelegatedIdentityClientID *string

	// Values can be systemAssignedIdentity or userAssignedIdentity
	IdentityType *IdentityType

	// user assigned identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/
	// /providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType systemAssignedIdentity
	// and delegatedResourceIdentity.
	UserAssignedIdentityResourceID *string
}

CustomerManagedKeyEncryptionKeyIdentity - All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault.

func (CustomerManagedKeyEncryptionKeyIdentity) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type CustomerManagedKeyEncryptionKeyIdentity.

func (*CustomerManagedKeyEncryptionKeyIdentity) UnmarshalJSON added in v1.0.0

func (c *CustomerManagedKeyEncryptionKeyIdentity) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CustomerManagedKeyEncryptionKeyIdentity.

type Dimension

type Dimension struct {
	// Display name of dimension.
	DisplayName *string

	// Internal metric name of the dimension.
	InternalMetricName *string

	// Internal name of the dimension.
	InternalName *string

	// Display name of dimension.
	Name *string

	// Source Mdm Namespace of the dimension.
	SourceMdmNamespace *string

	// Flag to indicate exporting to Azure Monitor.
	ToBeExportedToShoebox *bool
}

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

func (Dimension) MarshalJSON added in v0.6.0

func (d Dimension) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Dimension.

func (*Dimension) UnmarshalJSON added in v0.6.0

func (d *Dimension) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Dimension.

type Encryption added in v1.0.0

type Encryption struct {
	// All Customer-managed key encryption properties for the resource.
	CustomerManagedKeyEncryption *CustomerManagedKeyEncryption

	// Values are enabled and disabled.
	InfrastructureEncryption *InfrastructureEncryption
}

Encryption - (Optional) Discouraged to include in resource definition. Only needed where it is possible to disable platform (AKA infrastructure) encryption. Azure SQL TDE is an example of this. Values are enabled and disabled.

func (Encryption) MarshalJSON added in v1.0.0

func (e Encryption) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Encryption.

func (*Encryption) UnmarshalJSON added in v1.0.0

func (e *Encryption) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Encryption.

type ErrorAdditionalInfo

type ErrorAdditionalInfo struct {
	// READ-ONLY; The additional info.
	Info any

	// READ-ONLY; The additional info type.
	Type *string
}

ErrorAdditionalInfo - The resource management error additional info.

func (ErrorAdditionalInfo) MarshalJSON added in v0.6.0

func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo.

func (*ErrorAdditionalInfo) UnmarshalJSON added in v0.6.0

func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo.

type ErrorDetail

type ErrorDetail struct {
	// READ-ONLY; The error additional info.
	AdditionalInfo []*ErrorAdditionalInfo

	// READ-ONLY; The error code.
	Code *string

	// READ-ONLY; The error details.
	Details []*ErrorDetail

	// READ-ONLY; The error message.
	Message *string

	// READ-ONLY; The error target.
	Target *string
}

ErrorDetail - The error detail.

func (ErrorDetail) MarshalJSON

func (e ErrorDetail) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ErrorDetail.

func (*ErrorDetail) UnmarshalJSON added in v0.6.0

func (e *ErrorDetail) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail.

type ErrorResponse

type ErrorResponse struct {
	// The error object.
	Error *ErrorDetail
}

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.).

func (ErrorResponse) MarshalJSON added in v0.6.0

func (e ErrorResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ErrorResponse.

func (*ErrorResponse) UnmarshalJSON added in v0.6.0

func (e *ErrorResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse.

type IdentityType added in v1.0.0

type IdentityType string

IdentityType - Values can be systemAssignedIdentity or userAssignedIdentity

const (
	IdentityTypeDelegatedResourceIdentity IdentityType = "delegatedResourceIdentity"
	IdentityTypeSystemAssignedIdentity    IdentityType = "systemAssignedIdentity"
	IdentityTypeUserAssignedIdentity      IdentityType = "userAssignedIdentity"
)

func PossibleIdentityTypeValues added in v1.0.0

func PossibleIdentityTypeValues() []IdentityType

PossibleIdentityTypeValues returns the possible values for the IdentityType const type.

type InfrastructureEncryption added in v1.0.0

type InfrastructureEncryption string

InfrastructureEncryption - Values are enabled and disabled.

const (
	InfrastructureEncryptionDisabled InfrastructureEncryption = "disabled"
	InfrastructureEncryptionEnabled  InfrastructureEncryption = "enabled"
)

func PossibleInfrastructureEncryptionValues added in v1.0.0

func PossibleInfrastructureEncryptionValues() []InfrastructureEncryption

PossibleInfrastructureEncryptionValues returns the possible values for the InfrastructureEncryption const type.

type KeySpecification added in v0.2.0

type KeySpecification struct {
	// REQUIRED; Whether the operation refers to the primary or secondary key.
	KeyType *KeyType
}

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

func (KeySpecification) MarshalJSON added in v0.6.0

func (k KeySpecification) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type KeySpecification.

func (*KeySpecification) UnmarshalJSON added in v0.6.0

func (k *KeySpecification) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type KeySpecification.

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

	// REQUIRED; A provided name which uniquely identifies the linked resource.
	UniqueName *string
}

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.

func (LinkedResource) MarshalJSON added in v0.6.0

func (l LinkedResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type LinkedResource.

func (*LinkedResource) UnmarshalJSON added in v0.6.0

func (l *LinkedResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LinkedResource.

type ManagedServiceIdentity

type ManagedServiceIdentity struct {
	// REQUIRED; Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
	Type *ManagedServiceIdentityType

	// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM
	// resource ids in the form:
	// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.
	// The dictionary values can be empty objects ({}) in
	// requests.
	UserAssignedIdentities map[string]*UserAssignedIdentity

	// READ-ONLY; The service principal ID of the system assigned identity. This property will only be provided for a system assigned
	// identity.
	PrincipalID *string

	// READ-ONLY; The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity.
	TenantID *string
}

ManagedServiceIdentity - Managed service identity (system assigned and/or user assigned identities)

func (ManagedServiceIdentity) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity.

func (*ManagedServiceIdentity) UnmarshalJSON added in v0.6.0

func (m *ManagedServiceIdentity) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentity.

type ManagedServiceIdentityType added in v1.0.0

type ManagedServiceIdentityType string

ManagedServiceIdentityType - Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).

const (
	ManagedServiceIdentityTypeNone                       ManagedServiceIdentityType = "None"
	ManagedServiceIdentityTypeSystemAssigned             ManagedServiceIdentityType = "SystemAssigned"
	ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = "SystemAssigned, UserAssigned"
	ManagedServiceIdentityTypeUserAssigned               ManagedServiceIdentityType = "UserAssigned"
)

func PossibleManagedServiceIdentityTypeValues added in v1.0.0

func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType

PossibleManagedServiceIdentityTypeValues returns the possible values for the ManagedServiceIdentityType const type.

type MetricSpecification

type MetricSpecification struct {
	// Aggregation type could be Average.
	AggregationType *string

	// The category this metric specification belong to, could be Capacity.
	Category *string

	// Dimensions of map account.
	Dimensions []*Dimension

	// Display description of metric specification.
	DisplayDescription *string

	// Display name of metric specification.
	DisplayName *string

	// The property to decide fill gap with zero or not.
	FillGapWithZero *bool

	// Internal metric name.
	InternalMetricName *string

	// Lock aggregation type for metrics.
	LockAggregationType *string

	// Name of metric specification.
	Name *string

	// Account Resource Id.
	ResourceIDDimensionNameOverride *string

	// Source metrics account.
	SourceMdmAccount *string

	// Metrics namespace.
	SourceMdmNamespace *string

	// Allowed aggregation types for metrics.
	SupportedAggregationTypes *string

	// Unit could be Count.
	Unit *string
}

MetricSpecification - Metric specification of operation.

func (MetricSpecification) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type MetricSpecification.

func (*MetricSpecification) UnmarshalJSON added in v0.6.0

func (m *MetricSpecification) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type MetricSpecification.

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

	// Indicates whether the operation is a data action
	IsDataAction *bool

	// Name of the operation
	Name *string

	// Origin of the operation
	Origin *string

	// Properties of the operation
	Properties *OperationProperties
}

OperationDetail - Operation detail payload

func (OperationDetail) MarshalJSON added in v0.6.0

func (o OperationDetail) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationDetail.

func (*OperationDetail) UnmarshalJSON added in v0.6.0

func (o *OperationDetail) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationDetail.

type OperationDisplay

type OperationDisplay struct {
	// Localized friendly description for the operation
	Description *string

	// Localized friendly name for the operation
	Operation *string

	// Resource provider of the operation
	Provider *string

	// Resource of the operation
	Resource *string
}

OperationDisplay - Operation display payload

func (OperationDisplay) MarshalJSON added in v0.6.0

func (o OperationDisplay) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationDisplay.

func (*OperationDisplay) UnmarshalJSON added in v0.6.0

func (o *OperationDisplay) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.

type OperationProperties

type OperationProperties struct {
	// One property of operation, include metric specifications.
	ServiceSpecification *ServiceSpecification
}

OperationProperties - Properties of operation, include metric specifications.

func (OperationProperties) MarshalJSON added in v0.6.0

func (o OperationProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationProperties.

func (*OperationProperties) UnmarshalJSON added in v0.6.0

func (o *OperationProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationProperties.

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

	// READ-ONLY; An operation available for Maps.
	Value []*OperationDetail
}

Operations - The set of operations available for Maps.

func (Operations) MarshalJSON added in v0.2.0

func (o Operations) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Operations.

func (*Operations) UnmarshalJSON added in v0.6.0

func (o *Operations) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Operations.

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

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

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

func (Resource) MarshalJSON

func (r Resource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Resource.

func (*Resource) UnmarshalJSON added in v0.6.0

func (r *Resource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Resource.

type SKU

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

	// READ-ONLY; Gets the sku tier. This is based on the SKU name.
	Tier *string
}

SKU - The SKU of the Maps Account.

func (SKU) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type SKU.

func (*SKU) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type SKU.

type ServiceSpecification

type ServiceSpecification struct {
	// Metric specifications of operation.
	MetricSpecifications []*MetricSpecification
}

ServiceSpecification - One property of operation, include metric specifications.

func (ServiceSpecification) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ServiceSpecification.

func (*ServiceSpecification) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceSpecification.

type SigningKey

type SigningKey string

SigningKey - The Map account key to use for signing. Picking primaryKey or secondaryKey will use the Map account Shared Keys, and using managedIdentity will use the auto-renewed private key to sign the SAS.

const (
	SigningKeyManagedIdentity SigningKey = "managedIdentity"
	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

	// The identity that created the resource.
	CreatedBy *string

	// The type of identity that created the resource.
	CreatedByType *CreatedByType

	// The timestamp of resource last modification (UTC)
	LastModifiedAt *time.Time

	// The identity that last modified the resource.
	LastModifiedBy *string

	// The type of identity that last modified the resource.
	LastModifiedByType *CreatedByType
}

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

	// Resource tags.
	Tags map[string]*string

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

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.

func (*TrackedResource) UnmarshalJSON added in v0.6.0

func (t *TrackedResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource.

type UserAssignedIdentity added in v1.0.0

type UserAssignedIdentity struct {
	// READ-ONLY; The client ID of the assigned identity.
	ClientID *string

	// READ-ONLY; The principal ID of the assigned identity.
	PrincipalID *string
}

UserAssignedIdentity - User assigned identity properties

func (UserAssignedIdentity) MarshalJSON added in v1.0.0

func (u UserAssignedIdentity) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity.

func (*UserAssignedIdentity) UnmarshalJSON added in v1.0.0

func (u *UserAssignedIdentity) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentity.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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