diff --git a/azurerm/internal/services/maps/client/client.go b/azurerm/internal/services/maps/client/client.go index a507d902de46d..62fbf40cf5273 100644 --- a/azurerm/internal/services/maps/client/client.go +++ b/azurerm/internal/services/maps/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2018-05-01/maps" + "github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/common" ) diff --git a/azurerm/internal/services/maps/maps_account_data_source.go b/azurerm/internal/services/maps/maps_account_data_source.go index 4693bf11211b4..fbc2a0db1f181 100644 --- a/azurerm/internal/services/maps/maps_account_data_source.go +++ b/azurerm/internal/services/maps/maps_account_data_source.go @@ -82,7 +82,7 @@ func dataSourceMapsAccountRead(d *schema.ResourceData, meta interface{}) error { d.Set("sku_name", sku.Name) } if props := resp.Properties; props != nil { - d.Set("x_ms_client_id", props.XMsClientID) + d.Set("x_ms_client_id", props.UniqueID) } keysResp, err := client.ListKeys(ctx, resourceGroup, name) diff --git a/azurerm/internal/services/maps/maps_account_resource.go b/azurerm/internal/services/maps/maps_account_resource.go index bc8161ff9624b..774aa9657fe88 100644 --- a/azurerm/internal/services/maps/maps_account_resource.go +++ b/azurerm/internal/services/maps/maps_account_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2018-05-01/maps" + "github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -53,8 +53,9 @@ func resourceMapsAccount() *schema.Resource { Required: true, ForceNew: true, ValidateFunc: validation.StringInSlice([]string{ - "S0", - "S1", + string(maps.NameS0), + string(maps.NameS1), + string(maps.NameG2), }, false), }, @@ -105,10 +106,10 @@ func resourceMapsAccountCreateUpdate(d *schema.ResourceData, meta interface{}) e } } - parameters := maps.AccountCreateParameters{ + parameters := maps.Account{ Location: utils.String("global"), Sku: &maps.Sku{ - Name: &sku, + Name: maps.Name(sku), }, Tags: tags.Expand(t), } @@ -157,7 +158,7 @@ func resourceMapsAccountRead(d *schema.ResourceData, meta interface{}) error { d.Set("sku_name", sku.Name) } if props := resp.Properties; props != nil { - d.Set("x_ms_client_id", props.XMsClientID) + d.Set("x_ms_client_id", props.UniqueID) } keysResp, err := client.ListKeys(ctx, id.ResourceGroup, id.Name) diff --git a/azurerm/internal/services/maps/maps_account_resource_test.go b/azurerm/internal/services/maps/maps_account_resource_test.go index 2d959faa437cc..3bbab138a3b4a 100644 --- a/azurerm/internal/services/maps/maps_account_resource_test.go +++ b/azurerm/internal/services/maps/maps_account_resource_test.go @@ -42,7 +42,7 @@ func TestAccMapsAccount_sku(t *testing.T) { data.ResourceTest(t, r, []resource.TestStep{ { - Config: r.sku(data), + Config: r.sku(data, "S1"), Check: resource.ComposeTestCheckFunc( check.That(data.ResourceName).Key("name").Exists(), check.That(data.ResourceName).Key("x_ms_client_id").Exists(), @@ -55,6 +55,25 @@ func TestAccMapsAccount_sku(t *testing.T) { }) } +func TestAccMapsAccount_skuG2(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_maps_account", "test") + r := MapsAccountResource{} + + data.ResourceTest(t, r, []resource.TestStep{ + { + Config: r.sku(data, "G2"), + Check: resource.ComposeTestCheckFunc( + check.That(data.ResourceName).Key("name").Exists(), + check.That(data.ResourceName).Key("x_ms_client_id").Exists(), + check.That(data.ResourceName).Key("primary_access_key").Exists(), + check.That(data.ResourceName).Key("secondary_access_key").Exists(), + check.That(data.ResourceName).Key("sku_name").HasValue("G2"), + ), + }, + data.ImportStep(), + }) +} + func TestAccMapsAccount_tags(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_maps_account", "test") r := MapsAccountResource{} @@ -113,7 +132,7 @@ resource "azurerm_maps_account" "test" { `, data.RandomInteger, data.Locations.Primary, data.RandomInteger) } -func (MapsAccountResource) sku(data acceptance.TestData) string { +func (MapsAccountResource) sku(data acceptance.TestData, sku string) string { return fmt.Sprintf(` provider "azurerm" { features {} @@ -127,9 +146,9 @@ resource "azurerm_resource_group" "test" { resource "azurerm_maps_account" "test" { name = "accMapsAccount-%d" resource_group_name = azurerm_resource_group.test.name - sku_name = "S1" + sku_name = "%s" } -`, data.RandomInteger, data.Locations.Primary, data.RandomInteger) +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, sku) } func (MapsAccountResource) tags(data acceptance.TestData) string { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2018-05-01/maps/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2018-05-01/maps/enums.go deleted file mode 100644 index 677f73fb7d981..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2018-05-01/maps/enums.go +++ /dev/null @@ -1,22 +0,0 @@ -package maps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -// KeyType enumerates the values for key type. -type KeyType string - -const ( - // Primary ... - Primary KeyType = "primary" - // Secondary ... - Secondary KeyType = "secondary" -) - -// PossibleKeyTypeValues returns an array of possible values for the KeyType const type. -func PossibleKeyTypeValues() []KeyType { - return []KeyType{Primary, Secondary} -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2018-05-01/maps/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2018-05-01/maps/models.go deleted file mode 100644 index 408b7b885d9dd..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2018-05-01/maps/models.go +++ /dev/null @@ -1,211 +0,0 @@ -package maps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "encoding/json" - "github.com/Azure/go-autorest/autorest" -) - -// The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2018-05-01/maps" - -// Account an Azure resource which represents access to a suite of Maps REST APIs. -type Account struct { - autorest.Response `json:"-"` - // Location - READ-ONLY; The location of the resource. - Location *string `json:"location,omitempty"` - // Tags - READ-ONLY; Gets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. - Tags map[string]*string `json:"tags"` - // Sku - READ-ONLY; The SKU of this account. - Sku *Sku `json:"sku,omitempty"` - // Properties - READ-ONLY; The map account properties. - Properties *AccountProperties `json:"properties,omitempty"` - // ID - READ-ONLY; The fully qualified Maps Account resource identifier. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the Maps Account, which is unique within a Resource Group. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Azure resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Account. -func (a Account) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// AccountCreateParameters parameters used to create a new Maps Account. -type AccountCreateParameters struct { - // Location - The location of the resource. - Location *string `json:"location,omitempty"` - // Tags - Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. - Tags map[string]*string `json:"tags"` - // Sku - The SKU of this account. - Sku *Sku `json:"sku,omitempty"` -} - -// MarshalJSON is the custom marshaler for AccountCreateParameters. -func (acp AccountCreateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if acp.Location != nil { - objectMap["location"] = acp.Location - } - if acp.Tags != nil { - objectMap["tags"] = acp.Tags - } - if acp.Sku != nil { - objectMap["sku"] = acp.Sku - } - return json.Marshal(objectMap) -} - -// AccountKeys the set of keys which can be used to access the Maps REST APIs. Two keys are provided for -// key rotation without interruption. -type AccountKeys struct { - autorest.Response `json:"-"` - // ID - READ-ONLY; The full Azure resource identifier of the Maps Account. - ID *string `json:"id,omitempty"` - // PrimaryKey - READ-ONLY; The primary key for accessing the Maps REST APIs. - PrimaryKey *string `json:"primaryKey,omitempty"` - // SecondaryKey - READ-ONLY; The secondary key for accessing the Maps REST APIs. - SecondaryKey *string `json:"secondaryKey,omitempty"` -} - -// AccountProperties additional Map account properties -type AccountProperties struct { - // XMsClientID - A unique identifier for the maps account - XMsClientID *string `json:"x-ms-client-id,omitempty"` -} - -// Accounts a list of Maps Accounts. -type Accounts struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; a Maps Account. - Value *[]Account `json:"value,omitempty"` -} - -// AccountsMoveRequest the description of what resources to move between resource groups. -type AccountsMoveRequest struct { - // TargetResourceGroup - The name of the destination resource group. - TargetResourceGroup *string `json:"targetResourceGroup,omitempty"` - // ResourceIds - A list of resource names to move from the source resource group. - ResourceIds *[]string `json:"resourceIds,omitempty"` -} - -// AccountUpdateParameters parameters used to update an existing Maps Account. -type AccountUpdateParameters struct { - // Tags - Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. - Tags map[string]*string `json:"tags"` - // Sku - The SKU of this account. - Sku *Sku `json:"sku,omitempty"` -} - -// MarshalJSON is the custom marshaler for AccountUpdateParameters. -func (aup AccountUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if aup.Tags != nil { - objectMap["tags"] = aup.Tags - } - if aup.Sku != nil { - objectMap["sku"] = aup.Sku - } - return json.Marshal(objectMap) -} - -// Error this object is returned when an error occurs in the Maps API -type Error struct { - // Code - READ-ONLY; Error code. - Code *string `json:"code,omitempty"` - // Message - READ-ONLY; If available, a human readable description of the error. - Message *string `json:"message,omitempty"` - // Target - READ-ONLY; If available, the component generating the error. - Target *string `json:"target,omitempty"` - // Details - READ-ONLY; If available, a list of additional details about the error. - Details *[]ErrorDetailsItem `json:"details,omitempty"` -} - -// ErrorDetailsItem ... -type ErrorDetailsItem struct { - // Code - READ-ONLY; Error code. - Code *string `json:"code,omitempty"` - // Message - READ-ONLY; If available, a human readable description of the error. - Message *string `json:"message,omitempty"` - // Target - READ-ONLY; If available, the component generating the error. - Target *string `json:"target,omitempty"` -} - -// KeySpecification whether the operation refers to the primary or secondary key. -type KeySpecification struct { - // KeyType - Whether the operation refers to the primary or secondary key. Possible values include: 'Primary', 'Secondary' - KeyType KeyType `json:"keyType,omitempty"` -} - -// Operations the set of operations available for Maps. -type Operations struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; An operation available for Maps. - Value *[]OperationsValueItem `json:"value,omitempty"` -} - -// OperationsValueItem ... -type OperationsValueItem struct { - // Name - READ-ONLY; Operation name: {provider}/{resource}/{operation}. - Name *string `json:"name,omitempty"` - // Display - The human-readable description of the operation. - Display *OperationsValueItemDisplay `json:"display,omitempty"` - // Origin - READ-ONLY; The origin of the operation. - Origin *string `json:"origin,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationsValueItem. -func (oI OperationsValueItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if oI.Display != nil { - objectMap["display"] = oI.Display - } - return json.Marshal(objectMap) -} - -// OperationsValueItemDisplay the human-readable description of the operation. -type OperationsValueItemDisplay struct { - // Provider - READ-ONLY; Service provider: Microsoft Maps. - Provider *string `json:"provider,omitempty"` - // Resource - READ-ONLY; Resource on which the operation is performed. - Resource *string `json:"resource,omitempty"` - // Operation - READ-ONLY; The action that users can perform, based on their permission level. - Operation *string `json:"operation,omitempty"` - // Description - READ-ONLY; The description of the operation. - Description *string `json:"description,omitempty"` -} - -// Resource an Azure resource -type Resource struct { - // ID - READ-ONLY; The fully qualified Maps Account resource identifier. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the Maps Account, which is unique within a Resource Group. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Azure resource type. - Type *string `json:"type,omitempty"` -} - -// Sku the SKU of the Maps Account. -type Sku struct { - // Name - The name of the SKU, in standard format (such as S0). - Name *string `json:"name,omitempty"` - // Tier - READ-ONLY; Gets the sku tier. This is based on the SKU name. - Tier *string `json:"tier,omitempty"` -} - -// MarshalJSON is the custom marshaler for Sku. -func (s Sku) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if s.Name != nil { - objectMap["name"] = s.Name - } - return json.Marshal(objectMap) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2018-05-01/maps/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/CHANGELOG.md similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2018-05-01/maps/CHANGELOG.md rename to vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/CHANGELOG.md diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2018-05-01/maps/_meta.json b/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/_meta.json similarity index 57% rename from vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2018-05-01/maps/_meta.json rename to vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/_meta.json index 38b1b276ff9a2..423197245e857 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2018-05-01/maps/_meta.json +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/_meta.json @@ -1,11 +1,11 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "c2ea3a3ccd14293b4bd1d17e684ef9129f0dc604", "readme": "/_/azure-rest-api-specs/specification/maps/resource-manager/readme.md", - "tag": "package-2018-05", + "tag": "package-2021-02", "use": "@microsoft.azure/autorest.go@2.1.180", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.180 --tag=package-2018-05 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/maps/resource-manager/readme.md", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.180 --tag=package-2021-02 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix /_/azure-rest-api-specs/specification/maps/resource-manager/readme.md", "additional_properties": { - "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION" + "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix" } } \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2018-05-01/maps/accounts.go b/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/accounts.go similarity index 71% rename from vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2018-05-01/maps/accounts.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/accounts.go index 0d1429b27a27d..ddf78f1bf0273 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2018-05-01/maps/accounts.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/accounts.go @@ -15,7 +15,7 @@ import ( "net/http" ) -// AccountsClient is the resource Provider +// AccountsClient is the azure Maps type AccountsClient struct { BaseClient } @@ -34,10 +34,10 @@ func NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) Account // CreateOrUpdate create or update a Maps Account. A Maps Account holds the keys which allow access to the Maps REST // APIs. // Parameters: -// resourceGroupName - the name of the Azure Resource Group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - the name of the Maps Account. -// mapsAccountCreateParameters - the new or updated parameters for the Maps Account. -func (client AccountsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, mapsAccountCreateParameters AccountCreateParameters) (result Account, err error) { +// mapsAccount - the new or updated parameters for the Maps Account. +func (client AccountsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, mapsAccount Account) (result Account, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.CreateOrUpdate") defer func() { @@ -49,14 +49,18 @@ func (client AccountsClient) CreateOrUpdate(ctx context.Context, resourceGroupNa }() } if err := validation.Validate([]validation.Validation{ - {TargetValue: mapsAccountCreateParameters, - Constraints: []validation.Constraint{{Target: "mapsAccountCreateParameters.Location", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "mapsAccountCreateParameters.Sku", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "mapsAccountCreateParameters.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: mapsAccount, + Constraints: []validation.Constraint{{Target: "mapsAccount.Sku", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { return result, validation.NewError("maps.AccountsClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, accountName, mapsAccountCreateParameters) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, accountName, mapsAccount) if err != nil { err = autorest.NewErrorWithError(err, "maps.AccountsClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -79,24 +83,25 @@ func (client AccountsClient) CreateOrUpdate(ctx context.Context, resourceGroupNa } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client AccountsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, mapsAccountCreateParameters AccountCreateParameters) (*http.Request, error) { +func (client AccountsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, mapsAccount Account) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-05-01" + const APIVersion = "2021-02-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } + mapsAccount.SystemData = nil preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}", pathParameters), - autorest.WithJSON(mapsAccountCreateParameters), + autorest.WithJSON(mapsAccount), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -121,7 +126,7 @@ func (client AccountsClient) CreateOrUpdateResponder(resp *http.Response) (resul // Delete delete a Maps Account. // Parameters: -// resourceGroupName - the name of the Azure Resource Group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - the name of the Maps Account. func (client AccountsClient) Delete(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error) { if tracing.IsEnabled() { @@ -134,6 +139,16 @@ func (client AccountsClient) Delete(ctx context.Context, resourceGroupName strin tracing.EndSpan(ctx, sc, err) }() } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("maps.AccountsClient", "Delete", err.Error()) + } + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName) if err != nil { err = autorest.NewErrorWithError(err, "maps.AccountsClient", "Delete", nil, "Failure preparing request") @@ -164,7 +179,7 @@ func (client AccountsClient) DeletePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-05-01" + const APIVersion = "2021-02-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -196,7 +211,7 @@ func (client AccountsClient) DeleteResponder(resp *http.Response) (result autore // Get get a Maps Account. // Parameters: -// resourceGroupName - the name of the Azure Resource Group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - the name of the Maps Account. func (client AccountsClient) Get(ctx context.Context, resourceGroupName string, accountName string) (result Account, err error) { if tracing.IsEnabled() { @@ -209,6 +224,16 @@ func (client AccountsClient) Get(ctx context.Context, resourceGroupName string, tracing.EndSpan(ctx, sc, err) }() } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("maps.AccountsClient", "Get", err.Error()) + } + req, err := client.GetPreparer(ctx, resourceGroupName, accountName) if err != nil { err = autorest.NewErrorWithError(err, "maps.AccountsClient", "Get", nil, "Failure preparing request") @@ -239,7 +264,7 @@ func (client AccountsClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-05-01" + const APIVersion = "2021-02-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -263,7 +288,7 @@ func (client AccountsClient) GetSender(req *http.Request) (*http.Response, error func (client AccountsClient) GetResponder(resp *http.Response) (result Account, err error) { err = autorest.Respond( resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} @@ -272,18 +297,29 @@ func (client AccountsClient) GetResponder(resp *http.Response) (result Account, // ListByResourceGroup get all Maps Accounts in a Resource Group // Parameters: -// resourceGroupName - the name of the Azure Resource Group. -func (client AccountsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result Accounts, err error) { +// resourceGroupName - the name of the resource group. The name is case insensitive. +func (client AccountsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AccountsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListByResourceGroup") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.a.Response.Response != nil { + sc = result.a.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("maps.AccountsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) if err != nil { err = autorest.NewErrorWithError(err, "maps.AccountsClient", "ListByResourceGroup", nil, "Failure preparing request") @@ -292,16 +328,20 @@ func (client AccountsClient) ListByResourceGroup(ctx context.Context, resourceGr resp, err := client.ListByResourceGroupSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.a.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "maps.AccountsClient", "ListByResourceGroup", resp, "Failure sending request") return } - result, err = client.ListByResourceGroupResponder(resp) + result.a, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "maps.AccountsClient", "ListByResourceGroup", resp, "Failure responding to request") return } + if result.a.hasNextLink() && result.a.IsEmpty() { + err = result.NextWithContext(ctx) + return + } return } @@ -313,7 +353,7 @@ func (client AccountsClient) ListByResourceGroupPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-05-01" + const APIVersion = "2021-02-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -344,18 +384,62 @@ func (client AccountsClient) ListByResourceGroupResponder(resp *http.Response) ( return } +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client AccountsClient) listByResourceGroupNextResults(ctx context.Context, lastResults Accounts) (result Accounts, err error) { + req, err := lastResults.accountsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "maps.AccountsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "maps.AccountsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "maps.AccountsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client AccountsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result AccountsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + // ListBySubscription get all Maps Accounts in a Subscription -func (client AccountsClient) ListBySubscription(ctx context.Context) (result Accounts, err error) { +func (client AccountsClient) ListBySubscription(ctx context.Context) (result AccountsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListBySubscription") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.a.Response.Response != nil { + sc = result.a.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("maps.AccountsClient", "ListBySubscription", err.Error()) + } + + result.fn = client.listBySubscriptionNextResults req, err := client.ListBySubscriptionPreparer(ctx) if err != nil { err = autorest.NewErrorWithError(err, "maps.AccountsClient", "ListBySubscription", nil, "Failure preparing request") @@ -364,16 +448,20 @@ func (client AccountsClient) ListBySubscription(ctx context.Context) (result Acc resp, err := client.ListBySubscriptionSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.a.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "maps.AccountsClient", "ListBySubscription", resp, "Failure sending request") return } - result, err = client.ListBySubscriptionResponder(resp) + result.a, err = client.ListBySubscriptionResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "maps.AccountsClient", "ListBySubscription", resp, "Failure responding to request") return } + if result.a.hasNextLink() && result.a.IsEmpty() { + err = result.NextWithContext(ctx) + return + } return } @@ -384,7 +472,7 @@ func (client AccountsClient) ListBySubscriptionPreparer(ctx context.Context) (*h "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-05-01" + const APIVersion = "2021-02-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -415,237 +503,134 @@ func (client AccountsClient) ListBySubscriptionResponder(resp *http.Response) (r return } -// 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. -// Parameters: -// resourceGroupName - the name of the Azure Resource Group. -// accountName - the name of the Maps Account. -func (client AccountsClient) ListKeys(ctx context.Context, resourceGroupName string, accountName string) (result AccountKeys, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListKeys") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListKeysPreparer(ctx, resourceGroupName, accountName) +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client AccountsClient) listBySubscriptionNextResults(ctx context.Context, lastResults Accounts) (result Accounts, err error) { + req, err := lastResults.accountsPreparer(ctx) if err != nil { - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "ListKeys", nil, "Failure preparing request") + return result, autorest.NewErrorWithError(err, "maps.AccountsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { return } - - resp, err := client.ListKeysSender(req) + resp, err := client.ListBySubscriptionSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "ListKeys", resp, "Failure sending request") - return + return result, autorest.NewErrorWithError(err, "maps.AccountsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") } - - result, err = client.ListKeysResponder(resp) + result, err = client.ListBySubscriptionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "ListKeys", resp, "Failure responding to request") - return + err = autorest.NewErrorWithError(err, "maps.AccountsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") } - return } -// ListKeysPreparer prepares the ListKeys request. -func (client AccountsClient) ListKeysPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/listKeys", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListKeysSender sends the ListKeys request. The method will close the -// http.Response Body if it receives an error. -func (client AccountsClient) ListKeysSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListKeysResponder handles the response to the ListKeys request. The method always -// closes the http.Response Body. -func (client AccountsClient) ListKeysResponder(resp *http.Response) (result AccountKeys, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListOperations list operations available for the Maps Resource Provider -func (client AccountsClient) ListOperations(ctx context.Context) (result Operations, err error) { +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client AccountsClient) ListBySubscriptionComplete(ctx context.Context) (result AccountsIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListOperations") + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListBySubscription") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } - req, err := client.ListOperationsPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "ListOperations", nil, "Failure preparing request") - return - } - - resp, err := client.ListOperationsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "ListOperations", resp, "Failure sending request") - return - } - - result, err = client.ListOperationsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "ListOperations", resp, "Failure responding to request") - return - } - - return -} - -// ListOperationsPreparer prepares the ListOperations request. -func (client AccountsClient) ListOperationsPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2018-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.Maps/operations"), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListOperationsSender sends the ListOperations request. The method will close the -// http.Response Body if it receives an error. -func (client AccountsClient) ListOperationsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListOperationsResponder handles the response to the ListOperations request. The method always -// closes the http.Response Body. -func (client AccountsClient) ListOperationsResponder(resp *http.Response) (result Operations, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} + result.page, err = client.ListBySubscription(ctx) return } -// Move moves Maps Accounts from one ResourceGroup (or Subscription) to another +// 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. // Parameters: -// resourceGroupName - the name of the resource group that contains Maps Account to move. -// moveRequest - the details of the Maps Account move. -func (client AccountsClient) Move(ctx context.Context, resourceGroupName string, moveRequest AccountsMoveRequest) (result autorest.Response, err error) { +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - the name of the Maps Account. +func (client AccountsClient) ListKeys(ctx context.Context, resourceGroupName string, accountName string) (result AccountKeys, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Move") + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListKeys") defer func() { sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } if err := validation.Validate([]validation.Validation{ - {TargetValue: moveRequest, - Constraints: []validation.Constraint{{Target: "moveRequest.TargetResourceGroup", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "moveRequest.ResourceIds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("maps.AccountsClient", "Move", err.Error()) + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("maps.AccountsClient", "ListKeys", err.Error()) } - req, err := client.MovePreparer(ctx, resourceGroupName, moveRequest) + req, err := client.ListKeysPreparer(ctx, resourceGroupName, accountName) if err != nil { - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "Move", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "maps.AccountsClient", "ListKeys", nil, "Failure preparing request") return } - resp, err := client.MoveSender(req) + resp, err := client.ListKeysSender(req) if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "Move", resp, "Failure sending request") + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "maps.AccountsClient", "ListKeys", resp, "Failure sending request") return } - result, err = client.MoveResponder(resp) + result, err = client.ListKeysResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "maps.AccountsClient", "Move", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "maps.AccountsClient", "ListKeys", resp, "Failure responding to request") return } return } -// MovePreparer prepares the Move request. -func (client AccountsClient) MovePreparer(ctx context.Context, resourceGroupName string, moveRequest AccountsMoveRequest) (*http.Request, error) { +// ListKeysPreparer prepares the ListKeys request. +func (client AccountsClient) ListKeysPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-05-01" + const APIVersion = "2021-02-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources", pathParameters), - autorest.WithJSON(moveRequest), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/listKeys", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// MoveSender sends the Move request. The method will close the +// ListKeysSender sends the ListKeys request. The method will close the // http.Response Body if it receives an error. -func (client AccountsClient) MoveSender(req *http.Request) (*http.Response, error) { +func (client AccountsClient) ListKeysSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// MoveResponder handles the response to the Move request. The method always +// ListKeysResponder handles the response to the ListKeys request. The method always // closes the http.Response Body. -func (client AccountsClient) MoveResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AccountsClient) ListKeysResponder(resp *http.Response) (result AccountKeys, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) - result.Response = resp + result.Response = autorest.Response{Response: resp} return } // RegenerateKeys regenerate either the primary or secondary key for use with the Maps APIs. The old key will stop // working immediately. // Parameters: -// resourceGroupName - the name of the Azure Resource Group. +// 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. func (client AccountsClient) RegenerateKeys(ctx context.Context, resourceGroupName string, accountName string, keySpecification KeySpecification) (result AccountKeys, err error) { @@ -659,6 +644,16 @@ func (client AccountsClient) RegenerateKeys(ctx context.Context, resourceGroupNa tracing.EndSpan(ctx, sc, err) }() } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("maps.AccountsClient", "RegenerateKeys", err.Error()) + } + req, err := client.RegenerateKeysPreparer(ctx, resourceGroupName, accountName, keySpecification) if err != nil { err = autorest.NewErrorWithError(err, "maps.AccountsClient", "RegenerateKeys", nil, "Failure preparing request") @@ -689,7 +684,7 @@ func (client AccountsClient) RegenerateKeysPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-05-01" + const APIVersion = "2021-02-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -715,16 +710,17 @@ func (client AccountsClient) RegenerateKeysSender(req *http.Request) (*http.Resp func (client AccountsClient) RegenerateKeysResponder(resp *http.Response) (result AccountKeys, err error) { err = autorest.Respond( resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// Update updates a Maps Account. Only a subset of the parameters may be updated after creation, such as Sku and Tags. +// Update updates a Maps Account. Only a subset of the parameters may be updated after creation, such as Sku, Tags, +// Properties. // Parameters: -// resourceGroupName - the name of the Azure Resource Group. +// 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. func (client AccountsClient) Update(ctx context.Context, resourceGroupName string, accountName string, mapsAccountUpdateParameters AccountUpdateParameters) (result Account, err error) { @@ -738,6 +734,16 @@ func (client AccountsClient) Update(ctx context.Context, resourceGroupName strin tracing.EndSpan(ctx, sc, err) }() } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("maps.AccountsClient", "Update", err.Error()) + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, mapsAccountUpdateParameters) if err != nil { err = autorest.NewErrorWithError(err, "maps.AccountsClient", "Update", nil, "Failure preparing request") @@ -768,7 +774,7 @@ func (client AccountsClient) UpdatePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-05-01" + const APIVersion = "2021-02-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -794,7 +800,7 @@ func (client AccountsClient) UpdateSender(req *http.Request) (*http.Response, er func (client AccountsClient) UpdateResponder(resp *http.Response) (result Account, err error) { err = autorest.Respond( resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2018-05-01/maps/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/client.go similarity index 97% rename from vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2018-05-01/maps/client.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/client.go index 4ced11fd948b9..c452debd4eceb 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2018-05-01/maps/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/client.go @@ -1,6 +1,6 @@ -// Package maps implements the Azure ARM Maps service API version 2018-05-01. +// Package maps implements the Azure ARM Maps service API version 2021-02-01. // -// Resource Provider +// Azure Maps package maps // Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/creators.go b/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/creators.go new file mode 100644 index 0000000000000..77a7d495dd263 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/creators.go @@ -0,0 +1,526 @@ +package maps + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// CreatorsClient is the azure Maps +type CreatorsClient struct { + BaseClient +} + +// NewCreatorsClient creates an instance of the CreatorsClient client. +func NewCreatorsClient(subscriptionID string) CreatorsClient { + return NewCreatorsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCreatorsClientWithBaseURI creates an instance of the CreatorsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewCreatorsClientWithBaseURI(baseURI string, subscriptionID string) CreatorsClient { + return CreatorsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// 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. +// Parameters: +// 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. +func (client CreatorsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, creatorName string, creatorResource Creator) (result Creator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CreatorsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: creatorResource, + Constraints: []validation.Constraint{{Target: "creatorResource.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "creatorResource.Properties.StorageUnits", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "creatorResource.Properties.StorageUnits", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, + {Target: "creatorResource.Properties.StorageUnits", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("maps.CreatorsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, accountName, creatorName, creatorResource) + if err != nil { + err = autorest.NewErrorWithError(err, "maps.CreatorsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "maps.CreatorsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "maps.CreatorsClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client CreatorsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, creatorName string, creatorResource Creator) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "creatorName": autorest.Encode("path", creatorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/creators/{creatorName}", pathParameters), + autorest.WithJSON(creatorResource), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client CreatorsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client CreatorsClient) CreateOrUpdateResponder(resp *http.Response) (result Creator, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a Maps Creator resource. +// Parameters: +// 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. +func (client CreatorsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, creatorName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CreatorsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("maps.CreatorsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, creatorName) + if err != nil { + err = autorest.NewErrorWithError(err, "maps.CreatorsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "maps.CreatorsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "maps.CreatorsClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client CreatorsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, creatorName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "creatorName": autorest.Encode("path", creatorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/creators/{creatorName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client CreatorsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client CreatorsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get a Maps Creator resource. +// Parameters: +// 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. +func (client CreatorsClient) Get(ctx context.Context, resourceGroupName string, accountName string, creatorName string) (result Creator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CreatorsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("maps.CreatorsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, creatorName) + if err != nil { + err = autorest.NewErrorWithError(err, "maps.CreatorsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "maps.CreatorsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "maps.CreatorsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client CreatorsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, creatorName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "creatorName": autorest.Encode("path", creatorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/creators/{creatorName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client CreatorsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client CreatorsClient) GetResponder(resp *http.Response) (result Creator, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAccount get all Creator instances for an Azure Maps Account +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - the name of the Maps Account. +func (client CreatorsClient) ListByAccount(ctx context.Context, resourceGroupName string, accountName string) (result CreatorListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CreatorsClient.ListByAccount") + defer func() { + sc := -1 + if result.cl.Response.Response != nil { + sc = result.cl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("maps.CreatorsClient", "ListByAccount", err.Error()) + } + + result.fn = client.listByAccountNextResults + req, err := client.ListByAccountPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "maps.CreatorsClient", "ListByAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAccountSender(req) + if err != nil { + result.cl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "maps.CreatorsClient", "ListByAccount", resp, "Failure sending request") + return + } + + result.cl, err = client.ListByAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "maps.CreatorsClient", "ListByAccount", resp, "Failure responding to request") + return + } + if result.cl.hasNextLink() && result.cl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByAccountPreparer prepares the ListByAccount request. +func (client CreatorsClient) ListByAccountPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/creators", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAccountSender sends the ListByAccount request. The method will close the +// http.Response Body if it receives an error. +func (client CreatorsClient) ListByAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAccountResponder handles the response to the ListByAccount request. The method always +// closes the http.Response Body. +func (client CreatorsClient) ListByAccountResponder(resp *http.Response) (result CreatorList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAccountNextResults retrieves the next set of results, if any. +func (client CreatorsClient) listByAccountNextResults(ctx context.Context, lastResults CreatorList) (result CreatorList, err error) { + req, err := lastResults.creatorListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "maps.CreatorsClient", "listByAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "maps.CreatorsClient", "listByAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "maps.CreatorsClient", "listByAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client CreatorsClient) ListByAccountComplete(ctx context.Context, resourceGroupName string, accountName string) (result CreatorListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CreatorsClient.ListByAccount") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByAccount(ctx, resourceGroupName, accountName) + return +} + +// Update updates the Maps Creator resource. Only a subset of the parameters may be updated after creation, such as +// Tags. +// Parameters: +// 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. +func (client CreatorsClient) Update(ctx context.Context, resourceGroupName string, accountName string, creatorName string, creatorUpdateParameters CreatorUpdateParameters) (result Creator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CreatorsClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("maps.CreatorsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, creatorName, creatorUpdateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "maps.CreatorsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "maps.CreatorsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "maps.CreatorsClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client CreatorsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, creatorName string, creatorUpdateParameters CreatorUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "creatorName": autorest.Encode("path", creatorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maps/accounts/{accountName}/creators/{creatorName}", pathParameters), + autorest.WithJSON(creatorUpdateParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client CreatorsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client CreatorsClient) UpdateResponder(resp *http.Response) (result Creator, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/enums.go new file mode 100644 index 0000000000000..d1a4911414e4a --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/enums.go @@ -0,0 +1,73 @@ +package maps + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// CreatedByType enumerates the values for created by type. +type CreatedByType string + +const ( + // CreatedByTypeApplication ... + CreatedByTypeApplication CreatedByType = "Application" + // CreatedByTypeKey ... + CreatedByTypeKey CreatedByType = "Key" + // CreatedByTypeManagedIdentity ... + CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" + // CreatedByTypeUser ... + CreatedByTypeUser CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns an array of possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{CreatedByTypeApplication, CreatedByTypeKey, CreatedByTypeManagedIdentity, CreatedByTypeUser} +} + +// KeyType enumerates the values for key type. +type KeyType string + +const ( + // KeyTypePrimary ... + KeyTypePrimary KeyType = "primary" + // KeyTypeSecondary ... + KeyTypeSecondary KeyType = "secondary" +) + +// PossibleKeyTypeValues returns an array of possible values for the KeyType const type. +func PossibleKeyTypeValues() []KeyType { + return []KeyType{KeyTypePrimary, KeyTypeSecondary} +} + +// Kind enumerates the values for kind. +type Kind string + +const ( + // KindGen1 ... + KindGen1 Kind = "Gen1" + // KindGen2 ... + KindGen2 Kind = "Gen2" +) + +// PossibleKindValues returns an array of possible values for the Kind const type. +func PossibleKindValues() []Kind { + return []Kind{KindGen1, KindGen2} +} + +// Name enumerates the values for name. +type Name string + +const ( + // NameG2 ... + NameG2 Name = "G2" + // NameS0 ... + NameS0 Name = "S0" + // NameS1 ... + NameS1 Name = "S1" +) + +// PossibleNameValues returns an array of possible values for the Name const type. +func PossibleNameValues() []Name { + return []Name{NameG2, NameS0, NameS1} +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/maps.go b/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/maps.go new file mode 100644 index 0000000000000..b21469c5c4831 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/maps.go @@ -0,0 +1,140 @@ +package maps + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// Client is the azure Maps +type Client struct { + BaseClient +} + +// NewClient creates an instance of the Client client. +func NewClient(subscriptionID string) Client { + return NewClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewClientWithBaseURI creates an instance of the Client client using a custom endpoint. Use this when interacting +// with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewClientWithBaseURI(baseURI string, subscriptionID string) Client { + return Client{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListOperations list operations available for the Maps Resource Provider +func (client Client) ListOperations(ctx context.Context) (result OperationsPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListOperations") + defer func() { + sc := -1 + if result.o.Response.Response != nil { + sc = result.o.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listOperationsNextResults + req, err := client.ListOperationsPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "maps.Client", "ListOperations", nil, "Failure preparing request") + return + } + + resp, err := client.ListOperationsSender(req) + if err != nil { + result.o.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "maps.Client", "ListOperations", resp, "Failure sending request") + return + } + + result.o, err = client.ListOperationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "maps.Client", "ListOperations", resp, "Failure responding to request") + return + } + if result.o.hasNextLink() && result.o.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListOperationsPreparer prepares the ListOperations request. +func (client Client) ListOperationsPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2021-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Maps/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListOperationsSender sends the ListOperations request. The method will close the +// http.Response Body if it receives an error. +func (client Client) ListOperationsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListOperationsResponder handles the response to the ListOperations request. The method always +// closes the http.Response Body. +func (client Client) ListOperationsResponder(resp *http.Response) (result Operations, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listOperationsNextResults retrieves the next set of results, if any. +func (client Client) listOperationsNextResults(ctx context.Context, lastResults Operations) (result Operations, err error) { + req, err := lastResults.operationsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "maps.Client", "listOperationsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListOperationsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "maps.Client", "listOperationsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListOperationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "maps.Client", "listOperationsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListOperationsComplete enumerates all values, automatically crossing page boundaries as required. +func (client Client) ListOperationsComplete(ctx context.Context) (result OperationsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListOperations") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListOperations(ctx) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/models.go new file mode 100644 index 0000000000000..b3271a62d8b08 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/models.go @@ -0,0 +1,1065 @@ +package maps + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps" + +// Account an Azure resource which represents access to a suite of Maps REST APIs. +type Account struct { + autorest.Response `json:"-"` + // Sku - The SKU of this account. + Sku *Sku `json:"sku,omitempty"` + // Kind - Get or Set Kind property. Possible values include: 'KindGen1', 'KindGen2' + Kind Kind `json:"kind,omitempty"` + // SystemData - READ-ONLY; The system meta data relating to this resource. + SystemData *SystemData `json:"systemData,omitempty"` + // Properties - The map account properties. + Properties *AccountProperties `json:"properties,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Account. +func (a Account) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.Sku != nil { + objectMap["sku"] = a.Sku + } + if a.Kind != "" { + objectMap["kind"] = a.Kind + } + if a.Properties != nil { + objectMap["properties"] = a.Properties + } + if a.Tags != nil { + objectMap["tags"] = a.Tags + } + if a.Location != nil { + objectMap["location"] = a.Location + } + return json.Marshal(objectMap) +} + +// AccountKeys the set of keys which can be used to access the Maps REST APIs. Two keys are provided for +// key rotation without interruption. +type AccountKeys struct { + autorest.Response `json:"-"` + // PrimaryKeyLastUpdated - READ-ONLY; The last updated date and time of the primary key. + PrimaryKeyLastUpdated *string `json:"primaryKeyLastUpdated,omitempty"` + // PrimaryKey - READ-ONLY; The primary key for accessing the Maps REST APIs. + PrimaryKey *string `json:"primaryKey,omitempty"` + // SecondaryKey - READ-ONLY; The secondary key for accessing the Maps REST APIs. + SecondaryKey *string `json:"secondaryKey,omitempty"` + // SecondaryKeyLastUpdated - READ-ONLY; The last updated date and time of the secondary key. + SecondaryKeyLastUpdated *string `json:"secondaryKeyLastUpdated,omitempty"` +} + +// AccountProperties additional Map account properties +type AccountProperties struct { + // UniqueID - READ-ONLY; A unique identifier for the maps account + UniqueID *string `json:"uniqueId,omitempty"` + // DisableLocalAuth - Allows toggle functionality on Azure Policy to disable Azure Maps local authentication support. This will disable Shared Keys authentication from any usage. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + // ProvisioningState - READ-ONLY; the state of the provisioning. + ProvisioningState *string `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for AccountProperties. +func (ap AccountProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ap.DisableLocalAuth != nil { + objectMap["disableLocalAuth"] = ap.DisableLocalAuth + } + return json.Marshal(objectMap) +} + +// Accounts a list of Maps Accounts. +type Accounts struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; a Maps Account. + Value *[]Account `json:"value,omitempty"` + // NextLink - URL client should use to fetch the next page (per server side paging). + // It's null for now, added for future use. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for Accounts. +func (a Accounts) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.NextLink != nil { + objectMap["nextLink"] = a.NextLink + } + return json.Marshal(objectMap) +} + +// AccountsIterator provides access to a complete listing of Account values. +type AccountsIterator struct { + i int + page AccountsPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AccountsIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *AccountsIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AccountsIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AccountsIterator) Response() Accounts { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AccountsIterator) Value() Account { + if !iter.page.NotDone() { + return Account{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AccountsIterator type. +func NewAccountsIterator(page AccountsPage) AccountsIterator { + return AccountsIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (a Accounts) IsEmpty() bool { + return a.Value == nil || len(*a.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (a Accounts) hasNextLink() bool { + return a.NextLink != nil && len(*a.NextLink) != 0 +} + +// accountsPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (a Accounts) accountsPreparer(ctx context.Context) (*http.Request, error) { + if !a.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(a.NextLink))) +} + +// AccountsPage contains a page of Account values. +type AccountsPage struct { + fn func(context.Context, Accounts) (Accounts, error) + a Accounts +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AccountsPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.a) + if err != nil { + return err + } + page.a = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *AccountsPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AccountsPage) NotDone() bool { + return !page.a.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AccountsPage) Response() Accounts { + return page.a +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AccountsPage) Values() []Account { + if page.a.IsEmpty() { + return nil + } + return *page.a.Value +} + +// Creates a new instance of the AccountsPage type. +func NewAccountsPage(cur Accounts, getNextPage func(context.Context, Accounts) (Accounts, error)) AccountsPage { + return AccountsPage{ + fn: getNextPage, + a: cur, + } +} + +// AccountUpdateParameters parameters used to update an existing Maps Account. +type AccountUpdateParameters struct { + // Tags - Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. + Tags map[string]*string `json:"tags"` + // Kind - Get or Set Kind property. Possible values include: 'KindGen1', 'KindGen2' + Kind Kind `json:"kind,omitempty"` + // Sku - The SKU of this account. + Sku *Sku `json:"sku,omitempty"` + // AccountProperties - The map account properties. + *AccountProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for AccountUpdateParameters. +func (aup AccountUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aup.Tags != nil { + objectMap["tags"] = aup.Tags + } + if aup.Kind != "" { + objectMap["kind"] = aup.Kind + } + if aup.Sku != nil { + objectMap["sku"] = aup.Sku + } + if aup.AccountProperties != nil { + objectMap["properties"] = aup.AccountProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AccountUpdateParameters struct. +func (aup *AccountUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + aup.Tags = tags + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + aup.Kind = kind + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + aup.Sku = &sku + } + case "properties": + if v != nil { + var accountProperties AccountProperties + err = json.Unmarshal(*v, &accountProperties) + if err != nil { + return err + } + aup.AccountProperties = &accountProperties + } + } + } + + return nil +} + +// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. +type AzureEntityResource struct { + // Etag - READ-ONLY; Resource Etag. + Etag *string `json:"etag,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// Creator an Azure resource which represents Maps Creator product and provides ability to manage private +// location data. +type Creator struct { + autorest.Response `json:"-"` + // Properties - The Creator resource properties. + Properties *CreatorProperties `json:"properties,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Creator. +func (c Creator) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.Properties != nil { + objectMap["properties"] = c.Properties + } + if c.Tags != nil { + objectMap["tags"] = c.Tags + } + if c.Location != nil { + objectMap["location"] = c.Location + } + return json.Marshal(objectMap) +} + +// CreatorList a list of Creator resources. +type CreatorList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; a Creator account. + Value *[]Creator `json:"value,omitempty"` + // NextLink - URL client should use to fetch the next page (per server side paging). + // It's null for now, added for future use. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for CreatorList. +func (cl CreatorList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cl.NextLink != nil { + objectMap["nextLink"] = cl.NextLink + } + return json.Marshal(objectMap) +} + +// CreatorListIterator provides access to a complete listing of Creator values. +type CreatorListIterator struct { + i int + page CreatorListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *CreatorListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CreatorListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *CreatorListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter CreatorListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter CreatorListIterator) Response() CreatorList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter CreatorListIterator) Value() Creator { + if !iter.page.NotDone() { + return Creator{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the CreatorListIterator type. +func NewCreatorListIterator(page CreatorListPage) CreatorListIterator { + return CreatorListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (cl CreatorList) IsEmpty() bool { + return cl.Value == nil || len(*cl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (cl CreatorList) hasNextLink() bool { + return cl.NextLink != nil && len(*cl.NextLink) != 0 +} + +// creatorListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (cl CreatorList) creatorListPreparer(ctx context.Context) (*http.Request, error) { + if !cl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(cl.NextLink))) +} + +// CreatorListPage contains a page of Creator values. +type CreatorListPage struct { + fn func(context.Context, CreatorList) (CreatorList, error) + cl CreatorList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *CreatorListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CreatorListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.cl) + if err != nil { + return err + } + page.cl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *CreatorListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page CreatorListPage) NotDone() bool { + return !page.cl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page CreatorListPage) Response() CreatorList { + return page.cl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page CreatorListPage) Values() []Creator { + if page.cl.IsEmpty() { + return nil + } + return *page.cl.Value +} + +// Creates a new instance of the CreatorListPage type. +func NewCreatorListPage(cur CreatorList, getNextPage func(context.Context, CreatorList) (CreatorList, error)) CreatorListPage { + return CreatorListPage{ + fn: getNextPage, + cl: cur, + } +} + +// CreatorProperties creator resource properties +type CreatorProperties struct { + // ProvisioningState - READ-ONLY; The state of the resource provisioning, terminal states: Succeeded, Failed, Canceled + ProvisioningState *string `json:"provisioningState,omitempty"` + // StorageUnits - The storage units to be allocated. Integer values from 1 to 100, inclusive. + StorageUnits *int32 `json:"storageUnits,omitempty"` +} + +// MarshalJSON is the custom marshaler for CreatorProperties. +func (cp CreatorProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cp.StorageUnits != nil { + objectMap["storageUnits"] = cp.StorageUnits + } + return json.Marshal(objectMap) +} + +// CreatorUpdateParameters parameters used to update an existing Creator resource. +type CreatorUpdateParameters struct { + // Tags - Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. + Tags map[string]*string `json:"tags"` + // CreatorProperties - Creator resource properties. + *CreatorProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for CreatorUpdateParameters. +func (cup CreatorUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cup.Tags != nil { + objectMap["tags"] = cup.Tags + } + if cup.CreatorProperties != nil { + objectMap["properties"] = cup.CreatorProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CreatorUpdateParameters struct. +func (cup *CreatorUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + cup.Tags = tags + } + case "properties": + if v != nil { + var creatorProperties CreatorProperties + err = json.Unmarshal(*v, &creatorProperties) + if err != nil { + return err + } + cup.CreatorProperties = &creatorProperties + } + } + } + + return nil +} + +// Dimension dimension of map account, for example API Category, Api Name, Result Type, and Response Code. +type Dimension struct { + // Name - Display name of dimension. + Name *string `json:"name,omitempty"` + // DisplayName - Display name of dimension. + DisplayName *string `json:"displayName,omitempty"` +} + +// ErrorAdditionalInfo the resource management error additional info. +type ErrorAdditionalInfo struct { + // Type - READ-ONLY; The additional info type. + Type *string `json:"type,omitempty"` + // Info - READ-ONLY; The additional info. + Info interface{} `json:"info,omitempty"` +} + +// ErrorDetail the error detail. +type ErrorDetail struct { + // Code - READ-ONLY; The error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; The error message. + Message *string `json:"message,omitempty"` + // Target - READ-ONLY; The error target. + Target *string `json:"target,omitempty"` + // Details - READ-ONLY; The error details. + Details *[]ErrorDetail `json:"details,omitempty"` + // AdditionalInfo - READ-ONLY; The error additional info. + AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` +} + +// ErrorResponse common error response for all Azure Resource Manager APIs to return error details for +// failed operations. (This also follows the OData error response format.). +type ErrorResponse struct { + // Error - The error object. + Error *ErrorDetail `json:"error,omitempty"` +} + +// KeySpecification whether the operation refers to the primary or secondary key. +type KeySpecification struct { + // KeyType - Whether the operation refers to the primary or secondary key. Possible values include: 'KeyTypePrimary', 'KeyTypeSecondary' + KeyType KeyType `json:"keyType,omitempty"` +} + +// MetricSpecification metric specification of operation. +type MetricSpecification struct { + // Name - Name of metric specification. + Name *string `json:"name,omitempty"` + // DisplayName - Display name of metric specification. + DisplayName *string `json:"displayName,omitempty"` + // DisplayDescription - Display description of metric specification. + DisplayDescription *string `json:"displayDescription,omitempty"` + // Unit - Unit could be Count. + Unit *string `json:"unit,omitempty"` + // Dimensions - Dimensions of map account. + Dimensions *[]Dimension `json:"dimensions,omitempty"` + // AggregationType - Aggregation type could be Average. + AggregationType *string `json:"aggregationType,omitempty"` + // FillGapWithZero - The property to decide fill gap with zero or not. + FillGapWithZero *bool `json:"fillGapWithZero,omitempty"` + // Category - The category this metric specification belong to, could be Capacity. + Category *string `json:"category,omitempty"` + // ResourceIDDimensionNameOverride - Account Resource Id. + ResourceIDDimensionNameOverride *string `json:"resourceIdDimensionNameOverride,omitempty"` +} + +// OperationDetail operation detail payload +type OperationDetail struct { + // Name - Name of the operation + Name *string `json:"name,omitempty"` + // IsDataAction - Indicates whether the operation is a data action + IsDataAction *bool `json:"isDataAction,omitempty"` + // Display - Display of the operation + Display *OperationDisplay `json:"display,omitempty"` + // Origin - Origin of the operation + Origin *string `json:"origin,omitempty"` + // OperationProperties - Properties of the operation + *OperationProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationDetail. +func (od OperationDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if od.Name != nil { + objectMap["name"] = od.Name + } + if od.IsDataAction != nil { + objectMap["isDataAction"] = od.IsDataAction + } + if od.Display != nil { + objectMap["display"] = od.Display + } + if od.Origin != nil { + objectMap["origin"] = od.Origin + } + if od.OperationProperties != nil { + objectMap["properties"] = od.OperationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OperationDetail struct. +func (od *OperationDetail) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + od.Name = &name + } + case "isDataAction": + if v != nil { + var isDataAction bool + err = json.Unmarshal(*v, &isDataAction) + if err != nil { + return err + } + od.IsDataAction = &isDataAction + } + case "display": + if v != nil { + var display OperationDisplay + err = json.Unmarshal(*v, &display) + if err != nil { + return err + } + od.Display = &display + } + case "origin": + if v != nil { + var origin string + err = json.Unmarshal(*v, &origin) + if err != nil { + return err + } + od.Origin = &origin + } + case "properties": + if v != nil { + var operationProperties OperationProperties + err = json.Unmarshal(*v, &operationProperties) + if err != nil { + return err + } + od.OperationProperties = &operationProperties + } + } + } + + return nil +} + +// OperationDisplay operation display payload +type OperationDisplay struct { + // Provider - Resource provider of the operation + Provider *string `json:"provider,omitempty"` + // Resource - Resource of the operation + Resource *string `json:"resource,omitempty"` + // Operation - Localized friendly name for the operation + Operation *string `json:"operation,omitempty"` + // Description - Localized friendly description for the operation + Description *string `json:"description,omitempty"` +} + +// OperationProperties properties of operation, include metric specifications. +type OperationProperties struct { + // ServiceSpecification - One property of operation, include metric specifications. + ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"` +} + +// Operations the set of operations available for Maps. +type Operations struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; An operation available for Maps. + Value *[]OperationDetail `json:"value,omitempty"` + // NextLink - URL client should use to fetch the next page (per server side paging). + // It's null for now, added for future use. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for Operations. +func (o Operations) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if o.NextLink != nil { + objectMap["nextLink"] = o.NextLink + } + return json.Marshal(objectMap) +} + +// OperationsIterator provides access to a complete listing of OperationDetail values. +type OperationsIterator struct { + i int + page OperationsPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationsIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OperationsIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationsIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationsIterator) Response() Operations { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationsIterator) Value() OperationDetail { + if !iter.page.NotDone() { + return OperationDetail{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationsIterator type. +func NewOperationsIterator(page OperationsPage) OperationsIterator { + return OperationsIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (o Operations) IsEmpty() bool { + return o.Value == nil || len(*o.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (o Operations) hasNextLink() bool { + return o.NextLink != nil && len(*o.NextLink) != 0 +} + +// operationsPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (o Operations) operationsPreparer(ctx context.Context) (*http.Request, error) { + if !o.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(o.NextLink))) +} + +// OperationsPage contains a page of OperationDetail values. +type OperationsPage struct { + fn func(context.Context, Operations) (Operations, error) + o Operations +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationsPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.o) + if err != nil { + return err + } + page.o = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OperationsPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationsPage) NotDone() bool { + return !page.o.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationsPage) Response() Operations { + return page.o +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationsPage) Values() []OperationDetail { + if page.o.IsEmpty() { + return nil + } + return *page.o.Value +} + +// Creates a new instance of the OperationsPage type. +func NewOperationsPage(cur Operations, getNextPage func(context.Context, Operations) (Operations, error)) OperationsPage { + return OperationsPage{ + fn: getNextPage, + o: cur, + } +} + +// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not +// have tags and a location +type ProxyResource struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// Resource common fields that are returned in the response for all Azure Resource Manager resources +type Resource struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// ServiceSpecification one property of operation, include metric specifications. +type ServiceSpecification struct { + // MetricSpecifications - Metric specifications of operation. + MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"` +} + +// Sku the SKU of the Maps Account. +type Sku struct { + // Name - The name of the SKU, in standard format (such as S0). Possible values include: 'NameS0', 'NameS1', 'NameG2' + Name Name `json:"name,omitempty"` + // Tier - READ-ONLY; Gets the sku tier. This is based on the SKU name. + Tier *string `json:"tier,omitempty"` +} + +// MarshalJSON is the custom marshaler for Sku. +func (s Sku) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.Name != "" { + objectMap["name"] = s.Name + } + return json.Marshal(objectMap) +} + +// SystemData metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // CreatedBy - The identity that created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + // CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' + CreatedByType CreatedByType `json:"createdByType,omitempty"` + // CreatedAt - The timestamp of resource creation (UTC). + CreatedAt *date.Time `json:"createdAt,omitempty"` + // LastModifiedBy - The identity that last modified the resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' + LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"` + // LastModifiedAt - The timestamp of resource last modification (UTC) + LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` +} + +// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource +// which has 'tags' and a 'location' +type TrackedResource struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.Location != nil { + objectMap["location"] = tr.Location + } + return json.Marshal(objectMap) +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2018-05-01/maps/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/version.go similarity index 90% rename from vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2018-05-01/maps/version.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/version.go index ec7c6cc0f4330..50d028e3f1e32 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2018-05-01/maps/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps/version.go @@ -10,7 +10,7 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + Version() + " maps/2018-05-01" + return "Azure-SDK-For-Go/" + Version() + " maps/2021-02-01" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/vendor/modules.txt b/vendor/modules.txt index 869de2b4f72ef..5286693f77623 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -56,7 +56,7 @@ github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2020-09-18/kusto github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices github.com/Azure/azure-sdk-for-go/services/managedservices/mgmt/2019-06-01/managedservices -github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2018-05-01/maps +github.com/Azure/azure-sdk-for-go/services/maps/mgmt/2021-02-01/maps github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb github.com/Azure/azure-sdk-for-go/services/marketplaceordering/mgmt/2015-06-01/marketplaceordering github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2020-05-01/media