diff --git a/azurerm/config.go b/azurerm/config.go index eaf69aecdae8..d9b6685bd87e 100644 --- a/azurerm/config.go +++ b/azurerm/config.go @@ -19,7 +19,6 @@ import ( "github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2017-10-01/containerregistry" "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-09-30/containerservice" "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb" - "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns" "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2017-09-15-preview/eventgrid" "github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub" "github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac" @@ -32,6 +31,7 @@ import ( "github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights" "github.com/Azure/azure-sdk-for-go/services/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement" "github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql" + "github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns" "github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2016-04-01/redis" "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-06-01/subscriptions" "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-09-01/locks" @@ -453,7 +453,7 @@ func (c *ArmClient) registerCDNClients(endpoint, subscriptionId string, auth aut } func (c *ArmClient) registerCosmosDBClients(endpoint, subscriptionId string, auth autorest.Authorizer, sender autorest.Sender) { - cdb := documentdb.NewDatabaseAccountsClientWithBaseURI(endpoint, subscriptionId, "", "", "", "", "") + cdb := documentdb.NewDatabaseAccountsClientWithBaseURI(endpoint, subscriptionId) c.configureClient(&cdb.Client, auth) c.cosmosDBClient = cdb } @@ -883,7 +883,8 @@ func (armClient *ArmClient) getKeyForStorageAccount(resourceGroupName, storageAc defer storageKeyCacheMu.Unlock() key, ok = storageKeyCache[cacheIndex] if !ok { - accountKeys, err := armClient.storageServiceClient.ListKeys(resourceGroupName, storageAccountName) + ctx := armClient.StopContext + accountKeys, err := armClient.storageServiceClient.ListKeys(ctx, resourceGroupName, storageAccountName) if utils.ResponseWasNotFound(accountKeys.Response) { return "", false, nil } diff --git a/azurerm/data_source_app_service_plan.go b/azurerm/data_source_app_service_plan.go index b3c6761276fe..cab65434e1a2 100644 --- a/azurerm/data_source_app_service_plan.go +++ b/azurerm/data_source_app_service_plan.go @@ -120,7 +120,9 @@ func dataSourceAppServicePlanRead(d *schema.ResourceData, meta interface{}) erro d.Set("sku", flattenAppServicePlanSku(sku)) } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/data_source_application_security_group.go b/azurerm/data_source_application_security_group.go index f692283be7fb..abf0a9506127 100644 --- a/azurerm/data_source_application_security_group.go +++ b/azurerm/data_source_application_security_group.go @@ -51,7 +51,10 @@ func dataSourceArmApplicationSecurityGroupRead(d *schema.ResourceData, meta inte d.Set("name", resp.Name) d.Set("location", azureRMNormalizeLocation(*resp.Location)) d.Set("resource_group_name", resourceGroup) - flattenAndSetTags(d, resp.Tags) + + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/data_source_cdn_profile.go b/azurerm/data_source_cdn_profile.go index 8bfd89d2d7d4..5446a1f9f4ed 100644 --- a/azurerm/data_source_cdn_profile.go +++ b/azurerm/data_source_cdn_profile.go @@ -57,7 +57,9 @@ func dataSourceArmCdnProfileRead(d *schema.ResourceData, meta interface{}) error d.Set("sku", string(sku.Name)) } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/data_source_dns_zone.go b/azurerm/data_source_dns_zone.go index af251eed1462..9c766bf3c28a 100644 --- a/azurerm/data_source_dns_zone.go +++ b/azurerm/data_source_dns_zone.go @@ -76,7 +76,9 @@ func dataSourceArmDnsZoneRead(d *schema.ResourceData, meta interface{}) error { } } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/data_source_eventhub_namespace.go b/azurerm/data_source_eventhub_namespace.go index b9e77b642558..3ac0132c7730 100644 --- a/azurerm/data_source_eventhub_namespace.go +++ b/azurerm/data_source_eventhub_namespace.go @@ -107,7 +107,9 @@ func dataSourceEventHubNamespaceRead(d *schema.ResourceData, meta interface{}) e d.Set("maximum_throughput_units", int(*props.MaximumThroughputUnits)) } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/data_source_image.go b/azurerm/data_source_image.go index 149a6289d356..ec793fa5feae 100644 --- a/azurerm/data_source_image.go +++ b/azurerm/data_source_image.go @@ -196,7 +196,9 @@ func dataSourceArmImageRead(d *schema.ResourceData, meta interface{}) error { } } - flattenAndSetTags(d, img.Tags) + if err := flattenAndSetTags(d, &img.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/data_source_managed_disk.go b/azurerm/data_source_managed_disk.go index 10638dfecacd..8599e7ea3afd 100644 --- a/azurerm/data_source_managed_disk.go +++ b/azurerm/data_source_managed_disk.go @@ -88,7 +88,9 @@ func dataSourceArmManagedDiskRead(d *schema.ResourceData, meta interface{}) erro d.Set("zones", resp.Zones) - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/data_source_network_interface.go b/azurerm/data_source_network_interface.go index ec50341440ba..854e35d6049d 100644 --- a/azurerm/data_source_network_interface.go +++ b/azurerm/data_source_network_interface.go @@ -242,7 +242,9 @@ func dataSourceArmNetworkInterfaceRead(d *schema.ResourceData, meta interface{}) d.Set("enable_ip_forwarding", resp.EnableIPForwarding) d.Set("enable_accelerated_networking", resp.EnableAcceleratedNetworking) - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/data_source_network_security_group.go b/azurerm/data_source_network_security_group.go index a12bc04871cd..cf174c4aef64 100644 --- a/azurerm/data_source_network_security_group.go +++ b/azurerm/data_source_network_security_group.go @@ -153,7 +153,9 @@ func dataSourceArmNetworkSecurityGroupRead(d *schema.ResourceData, meta interfac } } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/data_source_public_ip.go b/azurerm/data_source_public_ip.go index 6553c671de40..000e900c3298 100644 --- a/azurerm/data_source_public_ip.go +++ b/azurerm/data_source_public_ip.go @@ -79,6 +79,9 @@ func dataSourceArmPublicIPRead(d *schema.ResourceData, meta interface{}) error { d.Set("idle_timeout_in_minutes", *resp.PublicIPAddressPropertiesFormat.IdleTimeoutInMinutes) } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } + return nil } diff --git a/azurerm/data_source_storage_account.go b/azurerm/data_source_storage_account.go index a228bdd6bb1d..a0b2886f730f 100644 --- a/azurerm/data_source_storage_account.go +++ b/azurerm/data_source_storage_account.go @@ -160,12 +160,13 @@ func dataSourceArmStorageAccount() *schema.Resource { func dataSourceArmStorageAccountRead(d *schema.ResourceData, meta interface{}) error { client := meta.(*ArmClient).storageServiceClient + ctx := meta.(*ArmClient).StopContext endpointSuffix := meta.(*ArmClient).environment.StorageEndpointSuffix name := d.Get("name").(string) resourceGroup := d.Get("resource_group_name").(string) - resp, err := client.GetProperties(resourceGroup, name) + resp, err := client.GetProperties(ctx, resourceGroup, name) if err != nil { if utils.ResponseWasNotFound(resp.Response) { d.SetId("") @@ -176,7 +177,7 @@ func dataSourceArmStorageAccountRead(d *schema.ResourceData, meta interface{}) e d.SetId(*resp.ID) - keys, err := client.ListKeys(resourceGroup, name) + keys, err := client.ListKeys(ctx, resourceGroup, name) if err != nil { return err } @@ -268,7 +269,9 @@ func dataSourceArmStorageAccountRead(d *schema.ResourceData, meta interface{}) e d.Set("primary_access_key", accessKeys[0].Value) d.Set("secondary_access_key", accessKeys[1].Value) - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/data_source_virtual_network_gateway.go b/azurerm/data_source_virtual_network_gateway.go index 64145c1f2f5f..6f0dc7fa009d 100644 --- a/azurerm/data_source_virtual_network_gateway.go +++ b/azurerm/data_source_virtual_network_gateway.go @@ -213,7 +213,9 @@ func dataSourceArmVirtualNetworkGatewayRead(d *schema.ResourceData, meta interfa } } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_app_service.go b/azurerm/resource_arm_app_service.go index deb0c5c56df6..d26c340d9054 100644 --- a/azurerm/resource_arm_app_service.go +++ b/azurerm/resource_arm_app_service.go @@ -415,7 +415,9 @@ func resourceArmAppServiceRead(d *schema.ResourceData, meta interface{}) error { return err } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } @@ -594,7 +596,7 @@ func flattenAppServiceSiteConfig(input *web.SiteConfig) []interface{} { return results } -func expandAppServiceAppSettings(d *schema.ResourceData) *map[string]*string { +func expandAppServiceAppSettings(d *schema.ResourceData) map[string]*string { input := d.Get("app_settings").(map[string]interface{}) output := make(map[string]*string, len(input)) @@ -602,10 +604,10 @@ func expandAppServiceAppSettings(d *schema.ResourceData) *map[string]*string { output[k] = utils.String(v.(string)) } - return &output + return output } -func expandAppServiceConnectionStrings(d *schema.ResourceData) *map[string]*web.ConnStringValueTypePair { +func expandAppServiceConnectionStrings(d *schema.ResourceData) map[string]*web.ConnStringValueTypePair { input := d.Get("connection_string").([]interface{}) output := make(map[string]*web.ConnStringValueTypePair, len(input)) @@ -622,13 +624,13 @@ func expandAppServiceConnectionStrings(d *schema.ResourceData) *map[string]*web. } } - return &output + return output } -func flattenAppServiceConnectionStrings(input *map[string]*web.ConnStringValueTypePair) interface{} { +func flattenAppServiceConnectionStrings(input map[string]*web.ConnStringValueTypePair) interface{} { results := make([]interface{}, 0) - for k, v := range *input { + for k, v := range input { result := make(map[string]interface{}, 0) result["name"] = k result["type"] = string(v.Type) @@ -639,9 +641,9 @@ func flattenAppServiceConnectionStrings(input *map[string]*web.ConnStringValueTy return results } -func flattenAppServiceAppSettings(input *map[string]*string) map[string]string { +func flattenAppServiceAppSettings(input map[string]*string) map[string]string { output := make(map[string]string, 0) - for k, v := range *input { + for k, v := range input { output[k] = *v } diff --git a/azurerm/resource_arm_app_service_plan.go b/azurerm/resource_arm_app_service_plan.go index c152b3e616c7..1ac64c00962b 100644 --- a/azurerm/resource_arm_app_service_plan.go +++ b/azurerm/resource_arm_app_service_plan.go @@ -192,7 +192,9 @@ func resourceArmAppServicePlanRead(d *schema.ResourceData, meta interface{}) err d.Set("sku", flattenAppServicePlanSku(sku)) } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_app_service_slot.go b/azurerm/resource_arm_app_service_slot.go index 0bda4a28dc4e..14ef51d6a482 100644 --- a/azurerm/resource_arm_app_service_slot.go +++ b/azurerm/resource_arm_app_service_slot.go @@ -428,7 +428,9 @@ func resourceArmAppServiceSlotRead(d *schema.ResourceData, meta interface{}) err return err } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_application_gateway.go b/azurerm/resource_arm_application_gateway.go index 6905c98478eb..9c547a168d5e 100644 --- a/azurerm/resource_arm_application_gateway.go +++ b/azurerm/resource_arm_application_gateway.go @@ -804,7 +804,9 @@ func resourceArmApplicationGatewayRead(d *schema.ResourceData, meta interface{}) flattenApplicationGatewayWafConfig(applicationGateway.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration))) } - flattenAndSetTags(d, applicationGateway.Tags) + if err := flattenAndSetTags(d, &applicationGateway.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_application_insights.go b/azurerm/resource_arm_application_insights.go index a9eb63550c91..fa9fe79816ff 100644 --- a/azurerm/resource_arm_application_insights.go +++ b/azurerm/resource_arm_application_insights.go @@ -70,16 +70,14 @@ func resourceArmApplicationInsightsCreateOrUpdate(d *schema.ResourceData, meta i location := d.Get("location").(string) tags := d.Get("tags").(map[string]interface{}) - applicationInsightsComponentProperties := insights.ApplicationInsightsComponentProperties{ - ApplicationID: &name, - ApplicationType: insights.ApplicationType(applicationType), - } - insightProperties := insights.ApplicationInsightsComponent{ Name: &name, Location: &location, Kind: &applicationType, - ApplicationInsightsComponentProperties: &applicationInsightsComponentProperties, + ApplicationInsightsComponentProperties: &insights.ApplicationInsightsComponentProperties{ + ApplicationID: &name, + ApplicationType: insights.ApplicationType(applicationType), + }, Tags: expandTags(tags), } @@ -134,7 +132,9 @@ func resourceArmApplicationInsightsRead(d *schema.ResourceData, meta interface{} d.Set("instrumentation_key", props.InstrumentationKey) } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_application_security_group.go b/azurerm/resource_arm_application_security_group.go index ce3b8bf3352b..c11468d42d79 100644 --- a/azurerm/resource_arm_application_security_group.go +++ b/azurerm/resource_arm_application_security_group.go @@ -96,7 +96,10 @@ func resourceArmApplicationSecurityGroupRead(d *schema.ResourceData, meta interf d.Set("name", resp.Name) d.Set("location", azureRMNormalizeLocation(*resp.Location)) d.Set("resource_group_name", resourceGroup) - flattenAndSetTags(d, resp.Tags) + + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_automation_account.go b/azurerm/resource_arm_automation_account.go index c1ebe33b6622..4738606e244e 100644 --- a/azurerm/resource_arm_automation_account.go +++ b/azurerm/resource_arm_automation_account.go @@ -120,7 +120,9 @@ func resourceArmAutomationAccountRead(d *schema.ResourceData, meta interface{}) d.Set("resource_group_name", resGroup) flattenAndSetSku(d, resp.Sku) - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_automation_credential.go b/azurerm/resource_arm_automation_credential.go index 0f00ca72d66d..ee519641ca08 100644 --- a/azurerm/resource_arm_automation_credential.go +++ b/azurerm/resource_arm_automation_credential.go @@ -25,7 +25,9 @@ func resourceArmAutomationCredential() *schema.Resource { Required: true, ForceNew: true, }, + "resource_group_name": resourceGroupNameSchema(), + "account_name": { Type: schema.TypeString, Required: true, @@ -42,6 +44,7 @@ func resourceArmAutomationCredential() *schema.Resource { Required: true, Sensitive: true, }, + "description": { Type: schema.TypeString, Optional: true, diff --git a/azurerm/resource_arm_automation_runbook.go b/azurerm/resource_arm_automation_runbook.go index 2403a729b792..7c03e2385c0f 100644 --- a/azurerm/resource_arm_automation_runbook.go +++ b/azurerm/resource_arm_automation_runbook.go @@ -193,7 +193,9 @@ func resourceArmAutomationRunbookRead(d *schema.ResourceData, meta interface{}) d.Set("description", props.Description) } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_availability_set.go b/azurerm/resource_arm_availability_set.go index 87a2df9ab135..771cd40d5f60 100644 --- a/azurerm/resource_arm_availability_set.go +++ b/azurerm/resource_arm_availability_set.go @@ -132,7 +132,9 @@ func resourceArmAvailabilitySetRead(d *schema.ResourceData, meta interface{}) er d.Set("managed", strings.EqualFold(*resp.Sku.Name, "Aligned")) } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_availability_set_test.go b/azurerm/resource_arm_availability_set_test.go index cd285e405155..7a1b564966fd 100644 --- a/azurerm/resource_arm_availability_set_test.go +++ b/azurerm/resource_arm_availability_set_test.go @@ -103,7 +103,7 @@ func TestAccAzureRMAvailabilitySet_withDomainCounts(t *testing.T) { Config: config, Check: resource.ComposeTestCheckFunc( testCheckAzureRMAvailabilitySetExists(resourceName), - resource.TestCheckResourceAttr(resourceName, "platform_update_domain_count", "10"), + resource.TestCheckResourceAttr(resourceName, "platform_update_domain_count", "1"), resource.TestCheckResourceAttr(resourceName, "platform_fault_domain_count", "1"), ), }, @@ -279,7 +279,7 @@ resource "azurerm_availability_set" "test" { name = "acctestavset-%d" location = "${azurerm_resource_group.test.location}" resource_group_name = "${azurerm_resource_group.test.name}" - platform_update_domain_count = 10 + platform_update_domain_count = 1 platform_fault_domain_count = 1 } `, rInt, location, rInt) @@ -296,7 +296,7 @@ resource "azurerm_availability_set" "test" { name = "acctestavset-%d" location = "${azurerm_resource_group.test.location}" resource_group_name = "${azurerm_resource_group.test.name}" - platform_update_domain_count = 10 + platform_update_domain_count = 1 platform_fault_domain_count = 1 managed = true } diff --git a/azurerm/resource_arm_cdn_endpoint.go b/azurerm/resource_arm_cdn_endpoint.go index 487e819d2250..cd833e294c30 100644 --- a/azurerm/resource_arm_cdn_endpoint.go +++ b/azurerm/resource_arm_cdn_endpoint.go @@ -380,7 +380,9 @@ func resourceArmCdnEndpointRead(d *schema.ResourceData, meta interface{}) error } } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_cdn_profile.go b/azurerm/resource_arm_cdn_profile.go index 28541dc6fb11..c9cfa41ca9d6 100644 --- a/azurerm/resource_arm_cdn_profile.go +++ b/azurerm/resource_arm_cdn_profile.go @@ -149,7 +149,9 @@ func resourceArmCdnProfileRead(d *schema.ResourceData, meta interface{}) error { d.Set("sku", string(sku.Name)) } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_container_group.go b/azurerm/resource_arm_container_group.go index b916174f589a..1b75d0c4d7a4 100644 --- a/azurerm/resource_arm_container_group.go +++ b/azurerm/resource_arm_container_group.go @@ -277,7 +277,9 @@ func resourceArmContainerGroupRead(d *schema.ResourceData, meta interface{}) err d.Set("name", name) d.Set("resource_group_name", resGroup) d.Set("location", azureRMNormalizeLocation(*resp.Location)) - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } d.Set("os_type", string(resp.OsType)) if address := resp.IPAddress; address != nil { diff --git a/azurerm/resource_arm_container_registry.go b/azurerm/resource_arm_container_registry.go index 3835be65eda3..4ff507d17fc7 100644 --- a/azurerm/resource_arm_container_registry.go +++ b/azurerm/resource_arm_container_registry.go @@ -271,7 +271,9 @@ func resourceArmContainerRegistryRead(d *schema.ResourceData, meta interface{}) d.Set("admin_password", "") } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_container_registry_migrate.go b/azurerm/resource_arm_container_registry_migrate.go index 5f485ee1fc8a..c11cd0a0f64d 100644 --- a/azurerm/resource_arm_container_registry_migrate.go +++ b/azurerm/resource_arm_container_registry_migrate.go @@ -92,7 +92,8 @@ func updateV1ToV2StorageAccountName(is *terraform.InstanceState, meta interface{ func findAzureStorageAccountIdFromName(name string, meta interface{}) (string, error) { client := meta.(*ArmClient).storageServiceClient - accounts, err := client.List() + ctx := meta.(*ArmClient).StopContext + accounts, err := client.List(ctx) if err != nil { return "", err } diff --git a/azurerm/resource_arm_container_registry_migrate_test.go b/azurerm/resource_arm_container_registry_migrate_test.go index 979bb1c32110..2e7f10dbeef1 100644 --- a/azurerm/resource_arm_container_registry_migrate_test.go +++ b/azurerm/resource_arm_container_registry_migrate_test.go @@ -119,18 +119,26 @@ func createStorageAccount(client *ArmClient, resourceGroupName, storageAccountNa }, } ctx := client.StopContext - createFuture, createErr := storageClient.Create(resourceGroupName, storageAccountName, createParams, ctx.Done()) - - select { - case err := <-createErr: + future, err := storageClient.Create(ctx, resourceGroupName, storageAccountName, createParams) + if err != nil { return nil, fmt.Errorf("Error creating Storage Account %q: %+v", resourceGroupName, err) - case account := <-createFuture: - return &account, nil } + + err = future.WaitForCompletion(ctx, storageClient.Client) + if err != nil { + return nil, fmt.Errorf("Error waiting for Storage Account %q to provision: %+v", resourceGroupName, err) + } + + account, err := storageClient.GetProperties(ctx, resourceGroupName, storageAccountName) + if err != nil { + return nil, fmt.Errorf("Error retrieving Storage Account %q: %+v", storageAccountName, err) + } + + return &account, nil } func destroyStorageAccountAndResourceGroup(client *ArmClient, resourceGroupName, storageAccountName string) { ctx := client.StopContext - client.storageServiceClient.Delete(resourceGroupName, storageAccountName) + client.storageServiceClient.Delete(ctx, resourceGroupName, storageAccountName) client.resourceGroupsClient.Delete(ctx, resourceGroupName) } diff --git a/azurerm/resource_arm_container_service.go b/azurerm/resource_arm_container_service.go index 0ee74e2f9ef4..748fc85761f3 100644 --- a/azurerm/resource_arm_container_service.go +++ b/azurerm/resource_arm_container_service.go @@ -297,7 +297,9 @@ func resourceArmContainerServiceRead(d *schema.ResourceData, meta interface{}) e d.Set("diagnostics_profile", diagnosticProfile) } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_cosmos_db_account.go b/azurerm/resource_arm_cosmos_db_account.go index ac66fd4d3a0f..d4590d9ec0ce 100644 --- a/azurerm/resource_arm_cosmos_db_account.go +++ b/azurerm/resource_arm_cosmos_db_account.go @@ -252,7 +252,9 @@ func resourceArmCosmosDBAccountRead(d *schema.ResourceData, meta interface{}) er d.Set("secondary_readonly_master_key", readonlyKeys.SecondaryReadonlyMasterKey) } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_dns_a_record.go b/azurerm/resource_arm_dns_a_record.go index 06945cf1c933..c8ae818044d9 100644 --- a/azurerm/resource_arm_dns_a_record.go +++ b/azurerm/resource_arm_dns_a_record.go @@ -4,7 +4,7 @@ import ( "fmt" "net/http" - "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns" + "github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns" "github.com/hashicorp/terraform/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -115,12 +115,18 @@ func resourceArmDnsARecordRead(d *schema.ResourceData, meta interface{}) error { d.Set("name", name) d.Set("resource_group_name", resGroup) d.Set("zone_name", zoneName) - d.Set("ttl", resp.TTL) - if err := d.Set("records", flattenAzureRmDnsARecords(resp.ARecords)); err != nil { - return err + if props := resp.RecordSetProperties; props != nil { + d.Set("ttl", props.TTL) + + if err := d.Set("records", flattenAzureRmDnsARecords(*props.ARecords)); err != nil { + return err + } + + if err := flattenAndSetTags(d, &props.Metadata); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } } - flattenAndSetTags(d, resp.Metadata) return nil } @@ -146,11 +152,11 @@ func resourceArmDnsARecordDelete(d *schema.ResourceData, meta interface{}) error return nil } -func flattenAzureRmDnsARecords(records *[]dns.ARecord) []string { - results := make([]string, 0, len(*records)) +func flattenAzureRmDnsARecords(records []dns.ARecord) []string { + results := make([]string, 0) if records != nil { - for _, record := range *records { + for _, record := range records { results = append(results, *record.Ipv4Address) } } diff --git a/azurerm/resource_arm_dns_a_record_test.go b/azurerm/resource_arm_dns_a_record_test.go index 0677009a7793..6a5cce4039a9 100644 --- a/azurerm/resource_arm_dns_a_record_test.go +++ b/azurerm/resource_arm_dns_a_record_test.go @@ -5,7 +5,7 @@ import ( "net/http" "testing" - "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns" + "github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/azurerm/resource_arm_dns_aaaa_record.go b/azurerm/resource_arm_dns_aaaa_record.go index 29c195105e7f..369dfa72e2ba 100644 --- a/azurerm/resource_arm_dns_aaaa_record.go +++ b/azurerm/resource_arm_dns_aaaa_record.go @@ -4,7 +4,7 @@ import ( "fmt" "net/http" - "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns" + "github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns" "github.com/hashicorp/terraform/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -120,7 +120,10 @@ func resourceArmDnsAaaaRecordRead(d *schema.ResourceData, meta interface{}) erro if err := d.Set("records", flattenAzureRmDnsAaaaRecords(resp.AaaaRecords)); err != nil { return err } - flattenAndSetTags(d, resp.Metadata) + + if err := flattenAndSetTags(d, &resp.Metadata); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_dns_aaaa_record_test.go b/azurerm/resource_arm_dns_aaaa_record_test.go index a46ecd39e7b3..2d75e7c20817 100644 --- a/azurerm/resource_arm_dns_aaaa_record_test.go +++ b/azurerm/resource_arm_dns_aaaa_record_test.go @@ -5,7 +5,7 @@ import ( "net/http" "testing" - "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns" + "github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/azurerm/resource_arm_dns_cname_record.go b/azurerm/resource_arm_dns_cname_record.go index 108e7fc3ac4b..eb446ebcf6cf 100644 --- a/azurerm/resource_arm_dns_cname_record.go +++ b/azurerm/resource_arm_dns_cname_record.go @@ -4,7 +4,7 @@ import ( "fmt" "net/http" - "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns" + "github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns" "github.com/hashicorp/terraform/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -127,7 +127,9 @@ func resourceArmDnsCNameRecordRead(d *schema.ResourceData, meta interface{}) err } } - flattenAndSetTags(d, resp.Metadata) + if err := flattenAndSetTags(d, &resp.Metadata); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_dns_cname_record_test.go b/azurerm/resource_arm_dns_cname_record_test.go index f856fa528eb1..3b5f6a2f0bf0 100644 --- a/azurerm/resource_arm_dns_cname_record_test.go +++ b/azurerm/resource_arm_dns_cname_record_test.go @@ -5,7 +5,7 @@ import ( "net/http" "testing" - "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns" + "github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/azurerm/resource_arm_dns_mx_record.go b/azurerm/resource_arm_dns_mx_record.go index 14aafd260fb2..5ea0a552bcf5 100644 --- a/azurerm/resource_arm_dns_mx_record.go +++ b/azurerm/resource_arm_dns_mx_record.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns" + "github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns" "github.com/hashicorp/terraform/helper/hashcode" "github.com/hashicorp/terraform/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" @@ -135,7 +135,10 @@ func resourceArmDnsMxRecordRead(d *schema.ResourceData, meta interface{}) error if err := d.Set("record", flattenAzureRmDnsMxRecords(resp.MxRecords)); err != nil { return err } - flattenAndSetTags(d, resp.Metadata) + + if err := flattenAndSetTags(d, &resp.Metadata); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_dns_mx_record_test.go b/azurerm/resource_arm_dns_mx_record_test.go index e7b7fab9a932..599bd9f75bbc 100644 --- a/azurerm/resource_arm_dns_mx_record_test.go +++ b/azurerm/resource_arm_dns_mx_record_test.go @@ -5,7 +5,7 @@ import ( "net/http" "testing" - "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns" + "github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/azurerm/resource_arm_dns_ns_record.go b/azurerm/resource_arm_dns_ns_record.go index 8f6d1b8b9afe..f5f11b639289 100644 --- a/azurerm/resource_arm_dns_ns_record.go +++ b/azurerm/resource_arm_dns_ns_record.go @@ -4,7 +4,7 @@ import ( "fmt" "net/http" - "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns" + "github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns" "github.com/hashicorp/terraform/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -126,7 +126,9 @@ func resourceArmDnsNsRecordRead(d *schema.ResourceData, meta interface{}) error return err } - flattenAndSetTags(d, resp.Metadata) + if err := flattenAndSetTags(d, &resp.Metadata); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_dns_ns_record_test.go b/azurerm/resource_arm_dns_ns_record_test.go index 32bddc4e8738..84020d91e866 100644 --- a/azurerm/resource_arm_dns_ns_record_test.go +++ b/azurerm/resource_arm_dns_ns_record_test.go @@ -5,7 +5,7 @@ import ( "net/http" "testing" - "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns" + "github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/azurerm/resource_arm_dns_ptr_record.go b/azurerm/resource_arm_dns_ptr_record.go index d4b52341c587..fa08b89df648 100644 --- a/azurerm/resource_arm_dns_ptr_record.go +++ b/azurerm/resource_arm_dns_ptr_record.go @@ -4,7 +4,7 @@ import ( "fmt" "net/http" - "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns" + "github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns" "github.com/hashicorp/terraform/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -122,7 +122,10 @@ func resourceArmDnsPtrRecordRead(d *schema.ResourceData, meta interface{}) error if err := d.Set("records", flattenAzureRmDnsPtrRecords(resp.PtrRecords)); err != nil { return err } - flattenAndSetTags(d, resp.Metadata) + + if err := flattenAndSetTags(d, &resp.Metadata); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_dns_ptr_record_test.go b/azurerm/resource_arm_dns_ptr_record_test.go index 805f1d7d926b..d6b814b013c6 100644 --- a/azurerm/resource_arm_dns_ptr_record_test.go +++ b/azurerm/resource_arm_dns_ptr_record_test.go @@ -5,7 +5,7 @@ import ( "net/http" "testing" - "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns" + "github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/azurerm/resource_arm_dns_srv_record.go b/azurerm/resource_arm_dns_srv_record.go index dc3e65237e40..ea56e47d8145 100644 --- a/azurerm/resource_arm_dns_srv_record.go +++ b/azurerm/resource_arm_dns_srv_record.go @@ -5,7 +5,7 @@ import ( "fmt" "net/http" - "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns" + "github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns" "github.com/hashicorp/terraform/helper/hashcode" "github.com/hashicorp/terraform/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" @@ -144,7 +144,10 @@ func resourceArmDnsSrvRecordRead(d *schema.ResourceData, meta interface{}) error if err := d.Set("record", flattenAzureRmDnsSrvRecords(resp.SrvRecords)); err != nil { return err } - flattenAndSetTags(d, resp.Metadata) + + if err := flattenAndSetTags(d, &resp.Metadata); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_dns_srv_record_test.go b/azurerm/resource_arm_dns_srv_record_test.go index e35c5c40dab6..fe36bbff9fc2 100644 --- a/azurerm/resource_arm_dns_srv_record_test.go +++ b/azurerm/resource_arm_dns_srv_record_test.go @@ -5,7 +5,7 @@ import ( "net/http" "testing" - "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns" + "github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/azurerm/resource_arm_dns_txt_record.go b/azurerm/resource_arm_dns_txt_record.go index 297d322240e7..e4a86ae48575 100644 --- a/azurerm/resource_arm_dns_txt_record.go +++ b/azurerm/resource_arm_dns_txt_record.go @@ -4,7 +4,7 @@ import ( "fmt" "net/http" - "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns" + "github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns" "github.com/hashicorp/terraform/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -126,7 +126,10 @@ func resourceArmDnsTxtRecordRead(d *schema.ResourceData, meta interface{}) error if err := d.Set("record", flattenAzureRmDnsTxtRecords(resp.TxtRecords)); err != nil { return err } - flattenAndSetTags(d, resp.Metadata) + + if err := flattenAndSetTags(d, &resp.Metadata); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_dns_txt_record_test.go b/azurerm/resource_arm_dns_txt_record_test.go index 5c6761ebc65d..3f28c6be6756 100644 --- a/azurerm/resource_arm_dns_txt_record_test.go +++ b/azurerm/resource_arm_dns_txt_record_test.go @@ -5,7 +5,7 @@ import ( "net/http" "testing" - "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns" + "github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" diff --git a/azurerm/resource_arm_dns_zone.go b/azurerm/resource_arm_dns_zone.go index 524ae4b4f469..fb166358a9fc 100644 --- a/azurerm/resource_arm_dns_zone.go +++ b/azurerm/resource_arm_dns_zone.go @@ -2,8 +2,9 @@ package azurerm import ( "fmt" + "strconv" - "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns" + "github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns" "github.com/hashicorp/terraform/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/response" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" @@ -104,8 +105,8 @@ func resourceArmDnsZoneRead(d *schema.ResourceData, meta interface{}) error { d.Set("name", name) d.Set("resource_group_name", resGroup) - d.Set("number_of_record_sets", resp.NumberOfRecordSets) - d.Set("max_number_of_record_sets", resp.MaxNumberOfRecordSets) + d.Set("number_of_record_sets", strconv.Itoa(int(*resp.NumberOfRecordSets))) + d.Set("max_number_of_record_sets", strconv.Itoa(int(*resp.MaxNumberOfRecordSets))) nameServers := make([]string, 0, len(*resp.NameServers)) for _, ns := range *resp.NameServers { @@ -115,7 +116,9 @@ func resourceArmDnsZoneRead(d *schema.ResourceData, meta interface{}) error { return err } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_eventgrid_topic.go b/azurerm/resource_arm_eventgrid_topic.go index a79ee1a317ef..9be88327e291 100644 --- a/azurerm/resource_arm_eventgrid_topic.go +++ b/azurerm/resource_arm_eventgrid_topic.go @@ -131,7 +131,9 @@ func resourceArmEventGridTopicRead(d *schema.ResourceData, meta interface{}) err d.Set("primary_access_key", keys.Key1) d.Set("secondary_access_key", keys.Key2) - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_eventhub_namespace.go b/azurerm/resource_arm_eventhub_namespace.go index 7c94f2ea9854..cbe905e692a7 100644 --- a/azurerm/resource_arm_eventhub_namespace.go +++ b/azurerm/resource_arm_eventhub_namespace.go @@ -192,7 +192,9 @@ func resourceArmEventHubNamespaceRead(d *schema.ResourceData, meta interface{}) d.Set("maximum_throughput_units", int(*props.MaximumThroughputUnits)) } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_express_route_circuit.go b/azurerm/resource_arm_express_route_circuit.go index 79e8215962aa..373bc070ebbf 100644 --- a/azurerm/resource_arm_express_route_circuit.go +++ b/azurerm/resource_arm_express_route_circuit.go @@ -190,7 +190,9 @@ func resourceArmExpressRouteCircuitRead(d *schema.ResourceData, meta interface{} d.Set("service_key", resp.ServiceKey) d.Set("allow_classic_operations", resp.AllowClassicOperations) - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_function_app.go b/azurerm/resource_arm_function_app.go index 10f9ce73c26c..5605dac254cf 100644 --- a/azurerm/resource_arm_function_app.go +++ b/azurerm/resource_arm_function_app.go @@ -341,7 +341,9 @@ func resourceArmFunctionAppRead(d *schema.ResourceData, meta interface{}) error return err } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } @@ -392,12 +394,12 @@ func getBasicFunctionAppAppSettings(d *schema.ResourceData) []web.NameValuePair } } -func expandFunctionAppAppSettings(d *schema.ResourceData) *map[string]*string { +func expandFunctionAppAppSettings(d *schema.ResourceData) map[string]*string { output := expandAppServiceAppSettings(d) basicAppSettings := getBasicFunctionAppAppSettings(d) for _, p := range basicAppSettings { - (*output)[*p.Name] = p.Value + (output)[*p.Name] = p.Value } return output @@ -453,7 +455,7 @@ func flattenFunctionAppSiteConfig(input *web.SiteConfig) []interface{} { return results } -func expandFunctionAppConnectionStrings(d *schema.ResourceData) *map[string]*web.ConnStringValueTypePair { +func expandFunctionAppConnectionStrings(d *schema.ResourceData) map[string]*web.ConnStringValueTypePair { input := d.Get("connection_string").([]interface{}) output := make(map[string]*web.ConnStringValueTypePair, len(input)) @@ -470,13 +472,13 @@ func expandFunctionAppConnectionStrings(d *schema.ResourceData) *map[string]*web } } - return &output + return output } -func flattenFunctionAppConnectionStrings(input *map[string]*web.ConnStringValueTypePair) interface{} { +func flattenFunctionAppConnectionStrings(input map[string]*web.ConnStringValueTypePair) interface{} { results := make([]interface{}, 0) - for k, v := range *input { + for k, v := range input { result := make(map[string]interface{}, 0) result["name"] = k result["type"] = string(v.Type) diff --git a/azurerm/resource_arm_image.go b/azurerm/resource_arm_image.go index 5aa499c3dd18..e5b776254e5a 100644 --- a/azurerm/resource_arm_image.go +++ b/azurerm/resource_arm_image.go @@ -273,7 +273,9 @@ func resourceArmImageRead(d *schema.ResourceData, meta interface{}) error { } } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_iothub.go b/azurerm/resource_arm_iothub.go index 38f58a7b5f90..47b7a2d6366e 100644 --- a/azurerm/resource_arm_iothub.go +++ b/azurerm/resource_arm_iothub.go @@ -179,9 +179,9 @@ func resourceArmIotHubRead(d *schema.ResourceData, meta interface{}) error { name := id.Path["IotHubs"] resourceGroup := id.ResourceGroup - hub, err := client.Get(ctx, id.ResourceGroup, name) + resp, err := client.Get(ctx, id.ResourceGroup, name) if err != nil { - if utils.ResponseWasNotFound(hub.Response) { + if utils.ResponseWasNotFound(resp.Response) { log.Printf("[DEBUG] IoTHub %q (Resource Group %q) was not found!", name, resourceGroup) d.SetId("") return nil @@ -202,21 +202,24 @@ func resourceArmIotHubRead(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("Error flattening `shared_access_policy` in IoTHub %q: %+v", name, err) } - if properties := hub.Properties; properties != nil { + if properties := resp.Properties; properties != nil { d.Set("hostname", properties.HostName) } d.Set("name", name) d.Set("resource_group_name", resourceGroup) - if location := hub.Location; location != nil { + if location := resp.Location; location != nil { d.Set("location", *location) } - sku := flattenIoTHubSku(hub.Sku) + sku := flattenIoTHubSku(resp.Sku) if err := d.Set("sku", sku); err != nil { return fmt.Errorf("Error flattening `sku`: %+v", err) } - d.Set("type", hub.Type) - flattenAndSetTags(d, hub.Tags) + d.Set("type", resp.Type) + + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_key_vault.go b/azurerm/resource_arm_key_vault.go index c2e1ce5b8937..c69d7880fb23 100644 --- a/azurerm/resource_arm_key_vault.go +++ b/azurerm/resource_arm_key_vault.go @@ -272,7 +272,9 @@ func resourceArmKeyVaultRead(d *schema.ResourceData, meta interface{}) error { d.Set("access_policy", flattenKeyVaultAccessPolicies(resp.Properties.AccessPolicies)) d.Set("vault_uri", resp.Properties.VaultURI) - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_key_vault_certificate.go b/azurerm/resource_arm_key_vault_certificate.go index d0cd9ea1e7d3..768c1897d72f 100644 --- a/azurerm/resource_arm_key_vault_certificate.go +++ b/azurerm/resource_arm_key_vault_certificate.go @@ -281,10 +281,10 @@ func resourceArmKeyVaultCertificateRead(d *schema.ResourceData, meta interface{} return err } - cert, err := client.GetCertificate(ctx, id.KeyVaultBaseUrl, id.Name, "") + resp, err := client.GetCertificate(ctx, id.KeyVaultBaseUrl, id.Name, "") if err != nil { - if utils.ResponseWasNotFound(cert.Response) { + if utils.ResponseWasNotFound(resp.Response) { d.SetId("") return nil } @@ -295,14 +295,16 @@ func resourceArmKeyVaultCertificateRead(d *schema.ResourceData, meta interface{} d.Set("name", id.Name) d.Set("vault_uri", id.KeyVaultBaseUrl) - certificatePolicy := flattenKeyVaultCertificatePolicy(cert.Policy) + certificatePolicy := flattenKeyVaultCertificatePolicy(resp.Policy) if err := d.Set("certificate_policy", certificatePolicy); err != nil { return fmt.Errorf("Error flattening Key Vault Certificate Policy: %+v", err) } // Computed d.Set("version", id.Version) - flattenAndSetTags(d, cert.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_key_vault_key.go b/azurerm/resource_arm_key_vault_key.go index ccaf78a7ae1e..64eb393add9e 100644 --- a/azurerm/resource_arm_key_vault_key.go +++ b/azurerm/resource_arm_key_vault_key.go @@ -194,7 +194,9 @@ func resourceArmKeyVaultKeyRead(d *schema.ResourceData, meta interface{}) error // Computed d.Set("version", id.Version) - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_key_vault_secret.go b/azurerm/resource_arm_key_vault_secret.go index ce50045b4c59..6423dd429a6f 100644 --- a/azurerm/resource_arm_key_vault_secret.go +++ b/azurerm/resource_arm_key_vault_secret.go @@ -173,7 +173,10 @@ func resourceArmKeyVaultSecretRead(d *schema.ResourceData, meta interface{}) err d.Set("version", respID.Version) d.Set("content_type", resp.ContentType) - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } + return nil } diff --git a/azurerm/resource_arm_kubernetes_cluster.go b/azurerm/resource_arm_kubernetes_cluster.go index 769319ddbf26..0154c70ec5a6 100644 --- a/azurerm/resource_arm_kubernetes_cluster.go +++ b/azurerm/resource_arm_kubernetes_cluster.go @@ -271,7 +271,9 @@ func resourceArmKubernetesClusterRead(d *schema.ResourceData, meta interface{}) d.Set("service_principal", servicePrincipal) } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_loadbalancer.go b/azurerm/resource_arm_loadbalancer.go index 21b4668ae70e..f134ad6b9169 100644 --- a/azurerm/resource_arm_loadbalancer.go +++ b/azurerm/resource_arm_loadbalancer.go @@ -190,7 +190,7 @@ func resourecArmLoadBalancerRead(d *schema.ResourceData, meta interface{}) error return err } - loadBalancer, exists, err := retrieveLoadBalancerById(d.Id(), meta) + resp, exists, err := retrieveLoadBalancerById(d.Id(), meta) if err != nil { return fmt.Errorf("Error retrieving Load Balancer by ID %q: %+v", d.Id(), err) } @@ -200,18 +200,18 @@ func resourecArmLoadBalancerRead(d *schema.ResourceData, meta interface{}) error return nil } - d.Set("name", loadBalancer.Name) + d.Set("name", resp.Name) d.Set("resource_group_name", id.ResourceGroup) - if location := loadBalancer.Location; location != nil { + if location := resp.Location; location != nil { d.Set("location", azureRMNormalizeLocation(*location)) } - if sku := loadBalancer.Sku; sku != nil { + if sku := resp.Sku; sku != nil { d.Set("sku", string(sku.Name)) } - if props := loadBalancer.LoadBalancerPropertiesFormat; props != nil { + if props := resp.LoadBalancerPropertiesFormat; props != nil { if feipConfigs := props.FrontendIPConfigurations; feipConfigs != nil { d.Set("frontend_ip_configuration", flattenLoadBalancerFrontendIpConfiguration(feipConfigs)) @@ -234,7 +234,9 @@ func resourecArmLoadBalancerRead(d *schema.ResourceData, meta interface{}) error } } - flattenAndSetTags(d, loadBalancer.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_local_network_gateway.go b/azurerm/resource_arm_local_network_gateway.go index 0f0ae312a0aa..a9bfc8ba006a 100644 --- a/azurerm/resource_arm_local_network_gateway.go +++ b/azurerm/resource_arm_local_network_gateway.go @@ -164,7 +164,9 @@ func resourceArmLocalNetworkGatewayRead(d *schema.ResourceData, meta interface{} } } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_log_analytics_workspace.go b/azurerm/resource_arm_log_analytics_workspace.go index c91d63e9e74b..5b6787d1f792 100644 --- a/azurerm/resource_arm_log_analytics_workspace.go +++ b/azurerm/resource_arm_log_analytics_workspace.go @@ -170,7 +170,10 @@ func resourceArmLogAnalyticsWorkspaceRead(d *schema.ResourceData, meta interface d.Set("secondary_shared_key", sharedKeys.SecondarySharedKey) } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } + return nil } diff --git a/azurerm/resource_arm_managed_disk.go b/azurerm/resource_arm_managed_disk.go index 0a9a4578e0bf..78d7483a7317 100644 --- a/azurerm/resource_arm_managed_disk.go +++ b/azurerm/resource_arm_managed_disk.go @@ -256,7 +256,9 @@ func resourceArmManagedDiskRead(d *schema.ResourceData, meta interface{}) error } } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_metric_alertrule.go b/azurerm/resource_arm_metric_alertrule.go index 4d052c22a1db..918ca8b31e31 100644 --- a/azurerm/resource_arm_metric_alertrule.go +++ b/azurerm/resource_arm_metric_alertrule.go @@ -153,6 +153,7 @@ func resourceArmMetricAlertRuleCreateOrUpdate(d *schema.ResourceData, meta inter resourceGroup := d.Get("resource_group_name").(string) location := d.Get("location").(string) tags := d.Get("tags").(map[string]interface{}) + expandedTags := expandTags(tags) alertRule, err := expandAzureRmMetricThresholdAlertRule(d) if err != nil { @@ -162,7 +163,7 @@ func resourceArmMetricAlertRuleCreateOrUpdate(d *schema.ResourceData, meta inter alertRuleResource := insights.AlertRuleResource{ Name: &name, Location: &location, - Tags: expandTags(tags), + Tags: &expandedTags, AlertRule: alertRule, } diff --git a/azurerm/resource_arm_mysql_server.go b/azurerm/resource_arm_mysql_server.go index 2ba58efe3c63..ec26bc8719a4 100644 --- a/azurerm/resource_arm_mysql_server.go +++ b/azurerm/resource_arm_mysql_server.go @@ -290,7 +290,9 @@ func resourceArmMySqlServerRead(d *schema.ResourceData, meta interface{}) error return err } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } // Computed d.Set("fqdn", resp.FullyQualifiedDomainName) diff --git a/azurerm/resource_arm_network_interface.go b/azurerm/resource_arm_network_interface.go index 397d5e67f813..6b9682f22187 100644 --- a/azurerm/resource_arm_network_interface.go +++ b/azurerm/resource_arm_network_interface.go @@ -379,7 +379,9 @@ func resourceArmNetworkInterfaceRead(d *schema.ResourceData, meta interface{}) e d.Set("enable_ip_forwarding", resp.EnableIPForwarding) d.Set("enable_accelerated_networking", resp.EnableAcceleratedNetworking) - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_network_security_group.go b/azurerm/resource_arm_network_security_group.go index df69e66039bd..1d4aaa2df971 100644 --- a/azurerm/resource_arm_network_security_group.go +++ b/azurerm/resource_arm_network_security_group.go @@ -237,7 +237,9 @@ func resourceArmNetworkSecurityGroupRead(d *schema.ResourceData, meta interface{ } } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_network_watcher.go b/azurerm/resource_arm_network_watcher.go index 363a13c71339..a5c95453c2eb 100644 --- a/azurerm/resource_arm_network_watcher.go +++ b/azurerm/resource_arm_network_watcher.go @@ -90,7 +90,9 @@ func resourceArmNetworkWatcherRead(d *schema.ResourceData, meta interface{}) err d.Set("resource_group_name", resourceGroup) d.Set("location", azureRMNormalizeLocation(*resp.Location)) - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_postgresql_server.go b/azurerm/resource_arm_postgresql_server.go index 556f8fe7097b..4201bce5e706 100644 --- a/azurerm/resource_arm_postgresql_server.go +++ b/azurerm/resource_arm_postgresql_server.go @@ -288,7 +288,9 @@ func resourceArmPostgreSQLServerRead(d *schema.ResourceData, meta interface{}) e d.Set("ssl_enforcement", string(resp.SslEnforcement)) d.Set("sku", flattenPostgreSQLServerSku(resp.Sku)) - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } // Computed d.Set("fqdn", resp.FullyQualifiedDomainName) diff --git a/azurerm/resource_arm_public_ip.go b/azurerm/resource_arm_public_ip.go index 6cde1fda07f4..d11b7e275ee5 100644 --- a/azurerm/resource_arm_public_ip.go +++ b/azurerm/resource_arm_public_ip.go @@ -235,7 +235,9 @@ func resourceArmPublicIpRead(d *schema.ResourceData, meta interface{}) error { } } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_redis_cache.go b/azurerm/resource_arm_redis_cache.go index 99d043505558..b724d7cd1d89 100644 --- a/azurerm/resource_arm_redis_cache.go +++ b/azurerm/resource_arm_redis_cache.go @@ -424,7 +424,9 @@ func resourceArmRedisCacheRead(d *schema.ResourceData, meta interface{}) error { d.Set("primary_access_key", keysResp.PrimaryKey) d.Set("secondary_access_key", keysResp.SecondaryKey) - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } @@ -471,7 +473,7 @@ func redisStateRefreshFunc(ctx context.Context, client redis.Client, resourceGro } } -func expandRedisConfiguration(d *schema.ResourceData) *map[string]*string { +func expandRedisConfiguration(d *schema.ResourceData) map[string]*string { output := make(map[string]*string) if v, ok := d.GetOk("redis_configuration.0.maxclients"); ok { @@ -517,7 +519,7 @@ func expandRedisConfiguration(d *schema.ResourceData) *map[string]*string { output["notify-keyspace-events"] = utils.String(v.(string)) } - return &output + return output } func expandRedisPatchSchedule(d *schema.ResourceData) (*redis.PatchSchedule, error) { @@ -548,20 +550,19 @@ func expandRedisPatchSchedule(d *schema.ResourceData) (*redis.PatchSchedule, err return &schedule, nil } -func flattenRedisConfiguration(configuration *map[string]*string) map[string]*string { - redisConfiguration := make(map[string]*string, len(*configuration)) - config := *configuration +func flattenRedisConfiguration(input map[string]*string) map[string]*string { + redisConfiguration := make(map[string]*string, 0) - redisConfiguration["maxclients"] = config["maxclients"] - redisConfiguration["maxmemory_delta"] = config["maxmemory-delta"] - redisConfiguration["maxmemory_reserved"] = config["maxmemory-reserved"] - redisConfiguration["maxmemory_policy"] = config["maxmemory-policy"] + redisConfiguration["maxclients"] = input["maxclients"] + redisConfiguration["maxmemory_delta"] = input["maxmemory-delta"] + redisConfiguration["maxmemory_reserved"] = input["maxmemory-reserved"] + redisConfiguration["maxmemory_policy"] = input["maxmemory-policy"] - redisConfiguration["rdb_backup_enabled"] = config["rdb-backup-enabled"] - redisConfiguration["rdb_backup_frequency"] = config["rdb-backup-frequency"] - redisConfiguration["rdb_backup_max_snapshot_count"] = config["rdb-backup-max-snapshot-count"] - redisConfiguration["rdb_storage_connection_string"] = config["rdb-storage-connection-string"] - redisConfiguration["notify_keyspace_events"] = config["notify-keyspace-events"] + redisConfiguration["rdb_backup_enabled"] = input["rdb-backup-enabled"] + redisConfiguration["rdb_backup_frequency"] = input["rdb-backup-frequency"] + redisConfiguration["rdb_backup_max_snapshot_count"] = input["rdb-backup-max-snapshot-count"] + redisConfiguration["rdb_storage_connection_string"] = input["rdb-storage-connection-string"] + redisConfiguration["notify_keyspace_events"] = input["notify-keyspace-events"] return redisConfiguration } diff --git a/azurerm/resource_arm_resource_group.go b/azurerm/resource_arm_resource_group.go index 352907784c28..b3dd920faae6 100644 --- a/azurerm/resource_arm_resource_group.go +++ b/azurerm/resource_arm_resource_group.go @@ -80,8 +80,13 @@ func resourceArmResourceGroupRead(d *schema.ResourceData, meta interface{}) erro } d.Set("name", resp.Name) - d.Set("location", azureRMNormalizeLocation(*resp.Location)) - flattenAndSetTags(d, resp.Tags) + if location := resp.Location; location != nil { + d.Set("location", azureRMNormalizeLocation(*location)) + } + + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_route_table.go b/azurerm/resource_arm_route_table.go index e4ee781fe92d..36d940a438ae 100644 --- a/azurerm/resource_arm_route_table.go +++ b/azurerm/resource_arm_route_table.go @@ -166,7 +166,9 @@ func resourceArmRouteTableRead(d *schema.ResourceData, meta interface{}) error { } } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_scheduler_job_collection.go b/azurerm/resource_arm_scheduler_job_collection.go index f668e496c8ee..79ae3943a5a6 100644 --- a/azurerm/resource_arm_scheduler_job_collection.go +++ b/azurerm/resource_arm_scheduler_job_collection.go @@ -173,26 +173,29 @@ func resourceArmSchedulerJobCollectionRead(d *schema.ResourceData, meta interfac return resourceArmSchedulerJobCollectionPopulate(d, resourceGroup, &collection) } -func resourceArmSchedulerJobCollectionPopulate(d *schema.ResourceData, resourceGroup string, collection *scheduler.JobCollectionDefinition) error { +func resourceArmSchedulerJobCollectionPopulate(d *schema.ResourceData, resourceGroup string, resp *scheduler.JobCollectionDefinition) error { //standard properties - d.Set("name", collection.Name) - d.Set("location", azureRMNormalizeLocation(*collection.Location)) + d.Set("name", resp.Name) + d.Set("location", azureRMNormalizeLocation(*resp.Location)) d.Set("resource_group_name", resourceGroup) - flattenAndSetTags(d, collection.Tags) //resource specific - if properties := collection.Properties; properties != nil { + if properties := resp.Properties; properties != nil { if sku := properties.Sku; sku != nil { d.Set("sku", sku.Name) } d.Set("state", string(properties.State)) if err := d.Set("quota", flattenAzureArmSchedulerJobCollectionQuota(properties.Quota)); err != nil { - return fmt.Errorf("Error flattening quota for Job Collection %q (Resource Group %q): %+v", collection.Name, resourceGroup, err) + return fmt.Errorf("Error flattening quota for Job Collection %q (Resource Group %q): %+v", resp.Name, resourceGroup, err) } } + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } + return nil } @@ -252,7 +255,6 @@ func expandAzureArmSchedulerJobCollectionQuota(d *schema.ResourceData) *schedule } func flattenAzureArmSchedulerJobCollectionQuota(quota *scheduler.JobCollectionQuota) []interface{} { - if quota == nil { return nil } diff --git a/azurerm/resource_arm_search_service.go b/azurerm/resource_arm_search_service.go index 00a73f7684b9..329e1bbbd6a8 100644 --- a/azurerm/resource_arm_search_service.go +++ b/azurerm/resource_arm_search_service.go @@ -149,7 +149,9 @@ func resourceArmSearchServiceRead(d *schema.ResourceData, meta interface{}) erro } } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_servicebus_namespace.go b/azurerm/resource_arm_servicebus_namespace.go index 27d9824adefb..51b22a2d0203 100644 --- a/azurerm/resource_arm_servicebus_namespace.go +++ b/azurerm/resource_arm_servicebus_namespace.go @@ -179,7 +179,9 @@ func resourceArmServiceBusNamespaceRead(d *schema.ResourceData, meta interface{} d.Set("default_secondary_key", keys.SecondaryKey) } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_snapshot.go b/azurerm/resource_arm_snapshot.go index bb29ed40719d..aa6ab947ea22 100644 --- a/azurerm/resource_arm_snapshot.go +++ b/azurerm/resource_arm_snapshot.go @@ -186,7 +186,9 @@ func resourceArmSnapshotRead(d *schema.ResourceData, meta interface{}) error { } } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_sql_administrator.go b/azurerm/resource_arm_sql_administrator.go index 923ce5d9fe2a..9e065ab3c7d3 100644 --- a/azurerm/resource_arm_sql_administrator.go +++ b/azurerm/resource_arm_sql_administrator.go @@ -55,7 +55,6 @@ func resourceArmSqlActiveDirectoryAdministratorCreateUpdate(d *schema.ResourceDa serverName := d.Get("server_name").(string) resGroup := d.Get("resource_group_name").(string) - administratorName := "activeDirectory" login := d.Get("login").(string) objectId := uuid.FromStringOrNil(d.Get("object_id").(string)) tenantId := uuid.FromStringOrNil(d.Get("tenant_id").(string)) @@ -68,7 +67,7 @@ func resourceArmSqlActiveDirectoryAdministratorCreateUpdate(d *schema.ResourceDa }, } - future, err := client.CreateOrUpdate(ctx, resGroup, serverName, administratorName, parameters) + future, err := client.CreateOrUpdate(ctx, resGroup, serverName, parameters) if err != nil { return err } @@ -78,7 +77,7 @@ func resourceArmSqlActiveDirectoryAdministratorCreateUpdate(d *schema.ResourceDa return err } - resp, err := client.Get(ctx, resGroup, serverName, administratorName) + resp, err := client.Get(ctx, resGroup, serverName) if err != nil { return err } @@ -99,9 +98,8 @@ func resourceArmSqlActiveDirectoryAdministratorRead(d *schema.ResourceData, meta resourceGroup := id.ResourceGroup serverName := id.Path["servers"] - administratorName := id.Path["administrators"] - resp, err := client.Get(ctx, resourceGroup, serverName, administratorName) + resp, err := client.Get(ctx, resourceGroup, serverName) if err != nil { if utils.ResponseWasNotFound(resp.Response) { log.Printf("[INFO] Error reading SQL AD administrator %q - removing from state", d.Id()) @@ -132,9 +130,8 @@ func resourceArmSqlActiveDirectoryAdministratorDelete(d *schema.ResourceData, me resourceGroup := id.ResourceGroup serverName := id.Path["servers"] - administratorName := id.Path["administrators"] - _, err = client.Delete(ctx, resourceGroup, serverName, administratorName) + _, err = client.Delete(ctx, resourceGroup, serverName) if err != nil { return fmt.Errorf("Error deleting SQL AD administrator: %+v", err) } diff --git a/azurerm/resource_arm_sql_administrator_test.go b/azurerm/resource_arm_sql_administrator_test.go index f4e67d32b5e7..9d2a7b5ff123 100644 --- a/azurerm/resource_arm_sql_administrator_test.go +++ b/azurerm/resource_arm_sql_administrator_test.go @@ -74,7 +74,7 @@ func testCheckAzureRMSqlAdministratorExists(name string) resource.TestCheckFunc client := testAccProvider.Meta().(*ArmClient).sqlServerAzureADAdministratorsClient ctx := testAccProvider.Meta().(*ArmClient).StopContext - _, err := client.Get(ctx, resourceGroup, serverName, "activeDirectory") + _, err := client.Get(ctx, resourceGroup, serverName) if err != nil { return err } @@ -96,7 +96,7 @@ func testCheckAzureRMSqlAdministratorDisappears(name string) resource.TestCheckF client := testAccProvider.Meta().(*ArmClient).sqlServerAzureADAdministratorsClient ctx := testAccProvider.Meta().(*ArmClient).StopContext - _, err := client.Delete(ctx, resourceGroup, serverName, "activeDirectory") + _, err := client.Delete(ctx, resourceGroup, serverName) if err != nil { return fmt.Errorf("Bad: Delete on sqlAdministratorClient: %+v", err) } @@ -117,7 +117,7 @@ func testCheckAzureRMSqlAdministratorDestroy(s *terraform.State) error { client := testAccProvider.Meta().(*ArmClient).sqlServerAzureADAdministratorsClient ctx := testAccProvider.Meta().(*ArmClient).StopContext - resp, err := client.Get(ctx, resourceGroup, serverName, "activeDirectory") + resp, err := client.Get(ctx, resourceGroup, serverName) if err != nil { if utils.ResponseWasNotFound(resp.Response) { return nil diff --git a/azurerm/resource_arm_sql_database.go b/azurerm/resource_arm_sql_database.go index 91982d81baad..b6d601706640 100644 --- a/azurerm/resource_arm_sql_database.go +++ b/azurerm/resource_arm_sql_database.go @@ -306,7 +306,9 @@ func resourceArmSqlDatabaseRead(d *schema.ResourceData, meta interface{}) error d.Set("encryption", flattenEncryptionStatus(props.TransparentDataEncryption)) } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_sql_elasticpool.go b/azurerm/resource_arm_sql_elasticpool.go index c855b0dbe3fd..5045b5ddd009 100644 --- a/azurerm/resource_arm_sql_elasticpool.go +++ b/azurerm/resource_arm_sql_elasticpool.go @@ -39,9 +39,10 @@ func resourceArmSqlElasticPool() *schema.Resource { }, "edition": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, + // TODO: switch this to an inline function ValidateFunc: validateSqlElasticPoolEdition(), }, @@ -157,7 +158,9 @@ func resourceArmSqlElasticPoolRead(d *schema.ResourceData, meta interface{}) err } } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_sql_server.go b/azurerm/resource_arm_sql_server.go index 613ec039a477..86d5fcc3c105 100644 --- a/azurerm/resource_arm_sql_server.go +++ b/azurerm/resource_arm_sql_server.go @@ -147,7 +147,9 @@ func resourceArmSqlServerRead(d *schema.ResourceData, meta interface{}) error { d.Set("fully_qualified_domain_name", serverProperties.FullyQualifiedDomainName) } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_storage_account.go b/azurerm/resource_arm_storage_account.go index 7356c232f5c3..286ef6d9aebe 100644 --- a/azurerm/resource_arm_storage_account.go +++ b/azurerm/resource_arm_storage_account.go @@ -2,7 +2,6 @@ package azurerm import ( "fmt" - "log" "regexp" "strings" @@ -252,7 +251,8 @@ func resourceArmStorageAccountCreate(d *schema.ResourceData, meta interface{}) e Services: &storage.EncryptionServices{ Blob: &storage.EncryptionService{ Enabled: utils.Bool(enableBlobEncryption), - }}, + }, + }, KeySource: storage.KeySource(storageAccountEncryptionSource), }, EnableHTTPSTrafficOnly: &enableHTTPSTrafficOnly, @@ -289,22 +289,22 @@ func resourceArmStorageAccountCreate(d *schema.ResourceData, meta interface{}) e // Create ctx := meta.(*ArmClient).StopContext - createFuture, createErr := client.Create(resourceGroupName, storageAccountName, parameters, ctx.Done()) - - select { - case err := <-createErr: - return fmt.Errorf( - "Error creating Azure Storage Account %q: %+v", - storageAccountName, err) - case account := <-createFuture: - if account.ID == nil { - return fmt.Errorf("Cannot read Storage Account %q (resource group %q) ID", - storageAccountName, resourceGroupName) - } - log.Printf("[INFO] storage account %q ID: %q", storageAccountName, *account.ID) - d.SetId(*account.ID) + future, err := client.Create(ctx, resourceGroupName, storageAccountName, parameters) + if err != nil { + return fmt.Errorf("Error creating Storage Account %q (Resource Group %q): %+v", storageAccountName, resourceGroupName, err) } + err = future.WaitForCompletion(ctx, client.Client) + if err != nil { + return fmt.Errorf("Error waiting for Storage Account %q (Resource Group %q) to provision: %+v", storageAccountName, resourceGroupName, err) + } + + account, err := client.GetProperties(ctx, resourceGroupName, storageAccountName) + if err != nil { + return fmt.Errorf("Error retrieving Storage Account %q (Resource Group %q): %+v", storageAccountName, resourceGroupName, err) + } + + d.SetId(*account.ID) return resourceArmStorageAccountRead(d, meta) } @@ -313,6 +313,7 @@ func resourceArmStorageAccountCreate(d *schema.ResourceData, meta interface{}) e // available requires a call to Update per parameter... func resourceArmStorageAccountUpdate(d *schema.ResourceData, meta interface{}) error { client := meta.(*ArmClient).storageServiceClient + ctx := meta.(*ArmClient).StopContext id, err := parseAzureResourceID(d.Id()) if err != nil { return err @@ -341,7 +342,7 @@ func resourceArmStorageAccountUpdate(d *schema.ResourceData, meta interface{}) e opts := storage.AccountUpdateParameters{ Sku: &sku, } - _, err := client.Update(resourceGroupName, storageAccountName, opts) + _, err := client.Update(ctx, resourceGroupName, storageAccountName, opts) if err != nil { return fmt.Errorf("Error updating Azure Storage Account type %q: %+v", storageAccountName, err) } @@ -358,7 +359,7 @@ func resourceArmStorageAccountUpdate(d *schema.ResourceData, meta interface{}) e }, } - _, err := client.Update(resourceGroupName, storageAccountName, opts) + _, err := client.Update(ctx, resourceGroupName, storageAccountName, opts) if err != nil { return fmt.Errorf("Error updating Azure Storage Account access_tier %q: %+v", storageAccountName, err) } @@ -372,7 +373,7 @@ func resourceArmStorageAccountUpdate(d *schema.ResourceData, meta interface{}) e opts := storage.AccountUpdateParameters{ Tags: expandTags(tags), } - _, err := client.Update(resourceGroupName, storageAccountName, opts) + _, err := client.Update(ctx, resourceGroupName, storageAccountName, opts) if err != nil { return fmt.Errorf("Error updating Azure Storage Account tags %q: %+v", storageAccountName, err) } @@ -409,7 +410,7 @@ func resourceArmStorageAccountUpdate(d *schema.ResourceData, meta interface{}) e d.SetPartial("enable_file_encryption") } - _, err := client.Update(resourceGroupName, storageAccountName, opts) + _, err := client.Update(ctx, resourceGroupName, storageAccountName, opts) if err != nil { return fmt.Errorf("Error updating Azure Storage Account Encryption %q: %+v", storageAccountName, err) } @@ -423,7 +424,7 @@ func resourceArmStorageAccountUpdate(d *schema.ResourceData, meta interface{}) e }, } - _, err := client.Update(resourceGroupName, storageAccountName, opts) + _, err := client.Update(ctx, resourceGroupName, storageAccountName, opts) if err != nil { return fmt.Errorf("Error updating Azure Storage Account Custom Domain %q: %+v", storageAccountName, err) } @@ -437,7 +438,7 @@ func resourceArmStorageAccountUpdate(d *schema.ResourceData, meta interface{}) e EnableHTTPSTrafficOnly: &enableHTTPSTrafficOnly, }, } - _, err := client.Update(resourceGroupName, storageAccountName, opts) + _, err := client.Update(ctx, resourceGroupName, storageAccountName, opts) if err != nil { return fmt.Errorf("Error updating Azure Storage Account enable_https_traffic_only %q: %+v", storageAccountName, err) } @@ -451,6 +452,7 @@ func resourceArmStorageAccountUpdate(d *schema.ResourceData, meta interface{}) e func resourceArmStorageAccountRead(d *schema.ResourceData, meta interface{}) error { client := meta.(*ArmClient).storageServiceClient + ctx := meta.(*ArmClient).StopContext endpointSuffix := meta.(*ArmClient).environment.StorageEndpointSuffix id, err := parseAzureResourceID(d.Id()) @@ -460,7 +462,7 @@ func resourceArmStorageAccountRead(d *schema.ResourceData, meta interface{}) err name := id.Path["storageAccounts"] resGroup := id.ResourceGroup - resp, err := client.GetProperties(resGroup, name) + resp, err := client.GetProperties(ctx, resGroup, name) if err != nil { if utils.ResponseWasNotFound(resp.Response) { d.SetId("") @@ -469,7 +471,7 @@ func resourceArmStorageAccountRead(d *schema.ResourceData, meta interface{}) err return fmt.Errorf("Error reading the state of AzureRM Storage Account %q: %+v", name, err) } - keys, err := client.ListKeys(resGroup, name) + keys, err := client.ListKeys(ctx, resGroup, name) if err != nil { return err } @@ -477,7 +479,9 @@ func resourceArmStorageAccountRead(d *schema.ResourceData, meta interface{}) err accessKeys := *keys.Keys d.Set("name", resp.Name) d.Set("resource_group_name", resGroup) - d.Set("location", azureRMNormalizeLocation(*resp.Location)) + if location := resp.Location; location != nil { + d.Set("location", azureRMNormalizeLocation(*location)) + } d.Set("account_kind", resp.Kind) if sku := resp.Sku; sku != nil { @@ -561,13 +565,16 @@ func resourceArmStorageAccountRead(d *schema.ResourceData, meta interface{}) err d.Set("primary_access_key", accessKeys[0].Value) d.Set("secondary_access_key", accessKeys[1].Value) - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } func resourceArmStorageAccountDelete(d *schema.ResourceData, meta interface{}) error { client := meta.(*ArmClient).storageServiceClient + ctx := meta.(*ArmClient).StopContext id, err := parseAzureResourceID(d.Id()) if err != nil { @@ -576,7 +583,7 @@ func resourceArmStorageAccountDelete(d *schema.ResourceData, meta interface{}) e name := id.Path["storageAccounts"] resGroup := id.ResourceGroup - _, err = client.Delete(resGroup, name) + _, err = client.Delete(ctx, resGroup, name) if err != nil { return fmt.Errorf("Error issuing AzureRM delete request for storage account %q: %+v", name, err) } diff --git a/azurerm/resource_arm_storage_account_test.go b/azurerm/resource_arm_storage_account_test.go index f9c84b6233d7..c03fdb679c7d 100644 --- a/azurerm/resource_arm_storage_account_test.go +++ b/azurerm/resource_arm_storage_account_test.go @@ -357,9 +357,9 @@ func testCheckAzureRMStorageAccountExists(name string) resource.TestCheckFunc { resourceGroup := rs.Primary.Attributes["resource_group_name"] // Ensure resource group exists in API - conn := testAccProvider.Meta().(*ArmClient).storageServiceClient - - resp, err := conn.GetProperties(resourceGroup, storageAccount) + client := testAccProvider.Meta().(*ArmClient).storageServiceClient + ctx := testAccProvider.Meta().(*ArmClient).StopContext + resp, err := client.GetProperties(ctx, resourceGroup, storageAccount) if err != nil { return fmt.Errorf("Bad: Get on storageServiceClient: %+v", err) } @@ -384,9 +384,10 @@ func testCheckAzureRMStorageAccountDisappears(name string) resource.TestCheckFun resourceGroup := rs.Primary.Attributes["resource_group_name"] // Ensure resource group exists in API - conn := testAccProvider.Meta().(*ArmClient).storageServiceClient + client := testAccProvider.Meta().(*ArmClient).storageServiceClient + ctx := testAccProvider.Meta().(*ArmClient).StopContext - _, err := conn.Delete(resourceGroup, storageAccount) + _, err := client.Delete(ctx, resourceGroup, storageAccount) if err != nil { return fmt.Errorf("Bad: Delete on storageServiceClient: %+v", err) } @@ -396,7 +397,8 @@ func testCheckAzureRMStorageAccountDisappears(name string) resource.TestCheckFun } func testCheckAzureRMStorageAccountDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*ArmClient).storageServiceClient + client := testAccProvider.Meta().(*ArmClient).storageServiceClient + ctx := testAccProvider.Meta().(*ArmClient).StopContext for _, rs := range s.RootModule().Resources { if rs.Type != "azurerm_storage_account" { @@ -406,7 +408,7 @@ func testCheckAzureRMStorageAccountDestroy(s *terraform.State) error { name := rs.Primary.Attributes["name"] resourceGroup := rs.Primary.Attributes["resource_group_name"] - resp, err := conn.GetProperties(resourceGroup, name) + resp, err := client.GetProperties(ctx, resourceGroup, name) if err != nil { return nil } diff --git a/azurerm/resource_arm_template_deployment.go b/azurerm/resource_arm_template_deployment.go index 97c6f3f76256..9c6a476db7cd 100644 --- a/azurerm/resource_arm_template_deployment.go +++ b/azurerm/resource_arm_template_deployment.go @@ -168,44 +168,16 @@ func resourceArmTemplateDeploymentRead(d *schema.ResourceData, meta interface{}) return fmt.Errorf("Error making Read request on Azure RM Template Deployment %q (Resource Group %q): %+v", name, resourceGroup, err) } - var outputs map[string]string - if resp.Properties.Outputs != nil && len(*resp.Properties.Outputs) > 0 { - outputs = make(map[string]string) - for key, output := range *resp.Properties.Outputs { - log.Printf("[DEBUG] Processing deployment output %s", key) - outputMap := output.(map[string]interface{}) - outputValue, ok := outputMap["value"] - if !ok { - log.Printf("[DEBUG] No value - skipping") - continue - } - outputType, ok := outputMap["type"] - if !ok { - log.Printf("[DEBUG] No type - skipping") - continue - } - - var outputValueString string - switch strings.ToLower(outputType.(string)) { - case "bool": - outputValueString = strconv.FormatBool(outputValue.(bool)) - - case "string": - outputValueString = outputValue.(string) + // TODO: pull ths out into a - case "int": - outputValueString = fmt.Sprint(outputValue) - - default: - log.Printf("[WARN] Ignoring output %s: Outputs of type %s are not currently supported in azurerm_template_deployment.", - key, outputType) - continue - } - outputs[key] = outputValueString + if props := resp.Properties; props != nil { + outputs := flattenTemplateDeploymentOutputs(props.Outputs) + if err := d.Set("outputs", outputs); err != nil { + return fmt.Errorf("Error flattening `outputs`: %+v", err) } } - return d.Set("outputs", outputs) + return nil } func resourceArmTemplateDeploymentDelete(d *schema.ResourceData, meta interface{}) error { @@ -295,3 +267,46 @@ func templateDeploymentStateStatusCodeRefreshFunc(ctx context.Context, client re return res, strconv.Itoa(res.StatusCode), nil } } + +func flattenTemplateDeploymentOutputs(input interface{}) interface{} { + results := make(map[string]string, 0) + + if input != nil { + if outputs := input.(map[string]interface{}); outputs != nil { + for key, output := range outputs { + log.Printf("[DEBUG] Processing deployment output %q", key) + outputMap := output.(map[string]interface{}) + outputValue, ok := outputMap["value"] + if !ok { + log.Printf("[DEBUG] No value - skipping") + continue + } + outputType, ok := outputMap["type"] + if !ok { + log.Printf("[DEBUG] No type - skipping") + continue + } + + var outputValueString string + switch strings.ToLower(outputType.(string)) { + case "bool": + outputValueString = strconv.FormatBool(outputValue.(bool)) + + case "string": + outputValueString = outputValue.(string) + + case "int": + outputValueString = fmt.Sprint(outputValue) + + default: + log.Printf("[WARN] Ignoring output %s: Outputs of type %s are not currently supported in azurerm_template_deployment.", + key, outputType) + continue + } + outputs[key] = outputValueString + } + } + } + + return results +} diff --git a/azurerm/resource_arm_traffic_manager_profile.go b/azurerm/resource_arm_traffic_manager_profile.go index bc04ff5a43d3..43d86c86e155 100644 --- a/azurerm/resource_arm_traffic_manager_profile.go +++ b/azurerm/resource_arm_traffic_manager_profile.go @@ -188,7 +188,9 @@ func resourceArmTrafficManagerProfileRead(d *schema.ResourceData, meta interface monitorFlat := flattenAzureRMTrafficManagerProfileMonitorConfig(profile.MonitorConfig) d.Set("monitor_config", schema.NewSet(resourceAzureRMTrafficManagerMonitorConfigHash, monitorFlat)) - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_virtual_machine.go b/azurerm/resource_arm_virtual_machine.go index 3e565f3c2c63..d843d3f37b87 100644 --- a/azurerm/resource_arm_virtual_machine.go +++ b/azurerm/resource_arm_virtual_machine.go @@ -723,7 +723,9 @@ func resourceArmVirtualMachineRead(d *schema.ResourceData, meta interface{}) err } } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_virtual_machine_extension.go b/azurerm/resource_arm_virtual_machine_extension.go index 3cbd1f5bd10b..b7aa31e2e168 100644 --- a/azurerm/resource_arm_virtual_machine_extension.go +++ b/azurerm/resource_arm_virtual_machine_extension.go @@ -169,20 +169,26 @@ func resourceArmVirtualMachineExtensionsRead(d *schema.ResourceData, meta interf d.Set("location", azureRMNormalizeLocation(*resp.Location)) d.Set("virtual_machine_name", vmName) d.Set("resource_group_name", resGroup) - d.Set("publisher", resp.VirtualMachineExtensionProperties.Publisher) - d.Set("type", resp.VirtualMachineExtensionProperties.Type) - d.Set("type_handler_version", resp.VirtualMachineExtensionProperties.TypeHandlerVersion) - d.Set("auto_upgrade_minor_version", resp.VirtualMachineExtensionProperties.AutoUpgradeMinorVersion) - if resp.VirtualMachineExtensionProperties.Settings != nil { - settings, err := structure.FlattenJsonToString(*resp.VirtualMachineExtensionProperties.Settings) - if err != nil { - return fmt.Errorf("unable to parse settings from response: %s", err) + if props := resp.VirtualMachineExtensionProperties; props != nil { + d.Set("publisher", props.Publisher) + d.Set("type", props.Type) + d.Set("type_handler_version", props.TypeHandlerVersion) + d.Set("auto_upgrade_minor_version", props.AutoUpgradeMinorVersion) + + if props.Settings != nil { + settingsMap := props.Settings.(map[string]interface{}) + settings, err := structure.FlattenJsonToString(settingsMap) + if err != nil { + return fmt.Errorf("unable to parse settings from response: %s", err) + } + d.Set("settings", settings) } - d.Set("settings", settings) } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_virtual_machine_scale_set.go b/azurerm/resource_arm_virtual_machine_scale_set.go index f649477c4f2e..988eeb4ae88b 100644 --- a/azurerm/resource_arm_virtual_machine_scale_set.go +++ b/azurerm/resource_arm_virtual_machine_scale_set.go @@ -774,7 +774,9 @@ func resourceArmVirtualMachineScaleSetRead(d *schema.ResourceData, meta interfac } } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } @@ -1100,17 +1102,17 @@ func flattenAzureRmVirtualMachineScaleSetExtensionProfile(profile *compute.Virtu for _, extension := range *profile.Extensions { e := make(map[string]interface{}) e["name"] = *extension.Name - properties := extension.VirtualMachineScaleSetExtensionProperties - if properties != nil { - e["publisher"] = *properties.Publisher - e["type"] = *properties.Type - e["type_handler_version"] = *properties.TypeHandlerVersion - if properties.AutoUpgradeMinorVersion != nil { - e["auto_upgrade_minor_version"] = *properties.AutoUpgradeMinorVersion + if props := extension.VirtualMachineScaleSetExtensionProperties; props != nil { + e["publisher"] = *props.Publisher + e["type"] = *props.Type + e["type_handler_version"] = *props.TypeHandlerVersion + if props.AutoUpgradeMinorVersion != nil { + e["auto_upgrade_minor_version"] = *props.AutoUpgradeMinorVersion } - if properties.Settings != nil { - settings, err := structure.FlattenJsonToString(*properties.Settings) + if props.Settings != nil { + settingsMap := props.Settings.(map[string]interface{}) + settings, err := structure.FlattenJsonToString(settingsMap) if err != nil { return nil, err } diff --git a/azurerm/resource_arm_virtual_network.go b/azurerm/resource_arm_virtual_network.go index 73ba85337403..1f536a067b21 100644 --- a/azurerm/resource_arm_virtual_network.go +++ b/azurerm/resource_arm_virtual_network.go @@ -198,7 +198,9 @@ func resourceArmVirtualNetworkRead(d *schema.ResourceData, meta interface{}) err d.Set("dns_servers", dnses) } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_virtual_network_gateway.go b/azurerm/resource_arm_virtual_network_gateway.go index 26d6259181f7..a887a7d89a43 100644 --- a/azurerm/resource_arm_virtual_network_gateway.go +++ b/azurerm/resource_arm_virtual_network_gateway.go @@ -315,7 +315,9 @@ func resourceArmVirtualNetworkGatewayRead(d *schema.ResourceData, meta interface } } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/resource_arm_virtual_network_gateway_connection.go b/azurerm/resource_arm_virtual_network_gateway_connection.go index ac59138213e6..e4cfeba9802a 100644 --- a/azurerm/resource_arm_virtual_network_gateway_connection.go +++ b/azurerm/resource_arm_virtual_network_gateway_connection.go @@ -329,7 +329,9 @@ func resourceArmVirtualNetworkGatewayConnectionRead(d *schema.ResourceData, meta } } - flattenAndSetTags(d, resp.Tags) + if err := flattenAndSetTags(d, &resp.Tags); err != nil { + return fmt.Errorf("Error flattening `tags`: %+v", err) + } return nil } diff --git a/azurerm/tags.go b/azurerm/tags.go index f229e3897b43..6b2526d8b192 100644 --- a/azurerm/tags.go +++ b/azurerm/tags.go @@ -67,7 +67,7 @@ func validateAzureRMTags(v interface{}, k string) (ws []string, es []error) { return } -func expandTags(tagsMap map[string]interface{}) *map[string]*string { +func expandTags(tagsMap map[string]interface{}) map[string]*string { output := make(map[string]*string, len(tagsMap)) for i, v := range tagsMap { @@ -76,20 +76,17 @@ func expandTags(tagsMap map[string]interface{}) *map[string]*string { output[i] = &value } - return &output + return output } -func flattenAndSetTags(d *schema.ResourceData, tagsMap *map[string]*string) { - if tagsMap == nil { - d.Set("tags", make(map[string]interface{})) - return - } - - output := make(map[string]interface{}, len(*tagsMap)) +func flattenAndSetTags(d *schema.ResourceData, tagsMap *map[string]*string) error { + output := make(map[string]interface{}, 0) - for i, v := range *tagsMap { - output[i] = *v + if tagsMap != nil { + for i, v := range *tagsMap { + output[i] = *v + } } - d.Set("tags", output) + return d.Set("tags", output) } diff --git a/azurerm/tags_test.go b/azurerm/tags_test.go index fb75c04f06ac..606f056b0758 100644 --- a/azurerm/tags_test.go +++ b/azurerm/tags_test.go @@ -74,8 +74,7 @@ func TestExpandARMTags(t *testing.T) { testData["key2"] = 21 testData["key3"] = "value3" - tempExpanded := expandTags(testData) - expanded := *tempExpanded + expanded := expandTags(testData) if len(expanded) != 3 { t.Fatalf("Expected 3 results in expanded tag map, got %d", len(expanded)) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/apikeys.go b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/apikeys.go index 727d2a551c86..5fc5b38a2ec8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/apikeys.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/apikeys.go @@ -41,9 +41,9 @@ func NewAPIKeysClientWithBaseURI(baseURI string, subscriptionID string) APIKeysC // Create create an API Key of an Application Insights component. // -// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights component -// resource. APIKeyProperties is properties that need to be specified to create an API key of a Application Insights -// component. +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. APIKeyProperties is properties that need to be specified to create an API key of a +// Application Insights component. func (client APIKeysClient) Create(ctx context.Context, resourceGroupName string, resourceName string, APIKeyProperties APIKeyRequest) (result ApplicationInsightsComponentAPIKey, err error) { req, err := client.CreatePreparer(ctx, resourceGroupName, resourceName, APIKeyProperties) if err != nil { @@ -111,8 +111,8 @@ func (client APIKeysClient) CreateResponder(resp *http.Response) (result Applica // Delete delete an API Key of an Application Insights component. // -// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights component -// resource. keyID is the API Key ID. This is unique within a Application Insights component. +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. keyID is the API Key ID. This is unique within a Application Insights component. func (client APIKeysClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, keyID string) (result ApplicationInsightsComponentAPIKey, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, keyID) if err != nil { @@ -179,8 +179,8 @@ func (client APIKeysClient) DeleteResponder(resp *http.Response) (result Applica // Get get the API Key for this key id. // -// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights component -// resource. keyID is the API Key ID. This is unique within a Application Insights component. +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. keyID is the API Key ID. This is unique within a Application Insights component. func (client APIKeysClient) Get(ctx context.Context, resourceGroupName string, resourceName string, keyID string) (result ApplicationInsightsComponentAPIKey, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, keyID) if err != nil { @@ -247,8 +247,8 @@ func (client APIKeysClient) GetResponder(resp *http.Response) (result Applicatio // List gets a list of API keys of an Application Insights component. // -// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights component -// resource. +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. func (client APIKeysClient) List(ctx context.Context, resourceGroupName string, resourceName string) (result ApplicationInsightsComponentAPIKeyListResult, err error) { req, err := client.ListPreparer(ctx, resourceGroupName, resourceName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/componentavailablefeatures.go b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/componentavailablefeatures.go new file mode 100644 index 000000000000..a85be906fff8 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/componentavailablefeatures.go @@ -0,0 +1,107 @@ +package insights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" + "net/http" +) + +// ComponentAvailableFeaturesClient is the composite Swagger for Application Insights Management Client +type ComponentAvailableFeaturesClient struct { + BaseClient +} + +// NewComponentAvailableFeaturesClient creates an instance of the ComponentAvailableFeaturesClient client. +func NewComponentAvailableFeaturesClient(subscriptionID string) ComponentAvailableFeaturesClient { + return NewComponentAvailableFeaturesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewComponentAvailableFeaturesClientWithBaseURI creates an instance of the ComponentAvailableFeaturesClient client. +func NewComponentAvailableFeaturesClientWithBaseURI(baseURI string, subscriptionID string) ComponentAvailableFeaturesClient { + return ComponentAvailableFeaturesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get returns all available features of the application insights component. +// +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. +func (client ComponentAvailableFeaturesClient) Get(ctx context.Context, resourceGroupName string, resourceName string) (result ApplicationInsightsComponentAvailableFeatures, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.ComponentAvailableFeaturesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.ComponentAvailableFeaturesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.ComponentAvailableFeaturesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ComponentAvailableFeaturesClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-05-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.insights/components/{resourceName}/getavailablebillingfeatures", 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 ComponentAvailableFeaturesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ComponentAvailableFeaturesClient) GetResponder(resp *http.Response) (result ApplicationInsightsComponentAvailableFeatures, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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/appinsights/mgmt/2015-05-01/insights/componentcurrentbillingfeatures.go b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/componentcurrentbillingfeatures.go index 81217343a0e3..f0231d4aca04 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/componentcurrentbillingfeatures.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/componentcurrentbillingfeatures.go @@ -42,8 +42,8 @@ func NewComponentCurrentBillingFeaturesClientWithBaseURI(baseURI string, subscri // Get returns current billing features for an Application Insights component. // -// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights component -// resource. +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. func (client ComponentCurrentBillingFeaturesClient) Get(ctx context.Context, resourceGroupName string, resourceName string) (result ApplicationInsightsComponentBillingFeatures, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, resourceName) if err != nil { @@ -109,9 +109,9 @@ func (client ComponentCurrentBillingFeaturesClient) GetResponder(resp *http.Resp // Update update current billing features for an Application Insights component. // -// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights component -// resource. billingFeaturesProperties is properties that need to be specified to update billing features for an -// Application Insights component. +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. billingFeaturesProperties is properties that need to be specified to update billing features +// for an Application Insights component. func (client ComponentCurrentBillingFeaturesClient) Update(ctx context.Context, resourceGroupName string, resourceName string, billingFeaturesProperties ApplicationInsightsComponentBillingFeatures) (result ApplicationInsightsComponentBillingFeatures, err error) { req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceName, billingFeaturesProperties) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/componentfeaturecapabilities.go b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/componentfeaturecapabilities.go new file mode 100644 index 000000000000..bbf01e178559 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/componentfeaturecapabilities.go @@ -0,0 +1,108 @@ +package insights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" + "net/http" +) + +// ComponentFeatureCapabilitiesClient is the composite Swagger for Application Insights Management Client +type ComponentFeatureCapabilitiesClient struct { + BaseClient +} + +// NewComponentFeatureCapabilitiesClient creates an instance of the ComponentFeatureCapabilitiesClient client. +func NewComponentFeatureCapabilitiesClient(subscriptionID string) ComponentFeatureCapabilitiesClient { + return NewComponentFeatureCapabilitiesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewComponentFeatureCapabilitiesClientWithBaseURI creates an instance of the ComponentFeatureCapabilitiesClient +// client. +func NewComponentFeatureCapabilitiesClientWithBaseURI(baseURI string, subscriptionID string) ComponentFeatureCapabilitiesClient { + return ComponentFeatureCapabilitiesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get returns feature capabilites of the application insights component. +// +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. +func (client ComponentFeatureCapabilitiesClient) Get(ctx context.Context, resourceGroupName string, resourceName string) (result ApplicationInsightsComponentFeatureCapabilities, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.ComponentFeatureCapabilitiesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.ComponentFeatureCapabilitiesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.ComponentFeatureCapabilitiesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ComponentFeatureCapabilitiesClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-05-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.insights/components/{resourceName}/featurecapabilities", 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 ComponentFeatureCapabilitiesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ComponentFeatureCapabilitiesClient) GetResponder(resp *http.Response) (result ApplicationInsightsComponentFeatureCapabilities, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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/appinsights/mgmt/2015-05-01/insights/componentquotastatus.go b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/componentquotastatus.go index 760159b6a5f2..c3db2737040e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/componentquotastatus.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/componentquotastatus.go @@ -41,8 +41,8 @@ func NewComponentQuotaStatusClientWithBaseURI(baseURI string, subscriptionID str // Get returns daily data volume cap (quota) status for an Application Insights component. // -// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights component -// resource. +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. func (client ComponentQuotaStatusClient) Get(ctx context.Context, resourceGroupName string, resourceName string) (result ApplicationInsightsComponentQuotaStatus, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, resourceName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/components.go b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/components.go index 2b80ba95d0b6..5d57cd06bd86 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/components.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/components.go @@ -43,13 +43,14 @@ func NewComponentsClientWithBaseURI(baseURI string, subscriptionID string) Compo // CreateOrUpdate creates (or updates) an Application Insights component. Note: You cannot specify a different value // for InstrumentationKey nor AppId in the Put operation. // -// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights component -// resource. insightProperties is properties that need to be specified to create an Application Insights component. +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. insightProperties is properties that need to be specified to create an Application Insights +// component. func (client ComponentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, insightProperties ApplicationInsightsComponent) (result ApplicationInsightsComponent, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: insightProperties, Constraints: []validation.Constraint{{Target: "insightProperties.Kind", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "insights.ComponentsClient", "CreateOrUpdate") + return result, validation.NewError("insights.ComponentsClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, insightProperties) @@ -118,8 +119,8 @@ func (client ComponentsClient) CreateOrUpdateResponder(resp *http.Response) (res // Delete deletes an Application Insights component. // -// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights component -// resource. +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. func (client ComponentsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string) (result autorest.Response, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName) if err != nil { @@ -184,8 +185,8 @@ func (client ComponentsClient) DeleteResponder(resp *http.Response) (result auto // Get returns an Application Insights component. // -// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights component -// resource. +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. func (client ComponentsClient) Get(ctx context.Context, resourceGroupName string, resourceName string) (result ApplicationInsightsComponent, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, resourceName) if err != nil { @@ -434,8 +435,8 @@ func (client ComponentsClient) ListByResourceGroupComplete(ctx context.Context, // UpdateTags updates an existing component's tags. To update other fields use the CreateOrUpdate method. // -// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights component -// resource. componentTags is updated tag information to set into the component instance. +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. componentTags is updated tag information to set into the component instance. func (client ComponentsClient) UpdateTags(ctx context.Context, resourceGroupName string, resourceName string, componentTags TagsResource) (result ApplicationInsightsComponent, err error) { req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, resourceName, componentTags) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/exportconfigurations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/exportconfigurations.go index 7ad42a9c51d9..96b323e578c9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/exportconfigurations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/exportconfigurations.go @@ -41,9 +41,9 @@ func NewExportConfigurationsClientWithBaseURI(baseURI string, subscriptionID str // Create create a Continuous Export configuration of an Application Insights component. // -// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights component -// resource. exportProperties is properties that need to be specified to create a Continuous Export configuration of a -// Application Insights component. +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. exportProperties is properties that need to be specified to create a Continuous Export +// configuration of a Application Insights component. func (client ExportConfigurationsClient) Create(ctx context.Context, resourceGroupName string, resourceName string, exportProperties ApplicationInsightsComponentExportRequest) (result ListApplicationInsightsComponentExportConfiguration, err error) { req, err := client.CreatePreparer(ctx, resourceGroupName, resourceName, exportProperties) if err != nil { @@ -111,9 +111,9 @@ func (client ExportConfigurationsClient) CreateResponder(resp *http.Response) (r // Delete delete a Continuous Export configuration of an Application Insights component. // -// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights component -// resource. exportID is the Continuous Export configuration ID. This is unique within a Application Insights -// component. +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. exportID is the Continuous Export configuration ID. This is unique within a Application +// Insights component. func (client ExportConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, exportID string) (result ApplicationInsightsComponentExportConfiguration, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, exportID) if err != nil { @@ -180,9 +180,9 @@ func (client ExportConfigurationsClient) DeleteResponder(resp *http.Response) (r // Get get the Continuous Export configuration for this export id. // -// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights component -// resource. exportID is the Continuous Export configuration ID. This is unique within a Application Insights -// component. +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. exportID is the Continuous Export configuration ID. This is unique within a Application +// Insights component. func (client ExportConfigurationsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, exportID string) (result ApplicationInsightsComponentExportConfiguration, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, exportID) if err != nil { @@ -249,8 +249,8 @@ func (client ExportConfigurationsClient) GetResponder(resp *http.Response) (resu // List gets a list of Continuous Export configuration of an Application Insights component. // -// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights component -// resource. +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. func (client ExportConfigurationsClient) List(ctx context.Context, resourceGroupName string, resourceName string) (result ListApplicationInsightsComponentExportConfiguration, err error) { req, err := client.ListPreparer(ctx, resourceGroupName, resourceName) if err != nil { @@ -316,9 +316,10 @@ func (client ExportConfigurationsClient) ListResponder(resp *http.Response) (res // Update update the Continuous Export configuration for this export id. // -// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights component -// resource. exportID is the Continuous Export configuration ID. This is unique within a Application Insights -// component. exportProperties is properties that need to be specified to update the Continuous Export configuration. +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. exportID is the Continuous Export configuration ID. This is unique within a Application +// Insights component. exportProperties is properties that need to be specified to update the Continuous Export +// configuration. func (client ExportConfigurationsClient) Update(ctx context.Context, resourceGroupName string, resourceName string, exportID string, exportProperties ApplicationInsightsComponentExportRequest) (result ApplicationInsightsComponentExportConfiguration, err error) { req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceName, exportID, exportProperties) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/models.go index 4ad8e8c61434..9647d2e11607 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/models.go @@ -74,6 +74,10 @@ type APIKeyRequest struct { // ApplicationInsightsComponent an Application Insights component definition. type ApplicationInsightsComponent struct { autorest.Response `json:"-"` + // Kind - The kind of application that this component refers to, used to customize UI. This value is a freeform string, values should typically be one of the following: web, ios, other, store, java, phone. + Kind *string `json:"kind,omitempty"` + // ApplicationInsightsComponentProperties - Properties that define an Application Insights component resource. + *ApplicationInsightsComponentProperties `json:"properties,omitempty"` // ID - Azure resource Id ID *string `json:"id,omitempty"` // Name - Azure resource name @@ -83,90 +87,109 @@ type ApplicationInsightsComponent struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - // Kind - The kind of application that this component refers to, used to customize UI. This value is a freeform string, values should typically be one of the following: web, ios, other, store, java, phone. - Kind *string `json:"kind,omitempty"` - // ApplicationInsightsComponentProperties - Properties that define an Application Insights component resource. - *ApplicationInsightsComponentProperties `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for ApplicationInsightsComponent struct. -func (aic *ApplicationInsightsComponent) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for ApplicationInsightsComponent. +func (aic ApplicationInsightsComponent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aic.Kind != nil { + objectMap["kind"] = aic.Kind } - var v *json.RawMessage - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - aic.Kind = &kind + if aic.ApplicationInsightsComponentProperties != nil { + objectMap["properties"] = aic.ApplicationInsightsComponentProperties } - - v = m["properties"] - if v != nil { - var properties ApplicationInsightsComponentProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - aic.ApplicationInsightsComponentProperties = &properties + if aic.ID != nil { + objectMap["id"] = aic.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - aic.ID = &ID + if aic.Name != nil { + objectMap["name"] = aic.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - aic.Name = &name + if aic.Type != nil { + objectMap["type"] = aic.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - aic.Type = &typeVar + if aic.Location != nil { + objectMap["location"] = aic.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - aic.Location = &location + if aic.Tags != nil { + objectMap["tags"] = aic.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for ApplicationInsightsComponent struct. +func (aic *ApplicationInsightsComponent) 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 "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + aic.Kind = &kind + } + case "properties": + if v != nil { + var applicationInsightsComponentProperties ApplicationInsightsComponentProperties + err = json.Unmarshal(*v, &applicationInsightsComponentProperties) + if err != nil { + return err + } + aic.ApplicationInsightsComponentProperties = &applicationInsightsComponentProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + aic.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + aic.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + aic.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + aic.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + aic.Tags = tags + } } - aic.Tags = &tags } return nil @@ -189,13 +212,21 @@ type ApplicationInsightsComponentAPIKey struct { LinkedWriteProperties *[]string `json:"linkedWriteProperties,omitempty"` } -// ApplicationInsightsComponentAPIKeyListResult describes the list of API Keys of an Application Insights Component. +// ApplicationInsightsComponentAPIKeyListResult describes the list of API Keys of an Application Insights +// Component. type ApplicationInsightsComponentAPIKeyListResult struct { autorest.Response `json:"-"` // Value - List of API Key definitions. Value *[]ApplicationInsightsComponentAPIKey `json:"value,omitempty"` } +// ApplicationInsightsComponentAvailableFeatures an Application Insights component available features. +type ApplicationInsightsComponentAvailableFeatures struct { + autorest.Response `json:"-"` + // Result - A list of Application Insigths component feature. + Result *[]ApplicationInsightsComponentFeature `json:"Result,omitempty"` +} + // ApplicationInsightsComponentBillingFeatures an Application Insights component billing features type ApplicationInsightsComponentBillingFeatures struct { autorest.Response `json:"-"` @@ -264,8 +295,8 @@ type ApplicationInsightsComponentExportConfiguration struct { ContainerName *string `json:"ContainerName,omitempty"` } -// ApplicationInsightsComponentExportRequest an Application Insights component Continuous Export configuration request -// definition. +// ApplicationInsightsComponentExportRequest an Application Insights component Continuous Export configuration +// request definition. type ApplicationInsightsComponentExportRequest struct { // RecordTypes - The document types to be exported, as comma separated values. Allowed values include 'Requests', 'Event', 'Exceptions', 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'. RecordTypes *string `json:"RecordTypes,omitempty"` @@ -287,6 +318,81 @@ type ApplicationInsightsComponentExportRequest struct { DestinationAccountID *string `json:"DestinationAccountId,omitempty"` } +// ApplicationInsightsComponentFeature an Application Insights component daily data volume cap status +type ApplicationInsightsComponentFeature struct { + // FeatureName - The pricing feature name. + FeatureName *string `json:"FeatureName,omitempty"` + // MeterID - The meter id used for the feature. + MeterID *string `json:"MeterId,omitempty"` + // MeterRateFrequency - The meter meter rate for the feature's meter. + MeterRateFrequency *string `json:"MeterRateFrequency,omitempty"` + // ResouceID - Reserved, not used now. + ResouceID *string `json:"ResouceId,omitempty"` + // IsHidden - Reserved, not used now. + IsHidden *bool `json:"IsHidden,omitempty"` + // Capabilities - A list of Application Insigths component feature capability. + Capabilities *[]ApplicationInsightsComponentFeatureCapability `json:"Capabilities,omitempty"` + // Title - Desplay name of the feature. + Title *string `json:"Title,omitempty"` + // IsMainFeature - Whether can apply addon feature on to it. + IsMainFeature *bool `json:"IsMainFeature,omitempty"` + // SupportedAddonFeatures - The add on features on main feature. + SupportedAddonFeatures *string `json:"SupportedAddonFeatures,omitempty"` +} + +// ApplicationInsightsComponentFeatureCapabilities an Application Insights component feature capabilities +type ApplicationInsightsComponentFeatureCapabilities struct { + autorest.Response `json:"-"` + // SupportExportData - Whether allow to use continuous export feature. + SupportExportData *bool `json:"SupportExportData,omitempty"` + // BurstThrottlePolicy - Reserved, not used now. + BurstThrottlePolicy *string `json:"BurstThrottlePolicy,omitempty"` + // MetadataClass - Reserved, not used now. + MetadataClass *string `json:"MetadataClass,omitempty"` + // LiveStreamMetrics - Reserved, not used now. + LiveStreamMetrics *bool `json:"LiveStreamMetrics,omitempty"` + // ApplicationMap - Reserved, not used now. + ApplicationMap *bool `json:"ApplicationMap,omitempty"` + // WorkItemIntegration - Whether allow to use work item integration feature. + WorkItemIntegration *bool `json:"WorkItemIntegration,omitempty"` + // PowerBIIntegration - Reserved, not used now. + PowerBIIntegration *bool `json:"PowerBIIntegration,omitempty"` + // OpenSchema - Reserved, not used now. + OpenSchema *bool `json:"OpenSchema,omitempty"` + // ProactiveDetection - Reserved, not used now. + ProactiveDetection *bool `json:"ProactiveDetection,omitempty"` + // AnalyticsIntegration - Reserved, not used now. + AnalyticsIntegration *bool `json:"AnalyticsIntegration,omitempty"` + // MultipleStepWebTest - Whether allow to use multiple steps web test feature. + MultipleStepWebTest *bool `json:"MultipleStepWebTest,omitempty"` + // APIAccessLevel - Reserved, not used now. + APIAccessLevel *string `json:"ApiAccessLevel,omitempty"` + // TrackingType - The applciation insights component used tracking type. + TrackingType *string `json:"TrackingType,omitempty"` + // DailyCap - Daily data volume cap in GB. + DailyCap *float64 `json:"DailyCap,omitempty"` + // DailyCapResetTime - Daily data volume cap UTC reset hour. + DailyCapResetTime *float64 `json:"DailyCapResetTime,omitempty"` + // ThrottleRate - Reserved, not used now. + ThrottleRate *float64 `json:"ThrottleRate,omitempty"` +} + +// ApplicationInsightsComponentFeatureCapability an Application Insights component feature capability +type ApplicationInsightsComponentFeatureCapability struct { + // Name - The name of the capability. + Name *string `json:"Name,omitempty"` + // Description - The description of the capability. + Description *string `json:"Description,omitempty"` + // Value - The vaule of the capability. + Value *string `json:"Value,omitempty"` + // Unit - The unit of the capability. + Unit *string `json:"Unit,omitempty"` + // MeterID - The meter used for the capability. + MeterID *string `json:"MeterId,omitempty"` + // MeterRateFrequency - The meter rate of the meter. + MeterRateFrequency *string `json:"MeterRateFrequency,omitempty"` +} + // ApplicationInsightsComponentListResult describes the list of Application Insights Resources. type ApplicationInsightsComponentListResult struct { autorest.Response `json:"-"` @@ -296,8 +402,8 @@ type ApplicationInsightsComponentListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// ApplicationInsightsComponentListResultIterator provides access to a complete listing of ApplicationInsightsComponent -// values. +// ApplicationInsightsComponentListResultIterator provides access to a complete listing of +// ApplicationInsightsComponent values. type ApplicationInsightsComponentListResultIterator struct { i int page ApplicationInsightsComponentListResultPage @@ -390,6 +496,45 @@ func (page ApplicationInsightsComponentListResultPage) Values() []ApplicationIns return *page.aiclr.Value } +// ApplicationInsightsComponentProactiveDetectionConfiguration properties that define a ProactiveDetection +// configuration. +type ApplicationInsightsComponentProactiveDetectionConfiguration struct { + autorest.Response `json:"-"` + // Name - The rule name + Name *string `json:"Name,omitempty"` + // Enabled - A flag that indicates whether this rule is enabled by the user + Enabled *bool `json:"Enabled,omitempty"` + // SendEmailsToSubscriptionOwners - A flag that indicated whether notifications on this rule should be sent to subscription owners + SendEmailsToSubscriptionOwners *bool `json:"SendEmailsToSubscriptionOwners,omitempty"` + // CustomEmails - Custom email addresses for this rule notifications + CustomEmails *[]string `json:"CustomEmails,omitempty"` + // LastUpdatedTime - The last time this rule was updated + LastUpdatedTime *string `json:"LastUpdatedTime,omitempty"` + // RuleDefinitions - Static definitions of the ProactiveDetection configuration rule (same values for all components). + RuleDefinitions *ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions `json:"RuleDefinitions,omitempty"` +} + +// ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions static definitions of the +// ProactiveDetection configuration rule (same values for all components). +type ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions struct { + // Name - The rule name + Name *string `json:"Name,omitempty"` + // DisplayName - The rule name as it is displayed in UI + DisplayName *string `json:"DisplayName,omitempty"` + // Description - The rule description + Description *string `json:"Description,omitempty"` + // HelpURL - URL which displays aditional info about the proactive detection rule + HelpURL *string `json:"HelpUrl,omitempty"` + // IsHidden - A flag indicating whether the rule is hidden (from the UI) + IsHidden *bool `json:"IsHidden,omitempty"` + // IsEnabledByDefault - A flag indicating whether the rule is enabled by default + IsEnabledByDefault *bool `json:"IsEnabledByDefault,omitempty"` + // IsInPreview - A flag indicating whether the rule is in preview + IsInPreview *bool `json:"IsInPreview,omitempty"` + // SupportsEmailNotifications - A flag indicating whether email notifications are supported for detections for this rule + SupportsEmailNotifications *bool `json:"SupportsEmailNotifications,omitempty"` +} + // ApplicationInsightsComponentProperties properties that define an Application Insights component resource. type ApplicationInsightsComponentProperties struct { // ApplicationID - The unique ID of your application. This field mirrors the 'Name' field and cannot be changed. @@ -429,8 +574,8 @@ type ApplicationInsightsComponentQuotaStatus struct { ExpirationTime *string `json:"ExpirationTime,omitempty"` } -// ErrorResponse error reponse indicates Insights service is not able to process the incoming request. The reason is -// provided in the error message. +// ErrorResponse error reponse indicates Insights service is not able to process the incoming request. The reason +// is provided in the error message. type ErrorResponse struct { // Code - Error code. Code *string `json:"code,omitempty"` @@ -444,6 +589,12 @@ type ListApplicationInsightsComponentExportConfiguration struct { Value *[]ApplicationInsightsComponentExportConfiguration `json:"value,omitempty"` } +// ListApplicationInsightsComponentProactiveDetectionConfiguration ... +type ListApplicationInsightsComponentProactiveDetectionConfiguration struct { + autorest.Response `json:"-"` + Value *[]ApplicationInsightsComponentProactiveDetectionConfiguration `json:"value,omitempty"` +} + // Operation CDN REST API operation type Operation struct { // Name - Operation name: {provider}/{resource}/{operation} @@ -462,8 +613,8 @@ type OperationDisplay struct { Operation *string `json:"operation,omitempty"` } -// OperationListResult result of the request to list CDN operations. It contains a list of operations and a URL link to -// get the next set of results. +// OperationListResult result of the request to list CDN operations. It contains a list of operations and a URL +// link to get the next set of results. type OperationListResult struct { autorest.Response `json:"-"` // Value - List of CDN operations supported by the CDN resource provider. @@ -576,19 +727,53 @@ type Resource struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.ID != nil { + objectMap["id"] = r.ID + } + if r.Name != nil { + objectMap["name"] = r.Name + } + if r.Type != nil { + objectMap["type"] = r.Type + } + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) } // TagsResource a container holding only the Tags for a resource, allowing the user to update the tags on a WebTest // instance. type TagsResource struct { // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for TagsResource. +func (tr TagsResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + return json.Marshal(objectMap) } // WebTest an Application Insights web test definition. type WebTest struct { autorest.Response `json:"-"` + // Kind - The kind of web test that this web test watches. Choices are ping and multistep. Possible values include: 'Ping', 'Multistep' + Kind WebTestKind `json:"kind,omitempty"` + // WebTestProperties - Metadata describing a web test for an Azure resource. + *WebTestProperties `json:"properties,omitempty"` // ID - Azure resource Id ID *string `json:"id,omitempty"` // Name - Azure resource name @@ -598,97 +783,114 @@ type WebTest struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - // Kind - The kind of web test that this web test watches. Choices are ping and multistep. Possible values include: 'Ping', 'Multistep' - Kind WebTestKind `json:"kind,omitempty"` - // WebTestProperties - Metadata describing a web test for an Azure resource. - *WebTestProperties `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for WebTest struct. -func (wt *WebTest) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for WebTest. +func (wt WebTest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["kind"] = wt.Kind + if wt.WebTestProperties != nil { + objectMap["properties"] = wt.WebTestProperties } - var v *json.RawMessage - - v = m["kind"] - if v != nil { - var kind WebTestKind - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - wt.Kind = kind + if wt.ID != nil { + objectMap["id"] = wt.ID } - - v = m["properties"] - if v != nil { - var properties WebTestProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - wt.WebTestProperties = &properties + if wt.Name != nil { + objectMap["name"] = wt.Name } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - wt.ID = &ID + if wt.Type != nil { + objectMap["type"] = wt.Type } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - wt.Name = &name + if wt.Location != nil { + objectMap["location"] = wt.Location } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - wt.Type = &typeVar + if wt.Tags != nil { + objectMap["tags"] = wt.Tags } + return json.Marshal(objectMap) +} - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - wt.Location = &location +// UnmarshalJSON is the custom unmarshaler for WebTest struct. +func (wt *WebTest) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err + for k, v := range m { + switch k { + case "kind": + if v != nil { + var kind WebTestKind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + wt.Kind = kind + } + case "properties": + if v != nil { + var webTestProperties WebTestProperties + err = json.Unmarshal(*v, &webTestProperties) + if err != nil { + return err + } + wt.WebTestProperties = &webTestProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + wt.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + wt.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + wt.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + wt.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + wt.Tags = tags + } } - wt.Tags = &tags } return nil } -// WebTestGeolocation geo-physical location to run a web test from. You must specify one or more locations for the test -// to run from. +// WebTestGeolocation geo-physical location to run a web test from. You must specify one or more locations for the +// test to run from. type WebTestGeolocation struct { // Location - Location ID for the webtest to run from. Location *string `json:"Id,omitempty"` diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/proactivedetectionconfigurations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/proactivedetectionconfigurations.go new file mode 100644 index 000000000000..0b4a630df137 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/proactivedetectionconfigurations.go @@ -0,0 +1,249 @@ +package insights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" + "net/http" +) + +// ProactiveDetectionConfigurationsClient is the composite Swagger for Application Insights Management Client +type ProactiveDetectionConfigurationsClient struct { + BaseClient +} + +// NewProactiveDetectionConfigurationsClient creates an instance of the ProactiveDetectionConfigurationsClient client. +func NewProactiveDetectionConfigurationsClient(subscriptionID string) ProactiveDetectionConfigurationsClient { + return NewProactiveDetectionConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewProactiveDetectionConfigurationsClientWithBaseURI creates an instance of the +// ProactiveDetectionConfigurationsClient client. +func NewProactiveDetectionConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) ProactiveDetectionConfigurationsClient { + return ProactiveDetectionConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get the ProactiveDetection configuration for this configuration id. +// +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. configurationID is the ProactiveDetection configuration ID. This is unique within a +// Application Insights component. +func (client ProactiveDetectionConfigurationsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, configurationID string) (result ApplicationInsightsComponentProactiveDetectionConfiguration, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, configurationID) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.ProactiveDetectionConfigurationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.ProactiveDetectionConfigurationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.ProactiveDetectionConfigurationsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ProactiveDetectionConfigurationsClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string, configurationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "ConfigurationId": autorest.Encode("path", configurationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-05-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.insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}", 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 ProactiveDetectionConfigurationsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ProactiveDetectionConfigurationsClient) GetResponder(resp *http.Response) (result ApplicationInsightsComponentProactiveDetectionConfiguration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of ProactiveDetection configurations of an Application Insights component. +// +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. +func (client ProactiveDetectionConfigurationsClient) List(ctx context.Context, resourceGroupName string, resourceName string) (result ListApplicationInsightsComponentProactiveDetectionConfiguration, err error) { + req, err := client.ListPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.ProactiveDetectionConfigurationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.ProactiveDetectionConfigurationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.ProactiveDetectionConfigurationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ProactiveDetectionConfigurationsClient) ListPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-05-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.insights/components/{resourceName}/ProactiveDetectionConfigs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ProactiveDetectionConfigurationsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ProactiveDetectionConfigurationsClient) ListResponder(resp *http.Response) (result ListApplicationInsightsComponentProactiveDetectionConfiguration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update update the ProactiveDetection configuration for this configuration id. +// +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. configurationID is the ProactiveDetection configuration ID. This is unique within a +// Application Insights component. proactiveDetectionProperties is properties that need to be specified to update +// the ProactiveDetection configuration. +func (client ProactiveDetectionConfigurationsClient) Update(ctx context.Context, resourceGroupName string, resourceName string, configurationID string, proactiveDetectionProperties ApplicationInsightsComponentProactiveDetectionConfiguration) (result ApplicationInsightsComponentProactiveDetectionConfiguration, err error) { + req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceName, configurationID, proactiveDetectionProperties) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.ProactiveDetectionConfigurationsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.ProactiveDetectionConfigurationsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.ProactiveDetectionConfigurationsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ProactiveDetectionConfigurationsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, configurationID string, proactiveDetectionProperties ApplicationInsightsComponentProactiveDetectionConfiguration) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "ConfigurationId": autorest.Encode("path", configurationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}", pathParameters), + autorest.WithJSON(proactiveDetectionProperties), + 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 ProactiveDetectionConfigurationsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ProactiveDetectionConfigurationsClient) UpdateResponder(resp *http.Response) (result ApplicationInsightsComponentProactiveDetectionConfiguration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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/appinsights/mgmt/2015-05-01/insights/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/version.go index 8f55e2f90685..313c6d6bdd74 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/version.go @@ -1,5 +1,7 @@ package insights +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package insights // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta services" + return "Azure-SDK-For-Go/" + version.Number + " insights/2015-05-01" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/webtests.go b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/webtests.go index 069ec99afe2f..447a7ede0d0a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/webtests.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/webtests.go @@ -43,8 +43,8 @@ func NewWebTestsClientWithBaseURI(baseURI string, subscriptionID string) WebTest // CreateOrUpdate creates or updates an Application Insights web test definition. // // resourceGroupName is the name of the resource group. webTestName is the name of the Application Insights webtest -// resource. webTestDefinition is properties that need to be specified to create or update an Application Insights web -// test definition. +// resource. webTestDefinition is properties that need to be specified to create or update an Application Insights +// web test definition. func (client WebTestsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, webTestName string, webTestDefinition WebTest) (result WebTest, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: webTestDefinition, @@ -53,7 +53,7 @@ func (client WebTestsClient) CreateOrUpdate(ctx context.Context, resourceGroupNa {Target: "webTestDefinition.WebTestProperties.WebTestName", Name: validation.Null, Rule: true, Chain: nil}, {Target: "webTestDefinition.WebTestProperties.Locations", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "insights.WebTestsClient", "CreateOrUpdate") + return result, validation.NewError("insights.WebTestsClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, webTestName, webTestDefinition) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/authorization/mgmt/2015-07-01/authorization/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/authorization/mgmt/2015-07-01/authorization/models.go index e18aeced9729..47061d681ea9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/authorization/mgmt/2015-07-01/authorization/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/authorization/mgmt/2015-07-01/authorization/models.go @@ -266,7 +266,7 @@ type ProviderOperation struct { // Origin - The operation origin. Origin *string `json:"origin,omitempty"` // Properties - The operation properties. - Properties *map[string]interface{} `json:"properties,omitempty"` + Properties interface{} `json:"properties,omitempty"` } // ProviderOperationsMetadata provider Operations metadata diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/authorization/mgmt/2015-07-01/authorization/provideroperationsmetadata.go b/vendor/github.com/Azure/azure-sdk-for-go/services/authorization/mgmt/2015-07-01/authorization/provideroperationsmetadata.go index b6069641030d..39dcb3028ea7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/authorization/mgmt/2015-07-01/authorization/provideroperationsmetadata.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/authorization/mgmt/2015-07-01/authorization/provideroperationsmetadata.go @@ -80,6 +80,8 @@ func (client ProviderOperationsMetadataClient) GetPreparer(ctx context.Context, } if len(expand) > 0 { queryParameters["$expand"] = autorest.Encode("query", expand) + } else { + queryParameters["$expand"] = autorest.Encode("query", "resourceTypes") } preparer := autorest.CreatePreparer( @@ -144,6 +146,8 @@ func (client ProviderOperationsMetadataClient) ListPreparer(ctx context.Context, } if len(expand) > 0 { queryParameters["$expand"] = autorest.Encode("query", expand) + } else { + queryParameters["$expand"] = autorest.Encode("query", "resourceTypes") } preparer := autorest.CreatePreparer( diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/authorization/mgmt/2015-07-01/authorization/roleassignments.go b/vendor/github.com/Azure/azure-sdk-for-go/services/authorization/mgmt/2015-07-01/authorization/roleassignments.go index 45a7e6afac2b..d07d2fbeda09 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/authorization/mgmt/2015-07-01/authorization/roleassignments.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/authorization/mgmt/2015-07-01/authorization/roleassignments.go @@ -44,8 +44,8 @@ func NewRoleAssignmentsClientWithBaseURI(baseURI string, subscriptionID string) // Create creates a role assignment. // -// scope is the scope of the role assignment to create. The scope can be any REST resource instance. For example, use -// '/subscriptions/{subscription-id}/' for a subscription, +// scope is the scope of the role assignment to create. The scope can be any REST resource instance. For example, +// use '/subscriptions/{subscription-id}/' for a subscription, // '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and // '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' // for a resource. roleAssignmentName is the name of the role assignment to create. It can be any valid GUID. @@ -116,8 +116,9 @@ func (client RoleAssignmentsClient) CreateResponder(resp *http.Response) (result // CreateByID creates a role assignment by ID. // -// roleAssignmentID is the fully qualified ID of the role assignment, including the scope, resource name and resource -// type. Use the format, /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: +// roleAssignmentID is the fully qualified ID of the role assignment, including the scope, resource name and +// resource type. Use the format, /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. +// Example: // /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. // parameters is parameters for the role assignment. func (client RoleAssignmentsClient) CreateByID(ctx context.Context, roleAssignmentID string, parameters RoleAssignmentCreateParameters) (result RoleAssignment, err error) { @@ -251,8 +252,9 @@ func (client RoleAssignmentsClient) DeleteResponder(resp *http.Response) (result // DeleteByID deletes a role assignment. // -// roleAssignmentID is the fully qualified ID of the role assignment, including the scope, resource name and resource -// type. Use the format, /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: +// roleAssignmentID is the fully qualified ID of the role assignment, including the scope, resource name and +// resource type. Use the format, /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. +// Example: // /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. func (client RoleAssignmentsClient) DeleteByID(ctx context.Context, roleAssignmentID string) (result RoleAssignment, err error) { req, err := client.DeleteByIDPreparer(ctx, roleAssignmentID) @@ -382,8 +384,9 @@ func (client RoleAssignmentsClient) GetResponder(resp *http.Response) (result Ro // GetByID gets a role assignment by ID. // -// roleAssignmentID is the fully qualified ID of the role assignment, including the scope, resource name and resource -// type. Use the format, /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: +// roleAssignmentID is the fully qualified ID of the role assignment, including the scope, resource name and +// resource type. Use the format, /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. +// Example: // /subscriptions/{subId}/resourcegroups/{rgname}//providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. func (client RoleAssignmentsClient) GetByID(ctx context.Context, roleAssignmentID string) (result RoleAssignment, err error) { req, err := client.GetByIDPreparer(ctx, roleAssignmentID) @@ -448,9 +451,9 @@ func (client RoleAssignmentsClient) GetByIDResponder(resp *http.Response) (resul // List gets all role assignments for the subscription. // -// filter is the filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the -// scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified -// principal. +// filter is the filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above +// the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the +// specified principal. func (client RoleAssignmentsClient) List(ctx context.Context, filter string) (result RoleAssignmentListResultPage, err error) { result.fn = client.listNextResults req, err := client.ListPreparer(ctx, filter) @@ -548,8 +551,8 @@ func (client RoleAssignmentsClient) ListComplete(ctx context.Context, filter str // resourceGroupName is the name of the resource group. resourceProviderNamespace is the namespace of the resource // provider. parentResourcePath is the parent resource identity. resourceType is the resource type of the resource. // resourceName is the name of the resource to get role assignments for. filter is the filter to apply on the -// operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq -// {id} to return all role assignments at, above or below the scope for the specified principal. +// operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId +// eq {id} to return all role assignments at, above or below the scope for the specified principal. func (client RoleAssignmentsClient) ListForResource(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, filter string) (result RoleAssignmentListResultPage, err error) { result.fn = client.listForResourceNextResults req, err := client.ListForResourcePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter) @@ -650,8 +653,8 @@ func (client RoleAssignmentsClient) ListForResourceComplete(ctx context.Context, // ListForResourceGroup gets role assignments for a resource group. // // resourceGroupName is the name of the resource group. filter is the filter to apply on the operation. Use -// $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return -// all role assignments at, above or below the scope for the specified principal. +// $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to +// return all role assignments at, above or below the scope for the specified principal. func (client RoleAssignmentsClient) ListForResourceGroup(ctx context.Context, resourceGroupName string, filter string) (result RoleAssignmentListResultPage, err error) { result.fn = client.listForResourceGroupNextResults req, err := client.ListForResourceGroupPreparer(ctx, resourceGroupName, filter) @@ -747,9 +750,9 @@ func (client RoleAssignmentsClient) ListForResourceGroupComplete(ctx context.Con // ListForScope gets role assignments for a scope. // -// scope is the scope of the role assignments. filter is the filter to apply on the operation. Use $filter=atScope() to -// return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments -// at, above or below the scope for the specified principal. +// scope is the scope of the role assignments. filter is the filter to apply on the operation. Use +// $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to +// return all role assignments at, above or below the scope for the specified principal. func (client RoleAssignmentsClient) ListForScope(ctx context.Context, scope string, filter string) (result RoleAssignmentListResultPage, err error) { result.fn = client.listForScopeNextResults req, err := client.ListForScopePreparer(ctx, scope, filter) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/authorization/mgmt/2015-07-01/authorization/roledefinitions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/authorization/mgmt/2015-07-01/authorization/roledefinitions.go index d143d5d7ae5a..758bef34bafb 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/authorization/mgmt/2015-07-01/authorization/roledefinitions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/authorization/mgmt/2015-07-01/authorization/roledefinitions.go @@ -44,8 +44,8 @@ func NewRoleDefinitionsClientWithBaseURI(baseURI string, subscriptionID string) // CreateOrUpdate creates or updates a role definition. // -// scope is the scope of the role definition. roleDefinitionID is the ID of the role definition. roleDefinition is the -// values for the role definition. +// scope is the scope of the role definition. roleDefinitionID is the ID of the role definition. roleDefinition is +// the values for the role definition. func (client RoleDefinitionsClient) CreateOrUpdate(ctx context.Context, scope string, roleDefinitionID string, roleDefinition RoleDefinition) (result RoleDefinition, err error) { req, err := client.CreateOrUpdatePreparer(ctx, scope, roleDefinitionID, roleDefinition) if err != nil { @@ -243,9 +243,9 @@ func (client RoleDefinitionsClient) GetResponder(resp *http.Response) (result Ro // GetByID gets a role definition by ID. // // roleDefinitionID is the fully qualified role definition ID. Use the format, -// /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription level -// role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant level role -// definitions. +// /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription +// level role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant +// level role definitions. func (client RoleDefinitionsClient) GetByID(ctx context.Context, roleDefinitionID string) (result RoleDefinition, err error) { req, err := client.GetByIDPreparer(ctx, roleDefinitionID) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/authorization/mgmt/2015-07-01/authorization/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/authorization/mgmt/2015-07-01/authorization/version.go index f2b7ffdfc7a1..77a9c4f0562f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/authorization/mgmt/2015-07-01/authorization/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/authorization/mgmt/2015-07-01/authorization/version.go @@ -1,5 +1,7 @@ package authorization +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package authorization // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta services" + return "Azure-SDK-For-Go/" + version.Number + " authorization/2015-07-01" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/account.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/account.go index c3ce360165aa..d58595f65b26 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/account.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/account.go @@ -42,13 +42,13 @@ func NewAccountClientWithBaseURI(baseURI string, subscriptionID string, resource // CreateOrUpdate create or update automation account. // -// resourceGroupName is the resource group name. automationAccountName is parameters supplied to the create or update -// automation account. parameters is parameters supplied to the create or update automation account. +// resourceGroupName is the resource group name. automationAccountName is parameters supplied to the create or +// update automation account. parameters is parameters supplied to the create or update automation account. func (client AccountClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, parameters AccountCreateOrUpdateParameters) (result Account, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.AccountClient", "CreateOrUpdate") + return result, validation.NewError("automation.AccountClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, parameters) @@ -122,7 +122,7 @@ func (client AccountClient) Delete(ctx context.Context, resourceGroupName string if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.AccountClient", "Delete") + return result, validation.NewError("automation.AccountClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName) @@ -193,7 +193,7 @@ func (client AccountClient) Get(ctx context.Context, resourceGroupName string, a if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.AccountClient", "Get") + return result, validation.NewError("automation.AccountClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName) @@ -355,7 +355,7 @@ func (client AccountClient) ListByResourceGroup(ctx context.Context, resourceGro if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.AccountClient", "ListByResourceGroup") + return result, validation.NewError("automation.AccountClient", "ListByResourceGroup", err.Error()) } result.fn = client.listByResourceGroupNextResults @@ -455,7 +455,7 @@ func (client AccountClient) Update(ctx context.Context, resourceGroupName string if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.AccountClient", "Update") + return result, validation.NewError("automation.AccountClient", "Update", err.Error()) } req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/activity.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/activity.go index a9f8809970bc..1c99f4838c8b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/activity.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/activity.go @@ -42,13 +42,13 @@ func NewActivityClientWithBaseURI(baseURI string, subscriptionID string, resourc // Get retrieve the activity in the module identified by module name and activity name. // -// automationAccountName is the automation account name. moduleName is the name of module. activityName is the name of -// activity. +// automationAccountName is the automation account name. moduleName is the name of module. activityName is the name +// of activity. func (client ActivityClient) Get(ctx context.Context, automationAccountName string, moduleName string, activityName string) (result Activity, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.ActivityClient", "Get") + return result, validation.NewError("automation.ActivityClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, automationAccountName, moduleName, activityName) @@ -122,7 +122,7 @@ func (client ActivityClient) ListByModule(ctx context.Context, automationAccount if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.ActivityClient", "ListByModule") + return result, validation.NewError("automation.ActivityClient", "ListByModule", err.Error()) } result.fn = client.listByModuleNextResults diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/agentregistrationinformation.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/agentregistrationinformation.go index e7a717c201e8..aff26bbb3de5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/agentregistrationinformation.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/agentregistrationinformation.go @@ -48,7 +48,7 @@ func (client AgentRegistrationInformationClient) Get(ctx context.Context, automa if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.AgentRegistrationInformationClient", "Get") + return result, validation.NewError("automation.AgentRegistrationInformationClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, automationAccountName) @@ -121,7 +121,7 @@ func (client AgentRegistrationInformationClient) RegenerateKey(ctx context.Conte if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.AgentRegistrationInformationClient", "RegenerateKey") + return result, validation.NewError("automation.AgentRegistrationInformationClient", "RegenerateKey", err.Error()) } req, err := client.RegenerateKeyPreparer(ctx, automationAccountName, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/certificate.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/certificate.go index 2fa5144f3a44..6578fc9be858 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/certificate.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/certificate.go @@ -42,8 +42,9 @@ func NewCertificateClientWithBaseURI(baseURI string, subscriptionID string, reso // CreateOrUpdate create a certificate. // -// automationAccountName is the automation account name. certificateName is the parameters supplied to the create or -// update certificate operation. parameters is the parameters supplied to the create or update certificate operation. +// automationAccountName is the automation account name. certificateName is the parameters supplied to the create +// or update certificate operation. parameters is the parameters supplied to the create or update certificate +// operation. func (client CertificateClient) CreateOrUpdate(ctx context.Context, automationAccountName string, certificateName string, parameters CertificateCreateOrUpdateParameters) (result Certificate, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, @@ -52,7 +53,7 @@ func (client CertificateClient) CreateOrUpdate(ctx context.Context, automationAc Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.CertificateCreateOrUpdateProperties", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.CertificateCreateOrUpdateProperties.Base64Value", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.CertificateClient", "CreateOrUpdate") + return result, validation.NewError("automation.CertificateClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, automationAccountName, certificateName, parameters) @@ -127,7 +128,7 @@ func (client CertificateClient) Delete(ctx context.Context, automationAccountNam if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.CertificateClient", "Delete") + return result, validation.NewError("automation.CertificateClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, automationAccountName, certificateName) @@ -199,7 +200,7 @@ func (client CertificateClient) Get(ctx context.Context, automationAccountName s if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.CertificateClient", "Get") + return result, validation.NewError("automation.CertificateClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, automationAccountName, certificateName) @@ -272,7 +273,7 @@ func (client CertificateClient) ListByAutomationAccount(ctx context.Context, aut if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.CertificateClient", "ListByAutomationAccount") + return result, validation.NewError("automation.CertificateClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults @@ -373,7 +374,7 @@ func (client CertificateClient) Update(ctx context.Context, automationAccountNam if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.CertificateClient", "Update") + return result, validation.NewError("automation.CertificateClient", "Update", err.Error()) } req, err := client.UpdatePreparer(ctx, automationAccountName, certificateName, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/connection.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/connection.go index 8e1e68e53e6f..f1dc66e836ea 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/connection.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/connection.go @@ -52,7 +52,7 @@ func (client ConnectionClient) CreateOrUpdate(ctx context.Context, automationAcc Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.ConnectionCreateOrUpdateProperties", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.ConnectionCreateOrUpdateProperties.ConnectionType", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.ConnectionClient", "CreateOrUpdate") + return result, validation.NewError("automation.ConnectionClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, automationAccountName, connectionName, parameters) @@ -127,7 +127,7 @@ func (client ConnectionClient) Delete(ctx context.Context, automationAccountName if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.ConnectionClient", "Delete") + return result, validation.NewError("automation.ConnectionClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, automationAccountName, connectionName) @@ -200,7 +200,7 @@ func (client ConnectionClient) Get(ctx context.Context, automationAccountName st if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.ConnectionClient", "Get") + return result, validation.NewError("automation.ConnectionClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, automationAccountName, connectionName) @@ -273,7 +273,7 @@ func (client ConnectionClient) ListByAutomationAccount(ctx context.Context, auto if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.ConnectionClient", "ListByAutomationAccount") + return result, validation.NewError("automation.ConnectionClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults @@ -374,7 +374,7 @@ func (client ConnectionClient) Update(ctx context.Context, automationAccountName if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.ConnectionClient", "Update") + return result, validation.NewError("automation.ConnectionClient", "Update", err.Error()) } req, err := client.UpdatePreparer(ctx, automationAccountName, connectionName, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/connectiontype.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/connectiontype.go index ee64b17abf86..8f232a747c58 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/connectiontype.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/connectiontype.go @@ -42,9 +42,9 @@ func NewConnectionTypeClientWithBaseURI(baseURI string, subscriptionID string, r // CreateOrUpdate create a connectiontype. // -// automationAccountName is the automation account name. connectionTypeName is the parameters supplied to the create or -// update connectiontype operation. parameters is the parameters supplied to the create or update connectiontype -// operation. +// automationAccountName is the automation account name. connectionTypeName is the parameters supplied to the +// create or update connectiontype operation. parameters is the parameters supplied to the create or update +// connectiontype operation. func (client ConnectionTypeClient) CreateOrUpdate(ctx context.Context, automationAccountName string, connectionTypeName string, parameters ConnectionTypeCreateOrUpdateParameters) (result ConnectionType, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, @@ -53,7 +53,7 @@ func (client ConnectionTypeClient) CreateOrUpdate(ctx context.Context, automatio Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.ConnectionTypeCreateOrUpdateProperties", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.ConnectionTypeCreateOrUpdateProperties.FieldDefinitions", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.ConnectionTypeClient", "CreateOrUpdate") + return result, validation.NewError("automation.ConnectionTypeClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, automationAccountName, connectionTypeName, parameters) @@ -128,7 +128,7 @@ func (client ConnectionTypeClient) Delete(ctx context.Context, automationAccount if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.ConnectionTypeClient", "Delete") + return result, validation.NewError("automation.ConnectionTypeClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, automationAccountName, connectionTypeName) @@ -200,7 +200,7 @@ func (client ConnectionTypeClient) Get(ctx context.Context, automationAccountNam if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.ConnectionTypeClient", "Get") + return result, validation.NewError("automation.ConnectionTypeClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, automationAccountName, connectionTypeName) @@ -273,7 +273,7 @@ func (client ConnectionTypeClient) ListByAutomationAccount(ctx context.Context, if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.ConnectionTypeClient", "ListByAutomationAccount") + return result, validation.NewError("automation.ConnectionTypeClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/credential.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/credential.go index 80efdeaef210..b4a23249472d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/credential.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/credential.go @@ -54,7 +54,7 @@ func (client CredentialClient) CreateOrUpdate(ctx context.Context, automationAcc Chain: []validation.Constraint{{Target: "parameters.CredentialCreateOrUpdateProperties.UserName", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.CredentialCreateOrUpdateProperties.Password", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.CredentialClient", "CreateOrUpdate") + return result, validation.NewError("automation.CredentialClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, automationAccountName, credentialName, parameters) @@ -129,7 +129,7 @@ func (client CredentialClient) Delete(ctx context.Context, automationAccountName if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.CredentialClient", "Delete") + return result, validation.NewError("automation.CredentialClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, automationAccountName, credentialName) @@ -201,7 +201,7 @@ func (client CredentialClient) Get(ctx context.Context, automationAccountName st if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.CredentialClient", "Get") + return result, validation.NewError("automation.CredentialClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, automationAccountName, credentialName) @@ -274,7 +274,7 @@ func (client CredentialClient) ListByAutomationAccount(ctx context.Context, auto if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.CredentialClient", "ListByAutomationAccount") + return result, validation.NewError("automation.CredentialClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults @@ -375,7 +375,7 @@ func (client CredentialClient) Update(ctx context.Context, automationAccountName if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.CredentialClient", "Update") + return result, validation.NewError("automation.CredentialClient", "Update", err.Error()) } req, err := client.UpdatePreparer(ctx, automationAccountName, credentialName, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dsccompilationjob.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dsccompilationjob.go index 013cefbbc2a1..7e9f97f00a89 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dsccompilationjob.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dsccompilationjob.go @@ -43,8 +43,8 @@ func NewDscCompilationJobClientWithBaseURI(baseURI string, subscriptionID string // Create creates the Dsc compilation job of the configuration. // -// automationAccountName is the automation account name. compilationJobID is the the DSC configuration Id. parameters -// is the parameters supplied to the create compilation job operation. +// automationAccountName is the automation account name. compilationJobID is the the DSC configuration Id. +// parameters is the parameters supplied to the create compilation job operation. func (client DscCompilationJobClient) Create(ctx context.Context, automationAccountName string, compilationJobID uuid.UUID, parameters DscCompilationJobCreateParameters) (result DscCompilationJob, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, @@ -52,7 +52,7 @@ func (client DscCompilationJobClient) Create(ctx context.Context, automationAcco {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.DscCompilationJobCreateProperties", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.DscCompilationJobCreateProperties.Configuration", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.DscCompilationJobClient", "Create") + return result, validation.NewError("automation.DscCompilationJobClient", "Create", err.Error()) } req, err := client.CreatePreparer(ctx, automationAccountName, compilationJobID, parameters) @@ -122,12 +122,13 @@ func (client DscCompilationJobClient) CreateResponder(resp *http.Response) (resu // Get retrieve the Dsc configuration compilation job identified by job id. // -// automationAccountName is the automation account name. compilationJobID is the Dsc configuration compilation job id. +// automationAccountName is the automation account name. compilationJobID is the Dsc configuration compilation job +// id. func (client DscCompilationJobClient) Get(ctx context.Context, automationAccountName string, compilationJobID uuid.UUID) (result DscCompilationJob, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.DscCompilationJobClient", "Get") + return result, validation.NewError("automation.DscCompilationJobClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, automationAccountName, compilationJobID) @@ -200,7 +201,7 @@ func (client DscCompilationJobClient) GetStream(ctx context.Context, automationA if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.DscCompilationJobClient", "GetStream") + return result, validation.NewError("automation.DscCompilationJobClient", "GetStream", err.Error()) } req, err := client.GetStreamPreparer(ctx, automationAccountName, jobID, jobStreamID) @@ -274,7 +275,7 @@ func (client DscCompilationJobClient) ListByAutomationAccount(ctx context.Contex if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.DscCompilationJobClient", "ListByAutomationAccount") + return result, validation.NewError("automation.DscCompilationJobClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dscconfiguration.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dscconfiguration.go index df6e2b9cd8ab..ec4e2a013335 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dscconfiguration.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dscconfiguration.go @@ -57,7 +57,7 @@ func (client DscConfigurationClient) CreateOrUpdate(ctx context.Context, automat }}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.DscConfigurationClient", "CreateOrUpdate") + return result, validation.NewError("automation.DscConfigurationClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, automationAccountName, configurationName, parameters) @@ -132,7 +132,7 @@ func (client DscConfigurationClient) Delete(ctx context.Context, automationAccou if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.DscConfigurationClient", "Delete") + return result, validation.NewError("automation.DscConfigurationClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, automationAccountName, configurationName) @@ -204,7 +204,7 @@ func (client DscConfigurationClient) Get(ctx context.Context, automationAccountN if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.DscConfigurationClient", "Get") + return result, validation.NewError("automation.DscConfigurationClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, automationAccountName, configurationName) @@ -277,7 +277,7 @@ func (client DscConfigurationClient) GetContent(ctx context.Context, automationA if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.DscConfigurationClient", "GetContent") + return result, validation.NewError("automation.DscConfigurationClient", "GetContent", err.Error()) } req, err := client.GetContentPreparer(ctx, automationAccountName, configurationName) @@ -349,7 +349,7 @@ func (client DscConfigurationClient) ListByAutomationAccount(ctx context.Context if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.DscConfigurationClient", "ListByAutomationAccount") + return result, validation.NewError("automation.DscConfigurationClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dscnode.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dscnode.go index 2a6fb84b37c8..4b8b8df469b7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dscnode.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dscnode.go @@ -47,7 +47,7 @@ func (client DscNodeClient) Delete(ctx context.Context, automationAccountName st if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.DscNodeClient", "Delete") + return result, validation.NewError("automation.DscNodeClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, automationAccountName, nodeID) @@ -120,7 +120,7 @@ func (client DscNodeClient) Get(ctx context.Context, automationAccountName strin if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.DscNodeClient", "Get") + return result, validation.NewError("automation.DscNodeClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, automationAccountName, nodeID) @@ -193,7 +193,7 @@ func (client DscNodeClient) ListByAutomationAccount(ctx context.Context, automat if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.DscNodeClient", "ListByAutomationAccount") + return result, validation.NewError("automation.DscNodeClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults @@ -297,7 +297,7 @@ func (client DscNodeClient) Update(ctx context.Context, automationAccountName st if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.DscNodeClient", "Update") + return result, validation.NewError("automation.DscNodeClient", "Update", err.Error()) } req, err := client.UpdatePreparer(ctx, automationAccountName, nodeID, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dscnodeconfiguration.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dscnodeconfiguration.go index 3028f786d1a9..6758a2b6157a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dscnodeconfiguration.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dscnodeconfiguration.go @@ -42,8 +42,8 @@ func NewDscNodeConfigurationClientWithBaseURI(baseURI string, subscriptionID str // CreateOrUpdate create the node configuration identified by node configuration name. // -// automationAccountName is the automation account name. nodeConfigurationName is the create or update parameters for -// configuration. parameters is the create or update parameters for configuration. +// automationAccountName is the automation account name. nodeConfigurationName is the create or update parameters +// for configuration. parameters is the create or update parameters for configuration. func (client DscNodeConfigurationClient) CreateOrUpdate(ctx context.Context, automationAccountName string, nodeConfigurationName string, parameters DscNodeConfigurationCreateOrUpdateParameters) (result DscNodeConfiguration, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, @@ -57,7 +57,7 @@ func (client DscNodeConfigurationClient) CreateOrUpdate(ctx context.Context, aut }}, {Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.Configuration", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.DscNodeConfigurationClient", "CreateOrUpdate") + return result, validation.NewError("automation.DscNodeConfigurationClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, automationAccountName, nodeConfigurationName, parameters) @@ -132,7 +132,7 @@ func (client DscNodeConfigurationClient) Delete(ctx context.Context, automationA if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.DscNodeConfigurationClient", "Delete") + return result, validation.NewError("automation.DscNodeConfigurationClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, automationAccountName, nodeConfigurationName) @@ -204,7 +204,7 @@ func (client DscNodeConfigurationClient) Get(ctx context.Context, automationAcco if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.DscNodeConfigurationClient", "Get") + return result, validation.NewError("automation.DscNodeConfigurationClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, automationAccountName, nodeConfigurationName) @@ -277,7 +277,7 @@ func (client DscNodeConfigurationClient) ListByAutomationAccount(ctx context.Con if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.DscNodeConfigurationClient", "ListByAutomationAccount") + return result, validation.NewError("automation.DscNodeConfigurationClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/fields.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/fields.go index 122fa0fc1e5c..92b868b9cefd 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/fields.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/fields.go @@ -48,7 +48,7 @@ func (client FieldsClient) ListByType(ctx context.Context, automationAccountName if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.FieldsClient", "ListByType") + return result, validation.NewError("automation.FieldsClient", "ListByType", err.Error()) } req, err := client.ListByTypePreparer(ctx, automationAccountName, moduleName, typeName) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/hybridrunbookworkergroup.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/hybridrunbookworkergroup.go index 2ee7969edae8..46dc46c71f89 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/hybridrunbookworkergroup.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/hybridrunbookworkergroup.go @@ -42,13 +42,13 @@ func NewHybridRunbookWorkerGroupClientWithBaseURI(baseURI string, subscriptionID // Delete delete a hybrid runbook worker group. // -// automationAccountName is automation account name. hybridRunbookWorkerGroupName is the hybrid runbook worker group -// name +// automationAccountName is automation account name. hybridRunbookWorkerGroupName is the hybrid runbook worker +// group name func (client HybridRunbookWorkerGroupClient) Delete(ctx context.Context, automationAccountName string, hybridRunbookWorkerGroupName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.HybridRunbookWorkerGroupClient", "Delete") + return result, validation.NewError("automation.HybridRunbookWorkerGroupClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, automationAccountName, hybridRunbookWorkerGroupName) @@ -121,7 +121,7 @@ func (client HybridRunbookWorkerGroupClient) Get(ctx context.Context, automation if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.HybridRunbookWorkerGroupClient", "Get") + return result, validation.NewError("automation.HybridRunbookWorkerGroupClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, automationAccountName, hybridRunbookWorkerGroupName) @@ -194,7 +194,7 @@ func (client HybridRunbookWorkerGroupClient) ListByAutomationAccount(ctx context if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.HybridRunbookWorkerGroupClient", "ListByAutomationAccount") + return result, validation.NewError("automation.HybridRunbookWorkerGroupClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults @@ -295,7 +295,7 @@ func (client HybridRunbookWorkerGroupClient) Update(ctx context.Context, automat if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.HybridRunbookWorkerGroupClient", "Update") + return result, validation.NewError("automation.HybridRunbookWorkerGroupClient", "Update", err.Error()) } req, err := client.UpdatePreparer(ctx, automationAccountName, hybridRunbookWorkerGroupName, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/job.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/job.go index 44412bbe7c52..38f0176fd58d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/job.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/job.go @@ -43,8 +43,8 @@ func NewJobClientWithBaseURI(baseURI string, subscriptionID string, resourceGrou // Create create a job of the runbook. // -// automationAccountName is the automation account name. jobID is the job id. parameters is the parameters supplied to -// the create job operation. +// automationAccountName is the automation account name. jobID is the job id. parameters is the parameters supplied +// to the create job operation. func (client JobClient) Create(ctx context.Context, automationAccountName string, jobID uuid.UUID, parameters JobCreateParameters) (result Job, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, @@ -52,7 +52,7 @@ func (client JobClient) Create(ctx context.Context, automationAccountName string {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.JobCreateProperties", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.JobCreateProperties.Runbook", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.JobClient", "Create") + return result, validation.NewError("automation.JobClient", "Create", err.Error()) } req, err := client.CreatePreparer(ctx, automationAccountName, jobID, parameters) @@ -127,7 +127,7 @@ func (client JobClient) Get(ctx context.Context, automationAccountName string, j if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.JobClient", "Get") + return result, validation.NewError("automation.JobClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, automationAccountName, jobID) @@ -200,7 +200,7 @@ func (client JobClient) GetOutput(ctx context.Context, automationAccountName str if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.JobClient", "GetOutput") + return result, validation.NewError("automation.JobClient", "GetOutput", err.Error()) } req, err := client.GetOutputPreparer(ctx, automationAccountName, jobID) @@ -272,7 +272,7 @@ func (client JobClient) GetRunbookContent(ctx context.Context, automationAccount if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.JobClient", "GetRunbookContent") + return result, validation.NewError("automation.JobClient", "GetRunbookContent", err.Error()) } req, err := client.GetRunbookContentPreparer(ctx, automationAccountName, jobID) @@ -344,7 +344,7 @@ func (client JobClient) ListByAutomationAccount(ctx context.Context, automationA if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.JobClient", "ListByAutomationAccount") + return result, validation.NewError("automation.JobClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults @@ -447,7 +447,7 @@ func (client JobClient) Resume(ctx context.Context, automationAccountName string if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.JobClient", "Resume") + return result, validation.NewError("automation.JobClient", "Resume", err.Error()) } req, err := client.ResumePreparer(ctx, automationAccountName, jobID) @@ -519,7 +519,7 @@ func (client JobClient) Stop(ctx context.Context, automationAccountName string, if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.JobClient", "Stop") + return result, validation.NewError("automation.JobClient", "Stop", err.Error()) } req, err := client.StopPreparer(ctx, automationAccountName, jobID) @@ -591,7 +591,7 @@ func (client JobClient) Suspend(ctx context.Context, automationAccountName strin if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.JobClient", "Suspend") + return result, validation.NewError("automation.JobClient", "Suspend", err.Error()) } req, err := client.SuspendPreparer(ctx, automationAccountName, jobID) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/jobschedule.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/jobschedule.go index e1302e5b16bc..5b1d2efe18b5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/jobschedule.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/jobschedule.go @@ -54,7 +54,7 @@ func (client JobScheduleClient) Create(ctx context.Context, automationAccountNam Chain: []validation.Constraint{{Target: "parameters.JobScheduleCreateProperties.Schedule", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.JobScheduleCreateProperties.Runbook", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.JobScheduleClient", "Create") + return result, validation.NewError("automation.JobScheduleClient", "Create", err.Error()) } req, err := client.CreatePreparer(ctx, automationAccountName, jobScheduleID, parameters) @@ -129,7 +129,7 @@ func (client JobScheduleClient) Delete(ctx context.Context, automationAccountNam if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.JobScheduleClient", "Delete") + return result, validation.NewError("automation.JobScheduleClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, automationAccountName, jobScheduleID) @@ -201,7 +201,7 @@ func (client JobScheduleClient) Get(ctx context.Context, automationAccountName s if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.JobScheduleClient", "Get") + return result, validation.NewError("automation.JobScheduleClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, automationAccountName, jobScheduleID) @@ -274,7 +274,7 @@ func (client JobScheduleClient) ListByAutomationAccount(ctx context.Context, aut if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.JobScheduleClient", "ListByAutomationAccount") + return result, validation.NewError("automation.JobScheduleClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/jobstream.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/jobstream.go index 16755555fd33..bf6ec2513774 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/jobstream.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/jobstream.go @@ -47,7 +47,7 @@ func (client JobStreamClient) Get(ctx context.Context, automationAccountName str if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.JobStreamClient", "Get") + return result, validation.NewError("automation.JobStreamClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, automationAccountName, jobID, jobStreamID) @@ -122,7 +122,7 @@ func (client JobStreamClient) ListByJob(ctx context.Context, automationAccountNa if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.JobStreamClient", "ListByJob") + return result, validation.NewError("automation.JobStreamClient", "ListByJob", err.Error()) } result.fn = client.listByJobNextResults diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/models.go index d38eb8bb6bdd..8e8e7006274e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/models.go @@ -357,6 +357,10 @@ const ( // Account definition of the automation account type. type Account struct { autorest.Response `json:"-"` + // AccountProperties - Gets or sets the automation account properties. + *AccountProperties `json:"properties,omitempty"` + // Etag - Gets or sets the etag of the resource. + Etag *string `json:"etag,omitempty"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name @@ -366,90 +370,109 @@ type Account struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - // AccountProperties - Gets or sets the automation account properties. - *AccountProperties `json:"properties,omitempty"` - // Etag - Gets or sets the etag of the resource. - Etag *string `json:"etag,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for Account struct. -func (a *Account) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for Account. +func (a Account) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.AccountProperties != nil { + objectMap["properties"] = a.AccountProperties } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties AccountProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - a.AccountProperties = &properties + if a.Etag != nil { + objectMap["etag"] = a.Etag } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - a.Etag = &etag + if a.ID != nil { + objectMap["id"] = a.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - a.ID = &ID + if a.Name != nil { + objectMap["name"] = a.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - a.Name = &name + if a.Type != nil { + objectMap["type"] = a.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - a.Type = &typeVar + if a.Location != nil { + objectMap["location"] = a.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - a.Location = &location + if a.Tags != nil { + objectMap["tags"] = a.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for Account struct. +func (a *Account) 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 "properties": + if v != nil { + var accountProperties AccountProperties + err = json.Unmarshal(*v, &accountProperties) + if err != nil { + return err + } + a.AccountProperties = &accountProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + a.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + a.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + a.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + a.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + a.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + a.Tags = tags + } } - a.Tags = &tags } return nil @@ -464,7 +487,25 @@ type AccountCreateOrUpdateParameters struct { // Location - Gets or sets the location of the resource. Location *string `json:"location,omitempty"` // Tags - Gets or sets the tags attached to the resource. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for AccountCreateOrUpdateParameters. +func (acoup AccountCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if acoup.AccountCreateOrUpdateProperties != nil { + objectMap["properties"] = acoup.AccountCreateOrUpdateProperties + } + if acoup.Name != nil { + objectMap["name"] = acoup.Name + } + if acoup.Location != nil { + objectMap["location"] = acoup.Location + } + if acoup.Tags != nil { + objectMap["tags"] = acoup.Tags + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for AccountCreateOrUpdateParameters struct. @@ -474,46 +515,45 @@ func (acoup *AccountCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties AccountCreateOrUpdateProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - acoup.AccountCreateOrUpdateProperties = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - acoup.Name = &name - } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - acoup.Location = &location - } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var accountCreateOrUpdateProperties AccountCreateOrUpdateProperties + err = json.Unmarshal(*v, &accountCreateOrUpdateProperties) + if err != nil { + return err + } + acoup.AccountCreateOrUpdateProperties = &accountCreateOrUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + acoup.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + acoup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + acoup.Tags = tags + } } - acoup.Tags = &tags } return nil @@ -652,7 +692,25 @@ type AccountUpdateParameters struct { // Location - Gets or sets the location of the resource. Location *string `json:"location,omitempty"` // Tags - Gets or sets the tags attached to the resource. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for AccountUpdateParameters. +func (aup AccountUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aup.AccountUpdateProperties != nil { + objectMap["properties"] = aup.AccountUpdateProperties + } + if aup.Name != nil { + objectMap["name"] = aup.Name + } + if aup.Location != nil { + objectMap["location"] = aup.Location + } + if aup.Tags != nil { + objectMap["tags"] = aup.Tags + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for AccountUpdateParameters struct. @@ -662,46 +720,45 @@ func (aup *AccountUpdateParameters) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties AccountUpdateProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - aup.AccountUpdateProperties = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - aup.Name = &name - } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - aup.Location = &location - } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var accountUpdateProperties AccountUpdateProperties + err = json.Unmarshal(*v, &accountUpdateProperties) + if err != nil { + return err + } + aup.AccountUpdateProperties = &accountUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + aup.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + aup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + aup.Tags = tags + } } - aup.Tags = &tags } return nil @@ -731,36 +788,36 @@ func (a *Activity) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - a.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - a.Name = &name - } - - v = m["properties"] - if v != nil { - var properties ActivityProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + a.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + a.Name = &name + } + case "properties": + if v != nil { + var activityProperties ActivityProperties + err = json.Unmarshal(*v, &activityProperties) + if err != nil { + return err + } + a.ActivityProperties = &activityProperties + } } - a.ActivityProperties = &properties } return nil @@ -968,7 +1025,23 @@ type AgentRegistrationRegenerateKeyParameter struct { // Location - Gets or sets the location of the resource. Location *string `json:"location,omitempty"` // Tags - Gets or sets the tags attached to the resource. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for AgentRegistrationRegenerateKeyParameter. +func (arrkp AgentRegistrationRegenerateKeyParameter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["keyName"] = arrkp.KeyName + if arrkp.Name != nil { + objectMap["name"] = arrkp.Name + } + if arrkp.Location != nil { + objectMap["location"] = arrkp.Location + } + if arrkp.Tags != nil { + objectMap["tags"] = arrkp.Tags + } + return json.Marshal(objectMap) } // Certificate definition of the certificate. @@ -978,6 +1051,8 @@ type Certificate struct { ID *string `json:"id,omitempty"` // Name - Gets the name of the certificate. Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` // CertificateProperties - Gets or sets the properties of the certificate. *CertificateProperties `json:"properties,omitempty"` } @@ -989,36 +1064,45 @@ func (c *Certificate) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - c.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - c.Name = &name - } - - v = m["properties"] - if v != nil { - var properties CertificateProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + c.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + c.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } + case "properties": + if v != nil { + var certificateProperties CertificateProperties + err = json.Unmarshal(*v, &certificateProperties) + if err != nil { + return err + } + c.CertificateProperties = &certificateProperties + } } - c.CertificateProperties = &properties } return nil @@ -1040,26 +1124,27 @@ func (ccoup *CertificateCreateOrUpdateParameters) UnmarshalJSON(body []byte) err if err != nil { return err } - var v *json.RawMessage - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - ccoup.Name = &name - } - - v = m["properties"] - if v != nil { - var properties CertificateCreateOrUpdateProperties - err = json.Unmarshal(*m["properties"], &properties) - 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 + } + ccoup.Name = &name + } + case "properties": + if v != nil { + var certificateCreateOrUpdateProperties CertificateCreateOrUpdateProperties + err = json.Unmarshal(*v, &certificateCreateOrUpdateProperties) + if err != nil { + return err + } + ccoup.CertificateCreateOrUpdateProperties = &certificateCreateOrUpdateProperties + } } - ccoup.CertificateCreateOrUpdateProperties = &properties } return nil @@ -1210,26 +1295,27 @@ func (cup *CertificateUpdateParameters) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - cup.Name = &name - } - - v = m["properties"] - if v != nil { - var properties CertificateUpdateProperties - err = json.Unmarshal(*m["properties"], &properties) - 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 + } + cup.Name = &name + } + case "properties": + if v != nil { + var certificateUpdateProperties CertificateUpdateProperties + err = json.Unmarshal(*v, &certificateUpdateProperties) + if err != nil { + return err + } + cup.CertificateUpdateProperties = &certificateUpdateProperties + } } - cup.CertificateUpdateProperties = &properties } return nil @@ -1248,6 +1334,8 @@ type Connection struct { ID *string `json:"id,omitempty"` // Name - Gets the name of the connection. Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` // ConnectionProperties - Gets or sets the properties of the connection. *ConnectionProperties `json:"properties,omitempty"` } @@ -1259,36 +1347,45 @@ func (c *Connection) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - c.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - c.Name = &name - } - - v = m["properties"] - if v != nil { - var properties ConnectionProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + c.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + c.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } + case "properties": + if v != nil { + var connectionProperties ConnectionProperties + err = json.Unmarshal(*v, &connectionProperties) + if err != nil { + return err + } + c.ConnectionProperties = &connectionProperties + } } - c.ConnectionProperties = &properties } return nil @@ -1309,26 +1406,27 @@ func (ccoup *ConnectionCreateOrUpdateParameters) UnmarshalJSON(body []byte) erro if err != nil { return err } - var v *json.RawMessage - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - ccoup.Name = &name - } - - v = m["properties"] - if v != nil { - var properties ConnectionCreateOrUpdateProperties - err = json.Unmarshal(*m["properties"], &properties) - 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 + } + ccoup.Name = &name + } + case "properties": + if v != nil { + var connectionCreateOrUpdateProperties ConnectionCreateOrUpdateProperties + err = json.Unmarshal(*v, &connectionCreateOrUpdateProperties) + if err != nil { + return err + } + ccoup.ConnectionCreateOrUpdateProperties = &connectionCreateOrUpdateProperties + } } - ccoup.ConnectionCreateOrUpdateProperties = &properties } return nil @@ -1341,7 +1439,22 @@ type ConnectionCreateOrUpdateProperties struct { // ConnectionType - Gets or sets the connectionType of the connection. ConnectionType *ConnectionTypeAssociationProperty `json:"connectionType,omitempty"` // FieldDefinitionValues - Gets or sets the field definition properties of the connection. - FieldDefinitionValues *map[string]*string `json:"fieldDefinitionValues,omitempty"` + FieldDefinitionValues map[string]*string `json:"fieldDefinitionValues"` +} + +// MarshalJSON is the custom marshaler for ConnectionCreateOrUpdateProperties. +func (ccoup ConnectionCreateOrUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ccoup.Description != nil { + objectMap["description"] = ccoup.Description + } + if ccoup.ConnectionType != nil { + objectMap["connectionType"] = ccoup.ConnectionType + } + if ccoup.FieldDefinitionValues != nil { + objectMap["fieldDefinitionValues"] = ccoup.FieldDefinitionValues + } + return json.Marshal(objectMap) } // ConnectionListResult the response model for the list connection operation. @@ -1451,7 +1564,7 @@ type ConnectionProperties struct { // ConnectionType - Gets or sets the connectionType of the connection. ConnectionType *ConnectionTypeAssociationProperty `json:"connectionType,omitempty"` // FieldDefinitionValues - Gets the field definition values of the connection. - FieldDefinitionValues *map[string]*string `json:"fieldDefinitionValues,omitempty"` + FieldDefinitionValues map[string]*string `json:"fieldDefinitionValues"` // CreationTime - Gets the creation time. CreationTime *date.Time `json:"creationTime,omitempty"` // LastModifiedTime - Gets the last modified time. @@ -1460,6 +1573,27 @@ type ConnectionProperties struct { Description *string `json:"description,omitempty"` } +// MarshalJSON is the custom marshaler for ConnectionProperties. +func (cp ConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cp.ConnectionType != nil { + objectMap["connectionType"] = cp.ConnectionType + } + if cp.FieldDefinitionValues != nil { + objectMap["fieldDefinitionValues"] = cp.FieldDefinitionValues + } + if cp.CreationTime != nil { + objectMap["creationTime"] = cp.CreationTime + } + if cp.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = cp.LastModifiedTime + } + if cp.Description != nil { + objectMap["description"] = cp.Description + } + return json.Marshal(objectMap) +} + // ConnectionType definition of the connection type. type ConnectionType struct { autorest.Response `json:"-"` @@ -1467,6 +1601,8 @@ type ConnectionType struct { ID *string `json:"id,omitempty"` // Name - Gets the name of the connection type. Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` // ConnectionTypeProperties - Gets or sets the properties of the connection type. *ConnectionTypeProperties `json:"properties,omitempty"` } @@ -1478,36 +1614,45 @@ func (ct *ConnectionType) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - ct.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - ct.Name = &name - } - - v = m["properties"] - if v != nil { - var properties ConnectionTypeProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ct.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ct.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ct.Type = &typeVar + } + case "properties": + if v != nil { + var connectionTypeProperties ConnectionTypeProperties + err = json.Unmarshal(*v, &connectionTypeProperties) + if err != nil { + return err + } + ct.ConnectionTypeProperties = &connectionTypeProperties + } } - ct.ConnectionTypeProperties = &properties } return nil @@ -1519,7 +1664,8 @@ type ConnectionTypeAssociationProperty struct { Name *string `json:"name,omitempty"` } -// ConnectionTypeCreateOrUpdateParameters the parameters supplied to the create or update connection type operation. +// ConnectionTypeCreateOrUpdateParameters the parameters supplied to the create or update connection type +// operation. type ConnectionTypeCreateOrUpdateParameters struct { // Name - Gets or sets the name of the connection type. Name *string `json:"name,omitempty"` @@ -1534,26 +1680,27 @@ func (ctcoup *ConnectionTypeCreateOrUpdateParameters) UnmarshalJSON(body []byte) if err != nil { return err } - var v *json.RawMessage - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - ctcoup.Name = &name - } - - v = m["properties"] - if v != nil { - var properties ConnectionTypeCreateOrUpdateProperties - err = json.Unmarshal(*m["properties"], &properties) - 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 + } + ctcoup.Name = &name + } + case "properties": + if v != nil { + var connectionTypeCreateOrUpdateProperties ConnectionTypeCreateOrUpdateProperties + err = json.Unmarshal(*v, &connectionTypeCreateOrUpdateProperties) + if err != nil { + return err + } + ctcoup.ConnectionTypeCreateOrUpdateProperties = &connectionTypeCreateOrUpdateProperties + } } - ctcoup.ConnectionTypeCreateOrUpdateProperties = &properties } return nil @@ -1564,7 +1711,19 @@ type ConnectionTypeCreateOrUpdateProperties struct { // IsGlobal - Gets or sets a Boolean value to indicate if the connection type is global. IsGlobal *bool `json:"isGlobal,omitempty"` // FieldDefinitions - Gets or sets the field definitions of the connection type. - FieldDefinitions *map[string]*FieldDefinition `json:"fieldDefinitions,omitempty"` + FieldDefinitions map[string]*FieldDefinition `json:"fieldDefinitions"` +} + +// MarshalJSON is the custom marshaler for ConnectionTypeCreateOrUpdateProperties. +func (ctcoup ConnectionTypeCreateOrUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ctcoup.IsGlobal != nil { + objectMap["isGlobal"] = ctcoup.IsGlobal + } + if ctcoup.FieldDefinitions != nil { + objectMap["fieldDefinitions"] = ctcoup.FieldDefinitions + } + return json.Marshal(objectMap) } // ConnectionTypeListResult the response model for the list connection type operation. @@ -1674,7 +1833,7 @@ type ConnectionTypeProperties struct { // IsGlobal - Gets or sets a Boolean value to indicate if the connection type is global. IsGlobal *bool `json:"isGlobal,omitempty"` // FieldDefinitions - Gets the field definitions of the connection type. - FieldDefinitions *map[string]*FieldDefinition `json:"fieldDefinitions,omitempty"` + FieldDefinitions map[string]*FieldDefinition `json:"fieldDefinitions"` // CreationTime - Gets the creation time. CreationTime *date.Time `json:"creationTime,omitempty"` // LastModifiedTime - Gets or sets the last modified time. @@ -1683,6 +1842,27 @@ type ConnectionTypeProperties struct { Description *string `json:"description,omitempty"` } +// MarshalJSON is the custom marshaler for ConnectionTypeProperties. +func (ctp ConnectionTypeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ctp.IsGlobal != nil { + objectMap["isGlobal"] = ctp.IsGlobal + } + if ctp.FieldDefinitions != nil { + objectMap["fieldDefinitions"] = ctp.FieldDefinitions + } + if ctp.CreationTime != nil { + objectMap["creationTime"] = ctp.CreationTime + } + if ctp.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = ctp.LastModifiedTime + } + if ctp.Description != nil { + objectMap["description"] = ctp.Description + } + return json.Marshal(objectMap) +} + // ConnectionUpdateParameters the parameters supplied to the update connection operation. type ConnectionUpdateParameters struct { // Name - Gets or sets the name of the connection. @@ -1698,26 +1878,27 @@ func (cup *ConnectionUpdateParameters) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - cup.Name = &name - } - - v = m["properties"] - if v != nil { - var properties ConnectionUpdateProperties - err = json.Unmarshal(*m["properties"], &properties) - 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 + } + cup.Name = &name + } + case "properties": + if v != nil { + var connectionUpdateProperties ConnectionUpdateProperties + err = json.Unmarshal(*v, &connectionUpdateProperties) + if err != nil { + return err + } + cup.ConnectionUpdateProperties = &connectionUpdateProperties + } } - cup.ConnectionUpdateProperties = &properties } return nil @@ -1728,7 +1909,19 @@ type ConnectionUpdateProperties struct { // Description - Gets or sets the description of the connection. Description *string `json:"description,omitempty"` // FieldDefinitionValues - Gets or sets the field definition values of the connection. - FieldDefinitionValues *map[string]*string `json:"fieldDefinitionValues,omitempty"` + FieldDefinitionValues map[string]*string `json:"fieldDefinitionValues"` +} + +// MarshalJSON is the custom marshaler for ConnectionUpdateProperties. +func (cup ConnectionUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cup.Description != nil { + objectMap["description"] = cup.Description + } + if cup.FieldDefinitionValues != nil { + objectMap["fieldDefinitionValues"] = cup.FieldDefinitionValues + } + return json.Marshal(objectMap) } // ContentHash definition of the runbook property type. @@ -1768,6 +1961,8 @@ type Credential struct { ID *string `json:"id,omitempty"` // Name - Gets the name of the credential. Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` // CredentialProperties - Gets or sets the properties of the credential. *CredentialProperties `json:"properties,omitempty"` } @@ -1779,36 +1974,45 @@ func (c *Credential) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - c.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - c.Name = &name - } - - v = m["properties"] - if v != nil { - var properties CredentialProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + c.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + c.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } + case "properties": + if v != nil { + var credentialProperties CredentialProperties + err = json.Unmarshal(*v, &credentialProperties) + if err != nil { + return err + } + c.CredentialProperties = &credentialProperties + } } - c.CredentialProperties = &properties } return nil @@ -1829,26 +2033,27 @@ func (ccoup *CredentialCreateOrUpdateParameters) UnmarshalJSON(body []byte) erro if err != nil { return err } - var v *json.RawMessage - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - ccoup.Name = &name - } - - v = m["properties"] - if v != nil { - var properties CredentialCreateOrUpdateProperties - err = json.Unmarshal(*m["properties"], &properties) - 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 + } + ccoup.Name = &name + } + case "properties": + if v != nil { + var credentialCreateOrUpdateProperties CredentialCreateOrUpdateProperties + err = json.Unmarshal(*v, &credentialCreateOrUpdateProperties) + if err != nil { + return err + } + ccoup.CredentialCreateOrUpdateProperties = &credentialCreateOrUpdateProperties + } } - ccoup.CredentialCreateOrUpdateProperties = &properties } return nil @@ -1993,26 +2198,27 @@ func (cup *CredentialUpdateParameters) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - cup.Name = &name - } - - v = m["properties"] - if v != nil { - var properties CredentialUpdateProperties - err = json.Unmarshal(*m["properties"], &properties) - 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 + } + cup.Name = &name + } + case "properties": + if v != nil { + var credentialUpdateProperties CredentialUpdateProperties + err = json.Unmarshal(*v, &credentialUpdateProperties) + if err != nil { + return err + } + cup.CredentialUpdateProperties = &credentialUpdateProperties + } } - cup.CredentialUpdateProperties = &properties } return nil @@ -2044,26 +2250,27 @@ func (dcj *DscCompilationJob) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - dcj.ID = &ID - } - - v = m["properties"] - if v != nil { - var properties DscCompilationJobProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dcj.ID = &ID + } + case "properties": + if v != nil { + var dscCompilationJobProperties DscCompilationJobProperties + err = json.Unmarshal(*v, &dscCompilationJobProperties) + if err != nil { + return err + } + dcj.DscCompilationJobProperties = &dscCompilationJobProperties + } } - dcj.DscCompilationJobProperties = &properties } return nil @@ -2078,7 +2285,25 @@ type DscCompilationJobCreateParameters struct { // Location - Gets or sets the location of the resource. Location *string `json:"location,omitempty"` // Tags - Gets or sets the tags attached to the resource. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DscCompilationJobCreateParameters. +func (dcjcp DscCompilationJobCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcjcp.DscCompilationJobCreateProperties != nil { + objectMap["properties"] = dcjcp.DscCompilationJobCreateProperties + } + if dcjcp.Name != nil { + objectMap["name"] = dcjcp.Name + } + if dcjcp.Location != nil { + objectMap["location"] = dcjcp.Location + } + if dcjcp.Tags != nil { + objectMap["tags"] = dcjcp.Tags + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for DscCompilationJobCreateParameters struct. @@ -2088,46 +2313,45 @@ func (dcjcp *DscCompilationJobCreateParameters) UnmarshalJSON(body []byte) error if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties DscCompilationJobCreateProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - dcjcp.DscCompilationJobCreateProperties = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - dcjcp.Name = &name - } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - dcjcp.Location = &location - } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dscCompilationJobCreateProperties DscCompilationJobCreateProperties + err = json.Unmarshal(*v, &dscCompilationJobCreateProperties) + if err != nil { + return err + } + dcjcp.DscCompilationJobCreateProperties = &dscCompilationJobCreateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dcjcp.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dcjcp.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dcjcp.Tags = tags + } } - dcjcp.Tags = &tags } return nil @@ -2138,11 +2362,26 @@ type DscCompilationJobCreateProperties struct { // Configuration - Gets or sets the configuration. Configuration *DscConfigurationAssociationProperty `json:"configuration,omitempty"` // Parameters - Gets or sets the parameters of the job. - Parameters *map[string]*string `json:"parameters,omitempty"` + Parameters map[string]*string `json:"parameters"` // NewNodeConfigurationBuildVersionRequired - If a new build version of NodeConfiguration is required. NewNodeConfigurationBuildVersionRequired *bool `json:"newNodeConfigurationBuildVersionRequired,omitempty"` } +// MarshalJSON is the custom marshaler for DscCompilationJobCreateProperties. +func (dcjcp DscCompilationJobCreateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcjcp.Configuration != nil { + objectMap["configuration"] = dcjcp.Configuration + } + if dcjcp.Parameters != nil { + objectMap["parameters"] = dcjcp.Parameters + } + if dcjcp.NewNodeConfigurationBuildVersionRequired != nil { + objectMap["newNodeConfigurationBuildVersionRequired"] = dcjcp.NewNodeConfigurationBuildVersionRequired + } + return json.Marshal(objectMap) +} + // DscCompilationJobListResult the response model for the list job operation. type DscCompilationJobListResult struct { autorest.Response `json:"-"` @@ -2270,105 +2509,168 @@ type DscCompilationJobProperties struct { // LastStatusModifiedTime - Gets the last status modified time of the job. LastStatusModifiedTime *date.Time `json:"lastStatusModifiedTime,omitempty"` // Parameters - Gets or sets the parameters of the job. - Parameters *map[string]*string `json:"parameters,omitempty"` + Parameters map[string]*string `json:"parameters"` } -// DscConfiguration definition of the configuration type. -type DscConfiguration struct { - autorest.Response `json:"-"` - // ID - Resource Id - ID *string `json:"id,omitempty"` - // Name - Resource name - Name *string `json:"name,omitempty"` - // Type - Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` +// MarshalJSON is the custom marshaler for DscCompilationJobProperties. +func (dcjp DscCompilationJobProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcjp.Configuration != nil { + objectMap["configuration"] = dcjp.Configuration + } + if dcjp.StartedBy != nil { + objectMap["startedBy"] = dcjp.StartedBy + } + if dcjp.JobID != nil { + objectMap["jobId"] = dcjp.JobID + } + if dcjp.CreationTime != nil { + objectMap["creationTime"] = dcjp.CreationTime + } + objectMap["status"] = dcjp.Status + if dcjp.StatusDetails != nil { + objectMap["statusDetails"] = dcjp.StatusDetails + } + if dcjp.StartTime != nil { + objectMap["startTime"] = dcjp.StartTime + } + if dcjp.EndTime != nil { + objectMap["endTime"] = dcjp.EndTime + } + if dcjp.Exception != nil { + objectMap["exception"] = dcjp.Exception + } + if dcjp.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = dcjp.LastModifiedTime + } + if dcjp.LastStatusModifiedTime != nil { + objectMap["lastStatusModifiedTime"] = dcjp.LastStatusModifiedTime + } + if dcjp.Parameters != nil { + objectMap["parameters"] = dcjp.Parameters + } + return json.Marshal(objectMap) +} + +// DscConfiguration definition of the configuration type. +type DscConfiguration struct { + autorest.Response `json:"-"` // DscConfigurationProperties - Gets or sets the configuration properties. *DscConfigurationProperties `json:"properties,omitempty"` // Etag - Gets or sets the etag of the resource. Etag *string `json:"etag,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` + // Name - Resource name + Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for DscConfiguration struct. -func (dc *DscConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for DscConfiguration. +func (dc DscConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dc.DscConfigurationProperties != nil { + objectMap["properties"] = dc.DscConfigurationProperties } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties DscConfigurationProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - dc.DscConfigurationProperties = &properties + if dc.Etag != nil { + objectMap["etag"] = dc.Etag } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - dc.Etag = &etag + if dc.ID != nil { + objectMap["id"] = dc.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - dc.ID = &ID + if dc.Name != nil { + objectMap["name"] = dc.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - dc.Name = &name + if dc.Type != nil { + objectMap["type"] = dc.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - dc.Type = &typeVar + if dc.Location != nil { + objectMap["location"] = dc.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - dc.Location = &location + if dc.Tags != nil { + objectMap["tags"] = dc.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for DscConfiguration struct. +func (dc *DscConfiguration) 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 "properties": + if v != nil { + var dscConfigurationProperties DscConfigurationProperties + err = json.Unmarshal(*v, &dscConfigurationProperties) + if err != nil { + return err + } + dc.DscConfigurationProperties = &dscConfigurationProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + dc.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dc.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dc.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dc.Tags = tags + } } - dc.Tags = &tags } return nil @@ -2380,7 +2682,8 @@ type DscConfigurationAssociationProperty struct { Name *string `json:"name,omitempty"` } -// DscConfigurationCreateOrUpdateParameters the parameters supplied to the create or update configuration operation. +// DscConfigurationCreateOrUpdateParameters the parameters supplied to the create or update configuration +// operation. type DscConfigurationCreateOrUpdateParameters struct { // DscConfigurationCreateOrUpdateProperties - Gets or sets configuration create or update properties. *DscConfigurationCreateOrUpdateProperties `json:"properties,omitempty"` @@ -2389,7 +2692,25 @@ type DscConfigurationCreateOrUpdateParameters struct { // Location - Gets or sets the location of the resource. Location *string `json:"location,omitempty"` // Tags - Gets or sets the tags attached to the resource. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DscConfigurationCreateOrUpdateParameters. +func (dccoup DscConfigurationCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dccoup.DscConfigurationCreateOrUpdateProperties != nil { + objectMap["properties"] = dccoup.DscConfigurationCreateOrUpdateProperties + } + if dccoup.Name != nil { + objectMap["name"] = dccoup.Name + } + if dccoup.Location != nil { + objectMap["location"] = dccoup.Location + } + if dccoup.Tags != nil { + objectMap["tags"] = dccoup.Tags + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for DscConfigurationCreateOrUpdateParameters struct. @@ -2399,46 +2720,45 @@ func (dccoup *DscConfigurationCreateOrUpdateParameters) UnmarshalJSON(body []byt if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties DscConfigurationCreateOrUpdateProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - dccoup.DscConfigurationCreateOrUpdateProperties = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - dccoup.Name = &name - } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - dccoup.Location = &location - } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dscConfigurationCreateOrUpdateProperties DscConfigurationCreateOrUpdateProperties + err = json.Unmarshal(*v, &dscConfigurationCreateOrUpdateProperties) + if err != nil { + return err + } + dccoup.DscConfigurationCreateOrUpdateProperties = &dscConfigurationCreateOrUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dccoup.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dccoup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dccoup.Tags = tags + } } - dccoup.Tags = &tags } return nil @@ -2453,11 +2773,32 @@ type DscConfigurationCreateOrUpdateProperties struct { // Source - Gets or sets the source. Source *ContentSource `json:"source,omitempty"` // Parameters - Gets or sets the configuration parameters. - Parameters *map[string]*DscConfigurationParameter `json:"parameters,omitempty"` + Parameters map[string]*DscConfigurationParameter `json:"parameters"` // Description - Gets or sets the description of the configuration. Description *string `json:"description,omitempty"` } +// MarshalJSON is the custom marshaler for DscConfigurationCreateOrUpdateProperties. +func (dccoup DscConfigurationCreateOrUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dccoup.LogVerbose != nil { + objectMap["logVerbose"] = dccoup.LogVerbose + } + if dccoup.LogProgress != nil { + objectMap["logProgress"] = dccoup.LogProgress + } + if dccoup.Source != nil { + objectMap["source"] = dccoup.Source + } + if dccoup.Parameters != nil { + objectMap["parameters"] = dccoup.Parameters + } + if dccoup.Description != nil { + objectMap["description"] = dccoup.Description + } + return json.Marshal(objectMap) +} + // DscConfigurationListResult the response model for the list configuration operation. type DscConfigurationListResult struct { autorest.Response `json:"-"` @@ -2579,7 +2920,7 @@ type DscConfigurationProperties struct { // JobCount - Gets or sets the job count of the configuration. JobCount *int32 `json:"jobCount,omitempty"` // Parameters - Gets or sets the configuration parameters. - Parameters *map[string]*DscConfigurationParameter `json:"parameters,omitempty"` + Parameters map[string]*DscConfigurationParameter `json:"parameters"` // Source - Gets or sets the source. Source *ContentSource `json:"source,omitempty"` // State - Gets or sets the state of the configuration. Possible values include: 'DscConfigurationStateNew', 'DscConfigurationStateEdit', 'DscConfigurationStatePublished' @@ -2594,6 +2935,35 @@ type DscConfigurationProperties struct { Description *string `json:"description,omitempty"` } +// MarshalJSON is the custom marshaler for DscConfigurationProperties. +func (dcp DscConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["provisioningState"] = dcp.ProvisioningState + if dcp.JobCount != nil { + objectMap["jobCount"] = dcp.JobCount + } + if dcp.Parameters != nil { + objectMap["parameters"] = dcp.Parameters + } + if dcp.Source != nil { + objectMap["source"] = dcp.Source + } + objectMap["state"] = dcp.State + if dcp.LogVerbose != nil { + objectMap["logVerbose"] = dcp.LogVerbose + } + if dcp.CreationTime != nil { + objectMap["creationTime"] = dcp.CreationTime + } + if dcp.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = dcp.LastModifiedTime + } + if dcp.Description != nil { + objectMap["description"] = dcp.Description + } + return json.Marshal(objectMap) +} + // DscMetaConfiguration definition of the DSC Meta Configuration. type DscMetaConfiguration struct { // ConfigurationModeFrequencyMins - Gets or sets the ConfigurationModeFrequencyMins value of the meta configuration. @@ -2615,16 +2985,6 @@ type DscMetaConfiguration struct { // DscNode definition of the dsc node type. type DscNode struct { autorest.Response `json:"-"` - // ID - Resource Id - ID *string `json:"id,omitempty"` - // Name - Resource name - Name *string `json:"name,omitempty"` - // Type - Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` // LastSeen - Gets or sets the last seen time of the node. LastSeen *date.Time `json:"lastSeen,omitempty"` // RegistrationTime - Gets or sets the registration time of the node. @@ -2643,6 +3003,64 @@ type DscNode struct { Etag *string `json:"etag,omitempty"` // ExtensionHandler - Gets or sets the list of extensionHandler properties for a Node. ExtensionHandler *[]DscNodeExtensionHandlerAssociationProperty `json:"extensionHandler,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` + // Name - Resource name + Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DscNode. +func (dn DscNode) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dn.LastSeen != nil { + objectMap["lastSeen"] = dn.LastSeen + } + if dn.RegistrationTime != nil { + objectMap["registrationTime"] = dn.RegistrationTime + } + if dn.IP != nil { + objectMap["ip"] = dn.IP + } + if dn.AccountID != nil { + objectMap["accountId"] = dn.AccountID + } + if dn.NodeConfiguration != nil { + objectMap["nodeConfiguration"] = dn.NodeConfiguration + } + if dn.Status != nil { + objectMap["status"] = dn.Status + } + if dn.NodeID != nil { + objectMap["nodeId"] = dn.NodeID + } + if dn.Etag != nil { + objectMap["etag"] = dn.Etag + } + if dn.ExtensionHandler != nil { + objectMap["extensionHandler"] = dn.ExtensionHandler + } + if dn.ID != nil { + objectMap["id"] = dn.ID + } + if dn.Name != nil { + objectMap["name"] = dn.Name + } + if dn.Type != nil { + objectMap["type"] = dn.Type + } + if dn.Location != nil { + objectMap["location"] = dn.Location + } + if dn.Tags != nil { + objectMap["tags"] = dn.Tags + } + return json.Marshal(objectMap) } // DscNodeConfiguration definition of the dsc node configuration. @@ -3256,26 +3674,27 @@ func (j *Job) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - j.ID = &ID - } - - v = m["properties"] - if v != nil { - var properties JobProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + j.ID = &ID + } + case "properties": + if v != nil { + var jobProperties JobProperties + err = json.Unmarshal(*v, &jobProperties) + if err != nil { + return err + } + j.JobProperties = &jobProperties + } } - j.JobProperties = &properties } return nil @@ -3290,7 +3709,25 @@ type JobCreateParameters struct { // Location - Gets or sets the location of the resource. Location *string `json:"location,omitempty"` // Tags - Gets or sets the tags attached to the resource. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for JobCreateParameters. +func (jcp JobCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jcp.JobCreateProperties != nil { + objectMap["properties"] = jcp.JobCreateProperties + } + if jcp.Name != nil { + objectMap["name"] = jcp.Name + } + if jcp.Location != nil { + objectMap["location"] = jcp.Location + } + if jcp.Tags != nil { + objectMap["tags"] = jcp.Tags + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for JobCreateParameters struct. @@ -3300,46 +3737,45 @@ func (jcp *JobCreateParameters) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties JobCreateProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - jcp.JobCreateProperties = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - jcp.Name = &name - } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - jcp.Location = &location - } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var jobCreateProperties JobCreateProperties + err = json.Unmarshal(*v, &jobCreateProperties) + if err != nil { + return err + } + jcp.JobCreateProperties = &jobCreateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + jcp.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + jcp.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + jcp.Tags = tags + } } - jcp.Tags = &tags } return nil @@ -3350,11 +3786,26 @@ type JobCreateProperties struct { // Runbook - Gets or sets the runbook. Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` // Parameters - Gets or sets the parameters of the job. - Parameters *map[string]*string `json:"parameters,omitempty"` + Parameters map[string]*string `json:"parameters"` // RunOn - Gets or sets the runOn which specifies the group name where the job is to be executed. RunOn *string `json:"runOn,omitempty"` } +// MarshalJSON is the custom marshaler for JobCreateProperties. +func (jcp JobCreateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jcp.Runbook != nil { + objectMap["runbook"] = jcp.Runbook + } + if jcp.Parameters != nil { + objectMap["parameters"] = jcp.Parameters + } + if jcp.RunOn != nil { + objectMap["runOn"] = jcp.RunOn + } + return json.Marshal(objectMap) +} + // JobListResult the response model for the list job operation. type JobListResult struct { autorest.Response `json:"-"` @@ -3484,14 +3935,61 @@ type JobProperties struct { // LastStatusModifiedTime - Gets or sets the last status modified time of the job. LastStatusModifiedTime *date.Time `json:"lastStatusModifiedTime,omitempty"` // Parameters - Gets or sets the parameters of the job. - Parameters *map[string]*string `json:"parameters,omitempty"` + Parameters map[string]*string `json:"parameters"` +} + +// MarshalJSON is the custom marshaler for JobProperties. +func (jp JobProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jp.Runbook != nil { + objectMap["runbook"] = jp.Runbook + } + if jp.StartedBy != nil { + objectMap["startedBy"] = jp.StartedBy + } + if jp.RunOn != nil { + objectMap["runOn"] = jp.RunOn + } + if jp.JobID != nil { + objectMap["jobId"] = jp.JobID + } + if jp.CreationTime != nil { + objectMap["creationTime"] = jp.CreationTime + } + objectMap["status"] = jp.Status + if jp.StatusDetails != nil { + objectMap["statusDetails"] = jp.StatusDetails + } + if jp.StartTime != nil { + objectMap["startTime"] = jp.StartTime + } + if jp.EndTime != nil { + objectMap["endTime"] = jp.EndTime + } + if jp.Exception != nil { + objectMap["exception"] = jp.Exception + } + if jp.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = jp.LastModifiedTime + } + if jp.LastStatusModifiedTime != nil { + objectMap["lastStatusModifiedTime"] = jp.LastStatusModifiedTime + } + if jp.Parameters != nil { + objectMap["parameters"] = jp.Parameters + } + return json.Marshal(objectMap) } // JobSchedule definition of the job schedule. type JobSchedule struct { autorest.Response `json:"-"` - // ID - Gets or sets the id of the resource. + // ID - Gets the id of the resource. ID *string `json:"id,omitempty"` + // Name - Gets the name of the variable. + Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` // JobScheduleProperties - Gets or sets the properties of the job schedule. *JobScheduleProperties `json:"properties,omitempty"` } @@ -3503,26 +4001,45 @@ func (js *JobSchedule) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - js.ID = &ID - } - - v = m["properties"] - if v != nil { - var properties JobScheduleProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + js.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + js.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + js.Type = &typeVar + } + case "properties": + if v != nil { + var jobScheduleProperties JobScheduleProperties + err = json.Unmarshal(*v, &jobScheduleProperties) + if err != nil { + return err + } + js.JobScheduleProperties = &jobScheduleProperties + } } - js.JobScheduleProperties = &properties } return nil @@ -3541,16 +4058,18 @@ func (jscp *JobScheduleCreateParameters) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties JobScheduleCreateProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var jobScheduleCreateProperties JobScheduleCreateProperties + err = json.Unmarshal(*v, &jobScheduleCreateProperties) + if err != nil { + return err + } + jscp.JobScheduleCreateProperties = &jobScheduleCreateProperties + } } - jscp.JobScheduleCreateProperties = &properties } return nil @@ -3565,7 +4084,25 @@ type JobScheduleCreateProperties struct { // RunOn - Gets or sets the hybrid worker group that the scheduled job should run on. RunOn *string `json:"runOn,omitempty"` // Parameters - Gets or sets a list of job properties. - Parameters *map[string]*string `json:"parameters,omitempty"` + Parameters map[string]*string `json:"parameters"` +} + +// MarshalJSON is the custom marshaler for JobScheduleCreateProperties. +func (jscp JobScheduleCreateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jscp.Schedule != nil { + objectMap["schedule"] = jscp.Schedule + } + if jscp.Runbook != nil { + objectMap["runbook"] = jscp.Runbook + } + if jscp.RunOn != nil { + objectMap["runOn"] = jscp.RunOn + } + if jscp.Parameters != nil { + objectMap["parameters"] = jscp.Parameters + } + return json.Marshal(objectMap) } // JobScheduleListResult the response model for the list job schedule operation. @@ -3681,7 +4218,28 @@ type JobScheduleProperties struct { // RunOn - Gets or sets the hybrid worker group that the scheduled job should run on. RunOn *string `json:"runOn,omitempty"` // Parameters - Gets or sets the parameters of the job schedule. - Parameters *map[string]*string `json:"parameters,omitempty"` + Parameters map[string]*string `json:"parameters"` +} + +// MarshalJSON is the custom marshaler for JobScheduleProperties. +func (jsp JobScheduleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jsp.JobScheduleID != nil { + objectMap["jobScheduleId"] = jsp.JobScheduleID + } + if jsp.Schedule != nil { + objectMap["schedule"] = jsp.Schedule + } + if jsp.Runbook != nil { + objectMap["runbook"] = jsp.Runbook + } + if jsp.RunOn != nil { + objectMap["runOn"] = jsp.RunOn + } + if jsp.Parameters != nil { + objectMap["parameters"] = jsp.Parameters + } + return json.Marshal(objectMap) } // JobStream definition of the job stream. @@ -3700,26 +4258,27 @@ func (js *JobStream) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - js.ID = &ID - } - - v = m["properties"] - if v != nil { - var properties JobStreamProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + js.ID = &ID + } + case "properties": + if v != nil { + var jobStreamProperties JobStreamProperties + err = json.Unmarshal(*v, &jobStreamProperties) + if err != nil { + return err + } + js.JobStreamProperties = &jobStreamProperties + } } - js.JobStreamProperties = &properties } return nil @@ -3840,12 +4399,38 @@ type JobStreamProperties struct { // Summary - Gets or sets the summary. Summary *string `json:"summary,omitempty"` // Value - Gets or sets the values of the job stream. - Value *map[string]*map[string]interface{} `json:"value,omitempty"` + Value map[string]interface{} `json:"value"` +} + +// MarshalJSON is the custom marshaler for JobStreamProperties. +func (jsp JobStreamProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jsp.JobStreamID != nil { + objectMap["jobStreamId"] = jsp.JobStreamID + } + if jsp.Time != nil { + objectMap["time"] = jsp.Time + } + objectMap["streamType"] = jsp.StreamType + if jsp.StreamText != nil { + objectMap["streamText"] = jsp.StreamText + } + if jsp.Summary != nil { + objectMap["summary"] = jsp.Summary + } + if jsp.Value != nil { + objectMap["value"] = jsp.Value + } + return json.Marshal(objectMap) } // Module definition of the module type. type Module struct { autorest.Response `json:"-"` + // ModuleProperties - Gets or sets the module properties. + *ModuleProperties `json:"properties,omitempty"` + // Etag - Gets or sets the etag of the resource. + Etag *string `json:"etag,omitempty"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name @@ -3855,90 +4440,109 @@ type Module struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - // ModuleProperties - Gets or sets the module properties. - *ModuleProperties `json:"properties,omitempty"` - // Etag - Gets or sets the etag of the resource. - Etag *string `json:"etag,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for Module struct. -func (mVar *Module) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for Module. +func (mVar Module) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mVar.ModuleProperties != nil { + objectMap["properties"] = mVar.ModuleProperties } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ModuleProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - mVar.ModuleProperties = &properties + if mVar.Etag != nil { + objectMap["etag"] = mVar.Etag } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - mVar.Etag = &etag + if mVar.ID != nil { + objectMap["id"] = mVar.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - mVar.ID = &ID + if mVar.Name != nil { + objectMap["name"] = mVar.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - mVar.Name = &name + if mVar.Type != nil { + objectMap["type"] = mVar.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - mVar.Type = &typeVar + if mVar.Location != nil { + objectMap["location"] = mVar.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - mVar.Location = &location + if mVar.Tags != nil { + objectMap["tags"] = mVar.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for Module struct. +func (mVar *Module) 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 "properties": + if v != nil { + var moduleProperties ModuleProperties + err = json.Unmarshal(*v, &moduleProperties) + if err != nil { + return err + } + mVar.ModuleProperties = &moduleProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + mVar.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mVar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mVar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mVar.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mVar.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mVar.Tags = tags + } } - mVar.Tags = &tags } return nil @@ -3953,56 +4557,73 @@ type ModuleCreateOrUpdateParameters struct { // Location - Gets or sets the location of the resource. Location *string `json:"location,omitempty"` // Tags - Gets or sets the tags attached to the resource. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for ModuleCreateOrUpdateParameters struct. +// MarshalJSON is the custom marshaler for ModuleCreateOrUpdateParameters. +func (mcoup ModuleCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcoup.ModuleCreateOrUpdateProperties != nil { + objectMap["properties"] = mcoup.ModuleCreateOrUpdateProperties + } + if mcoup.Name != nil { + objectMap["name"] = mcoup.Name + } + if mcoup.Location != nil { + objectMap["location"] = mcoup.Location + } + if mcoup.Tags != nil { + objectMap["tags"] = mcoup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ModuleCreateOrUpdateParameters struct. func (mcoup *ModuleCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ModuleCreateOrUpdateProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - mcoup.ModuleCreateOrUpdateProperties = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - mcoup.Name = &name - } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - mcoup.Location = &location - } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var moduleCreateOrUpdateProperties ModuleCreateOrUpdateProperties + err = json.Unmarshal(*v, &moduleCreateOrUpdateProperties) + if err != nil { + return err + } + mcoup.ModuleCreateOrUpdateProperties = &moduleCreateOrUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mcoup.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mcoup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mcoup.Tags = tags + } } - mcoup.Tags = &tags } return nil @@ -4157,7 +4778,25 @@ type ModuleUpdateParameters struct { // Location - Gets or sets the location of the resource. Location *string `json:"location,omitempty"` // Tags - Gets or sets the tags attached to the resource. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ModuleUpdateParameters. +func (mup ModuleUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mup.ModuleUpdateProperties != nil { + objectMap["properties"] = mup.ModuleUpdateProperties + } + if mup.Name != nil { + objectMap["name"] = mup.Name + } + if mup.Location != nil { + objectMap["location"] = mup.Location + } + if mup.Tags != nil { + objectMap["tags"] = mup.Tags + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ModuleUpdateParameters struct. @@ -4167,46 +4806,45 @@ func (mup *ModuleUpdateParameters) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ModuleUpdateProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var moduleUpdateProperties ModuleUpdateProperties + err = json.Unmarshal(*v, &moduleUpdateProperties) + if err != nil { + return err + } + mup.ModuleUpdateProperties = &moduleUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mup.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mup.Tags = tags + } } - mup.ModuleUpdateProperties = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - mup.Name = &name - } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - mup.Location = &location - } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - mup.Tags = &tags } return nil @@ -4260,7 +4898,28 @@ type Resource struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.ID != nil { + objectMap["id"] = r.ID + } + if r.Name != nil { + objectMap["name"] = r.Name + } + if r.Type != nil { + objectMap["type"] = r.Type + } + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) } // RunAsCredentialAssociationProperty definition of runas credential to use for hybrid worker. @@ -4272,6 +4931,10 @@ type RunAsCredentialAssociationProperty struct { // Runbook definition of the runbook type. type Runbook struct { autorest.Response `json:"-"` + // RunbookProperties - Gets or sets the runbook properties. + *RunbookProperties `json:"properties,omitempty"` + // Etag - Gets or sets the etag of the resource. + Etag *string `json:"etag,omitempty"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name @@ -4281,90 +4944,109 @@ type Runbook struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - // RunbookProperties - Gets or sets the runbook properties. - *RunbookProperties `json:"properties,omitempty"` - // Etag - Gets or sets the etag of the resource. - Etag *string `json:"etag,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for Runbook struct. -func (r *Runbook) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for Runbook. +func (r Runbook) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.RunbookProperties != nil { + objectMap["properties"] = r.RunbookProperties } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties RunbookProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - r.RunbookProperties = &properties + if r.Etag != nil { + objectMap["etag"] = r.Etag } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - r.Etag = &etag + if r.ID != nil { + objectMap["id"] = r.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - r.ID = &ID + if r.Name != nil { + objectMap["name"] = r.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - r.Name = &name + if r.Type != nil { + objectMap["type"] = r.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - r.Type = &typeVar + if r.Location != nil { + objectMap["location"] = r.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - r.Location = &location + if r.Tags != nil { + objectMap["tags"] = r.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for Runbook struct. +func (r *Runbook) 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 "properties": + if v != nil { + var runbookProperties RunbookProperties + err = json.Unmarshal(*v, &runbookProperties) + if err != nil { + return err + } + r.RunbookProperties = &runbookProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + r.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + r.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + r.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + r.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + r.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + r.Tags = tags + } } - r.Tags = &tags } return nil @@ -4407,7 +5089,25 @@ type RunbookCreateOrUpdateParameters struct { // Location - Gets or sets the location of the resource. Location *string `json:"location,omitempty"` // Tags - Gets or sets the tags attached to the resource. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for RunbookCreateOrUpdateParameters. +func (rcoup RunbookCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rcoup.RunbookCreateOrUpdateProperties != nil { + objectMap["properties"] = rcoup.RunbookCreateOrUpdateProperties + } + if rcoup.Name != nil { + objectMap["name"] = rcoup.Name + } + if rcoup.Location != nil { + objectMap["location"] = rcoup.Location + } + if rcoup.Tags != nil { + objectMap["tags"] = rcoup.Tags + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for RunbookCreateOrUpdateParameters struct. @@ -4417,46 +5117,45 @@ func (rcoup *RunbookCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties RunbookCreateOrUpdateProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - rcoup.RunbookCreateOrUpdateProperties = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var runbookCreateOrUpdateProperties RunbookCreateOrUpdateProperties + err = json.Unmarshal(*v, &runbookCreateOrUpdateProperties) + if err != nil { + return err + } + rcoup.RunbookCreateOrUpdateProperties = &runbookCreateOrUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rcoup.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rcoup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + rcoup.Tags = tags + } } - rcoup.Name = &name - } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - rcoup.Location = &location - } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - rcoup.Tags = &tags } return nil @@ -4492,11 +5191,35 @@ type RunbookDraft struct { // LastModifiedTime - Gets or sets the last modified time of the runbook draft. LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` // Parameters - Gets or sets the runbook draft parameters. - Parameters *map[string]*RunbookParameter `json:"parameters,omitempty"` + Parameters map[string]*RunbookParameter `json:"parameters"` // OutputTypes - Gets or sets the runbook output types. OutputTypes *[]string `json:"outputTypes,omitempty"` } +// MarshalJSON is the custom marshaler for RunbookDraft. +func (rd RunbookDraft) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rd.InEdit != nil { + objectMap["inEdit"] = rd.InEdit + } + if rd.DraftContentLink != nil { + objectMap["draftContentLink"] = rd.DraftContentLink + } + if rd.CreationTime != nil { + objectMap["creationTime"] = rd.CreationTime + } + if rd.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = rd.LastModifiedTime + } + if rd.Parameters != nil { + objectMap["parameters"] = rd.Parameters + } + if rd.OutputTypes != nil { + objectMap["outputTypes"] = rd.OutputTypes + } + return json.Marshal(objectMap) +} + // RunbookDraftCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type RunbookDraftCreateOrUpdateFuture struct { @@ -4510,22 +5233,39 @@ func (future RunbookDraftCreateOrUpdateFuture) Result(client RunbookDraftClient) var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("automation.RunbookDraftCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("automation.RunbookDraftCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } ar, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -4541,22 +5281,39 @@ func (future RunbookDraftPublishFuture) Result(client RunbookDraftClient) (r Run var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftPublishFuture", "Result", future.Response(), "Polling failure") return } if !done { - return r, autorest.NewError("automation.RunbookDraftPublishFuture", "Result", "asynchronous operation has not completed") + return r, azure.NewAsyncOpIncompleteError("automation.RunbookDraftPublishFuture") } if future.PollingMethod() == azure.PollingLocation { r, err = client.PublishResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftPublishFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftPublishFuture", "Result", resp, "Failure sending request") return } r, err = client.PublishResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftPublishFuture", "Result", resp, "Failure responding to request") + } return } @@ -4699,7 +5456,7 @@ type RunbookProperties struct { // JobCount - Gets or sets the job count of the runbook. JobCount *int32 `json:"jobCount,omitempty"` // Parameters - Gets or sets the runbook parameters. - Parameters *map[string]*RunbookParameter `json:"parameters,omitempty"` + Parameters map[string]*RunbookParameter `json:"parameters"` // OutputTypes - Gets or sets the runbook output types. OutputTypes *[]string `json:"outputTypes,omitempty"` // Draft - Gets or sets the draft runbook properties. @@ -4716,6 +5473,51 @@ type RunbookProperties struct { Description *string `json:"description,omitempty"` } +// MarshalJSON is the custom marshaler for RunbookProperties. +func (rp RunbookProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["runbookType"] = rp.RunbookType + if rp.PublishContentLink != nil { + objectMap["publishContentLink"] = rp.PublishContentLink + } + objectMap["state"] = rp.State + if rp.LogVerbose != nil { + objectMap["logVerbose"] = rp.LogVerbose + } + if rp.LogProgress != nil { + objectMap["logProgress"] = rp.LogProgress + } + if rp.LogActivityTrace != nil { + objectMap["logActivityTrace"] = rp.LogActivityTrace + } + if rp.JobCount != nil { + objectMap["jobCount"] = rp.JobCount + } + if rp.Parameters != nil { + objectMap["parameters"] = rp.Parameters + } + if rp.OutputTypes != nil { + objectMap["outputTypes"] = rp.OutputTypes + } + if rp.Draft != nil { + objectMap["draft"] = rp.Draft + } + objectMap["provisioningState"] = rp.ProvisioningState + if rp.LastModifiedBy != nil { + objectMap["lastModifiedBy"] = rp.LastModifiedBy + } + if rp.CreationTime != nil { + objectMap["creationTime"] = rp.CreationTime + } + if rp.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = rp.LastModifiedTime + } + if rp.Description != nil { + objectMap["description"] = rp.Description + } + return json.Marshal(objectMap) +} + // RunbookUpdateParameters the parameters supplied to the update runbook operation. type RunbookUpdateParameters struct { // RunbookUpdateProperties - Gets or sets the runbook update properties. @@ -4725,7 +5527,25 @@ type RunbookUpdateParameters struct { // Location - Gets or sets the location of the resource. Location *string `json:"location,omitempty"` // Tags - Gets or sets the tags attached to the resource. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for RunbookUpdateParameters. +func (rup RunbookUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rup.RunbookUpdateProperties != nil { + objectMap["properties"] = rup.RunbookUpdateProperties + } + if rup.Name != nil { + objectMap["name"] = rup.Name + } + if rup.Location != nil { + objectMap["location"] = rup.Location + } + if rup.Tags != nil { + objectMap["tags"] = rup.Tags + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for RunbookUpdateParameters struct. @@ -4735,46 +5555,45 @@ func (rup *RunbookUpdateParameters) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties RunbookUpdateProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - rup.RunbookUpdateProperties = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - rup.Name = &name - } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - rup.Location = &location - } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var runbookUpdateProperties RunbookUpdateProperties + err = json.Unmarshal(*v, &runbookUpdateProperties) + if err != nil { + return err + } + rup.RunbookUpdateProperties = &runbookUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rup.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + rup.Tags = tags + } } - rup.Tags = &tags } return nil @@ -4795,10 +5614,12 @@ type RunbookUpdateProperties struct { // Schedule definition of the schedule. type Schedule struct { autorest.Response `json:"-"` - // ID - Gets or sets the id of the resource. + // ID - Gets the id of the resource. ID *string `json:"id,omitempty"` - // Name - Gets or sets the name of the schedule. + // Name - Gets name of the schedule. Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` // ScheduleProperties - Gets or sets the properties of the schedule. *ScheduleProperties `json:"properties,omitempty"` } @@ -4810,36 +5631,45 @@ func (s *Schedule) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + s.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + s.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + s.Type = &typeVar + } + case "properties": + if v != nil { + var scheduleProperties ScheduleProperties + err = json.Unmarshal(*v, &scheduleProperties) + if err != nil { + return err + } + s.ScheduleProperties = &scheduleProperties + } } - s.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - s.Name = &name - } - - v = m["properties"] - if v != nil { - var properties ScheduleProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - s.ScheduleProperties = &properties } return nil @@ -4866,26 +5696,27 @@ func (scoup *ScheduleCreateOrUpdateParameters) UnmarshalJSON(body []byte) error if err != nil { return err } - var v *json.RawMessage - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - 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 + } + scoup.Name = &name + } + case "properties": + if v != nil { + var scheduleCreateOrUpdateProperties ScheduleCreateOrUpdateProperties + err = json.Unmarshal(*v, &scheduleCreateOrUpdateProperties) + if err != nil { + return err + } + scoup.ScheduleCreateOrUpdateProperties = &scheduleCreateOrUpdateProperties + } } - scoup.Name = &name - } - - v = m["properties"] - if v != nil { - var properties ScheduleCreateOrUpdateProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - scoup.ScheduleCreateOrUpdateProperties = &properties } return nil @@ -4900,7 +5731,7 @@ type ScheduleCreateOrUpdateProperties struct { // ExpiryTime - Gets or sets the end time of the schedule. ExpiryTime *date.Time `json:"expiryTime,omitempty"` // Interval - Gets or sets the interval of the schedule. - Interval *map[string]interface{} `json:"interval,omitempty"` + Interval interface{} `json:"interval,omitempty"` // Frequency - Possible values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month' Frequency ScheduleFrequency `json:"frequency,omitempty"` // TimeZone - Gets or sets the time zone of the schedule. @@ -5028,7 +5859,7 @@ type ScheduleProperties struct { // NextRunOffsetMinutes - Gets or sets the next run time's offset in minutes. NextRunOffsetMinutes *float64 `json:"nextRunOffsetMinutes,omitempty"` // Interval - Gets or sets the interval of the schedule. - Interval *map[string]interface{} `json:"interval,omitempty"` + Interval interface{} `json:"interval,omitempty"` // Frequency - Gets or sets the frequency of the schedule. Possible values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month' Frequency ScheduleFrequency `json:"frequency,omitempty"` // TimeZone - Gets or sets the time zone of the schedule. @@ -5058,26 +5889,27 @@ func (sup *ScheduleUpdateParameters) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - sup.Name = &name - } - - v = m["properties"] - if v != nil { - var properties ScheduleUpdateProperties - err = json.Unmarshal(*m["properties"], &properties) - 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 + } + sup.Name = &name + } + case "properties": + if v != nil { + var scheduleUpdateProperties ScheduleUpdateProperties + err = json.Unmarshal(*v, &scheduleUpdateProperties) + if err != nil { + return err + } + sup.ScheduleUpdateProperties = &scheduleUpdateProperties + } } - sup.ScheduleUpdateProperties = &properties } return nil @@ -5156,7 +5988,43 @@ type TestJob struct { // LastStatusModifiedTime - Gets or sets the last status modified time of the test job. LastStatusModifiedTime *date.Time `json:"lastStatusModifiedTime,omitempty"` // Parameters - Gets or sets the parameters of the test job. - Parameters *map[string]*string `json:"parameters,omitempty"` + Parameters map[string]*string `json:"parameters"` +} + +// MarshalJSON is the custom marshaler for TestJob. +func (tj TestJob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tj.CreationTime != nil { + objectMap["creationTime"] = tj.CreationTime + } + if tj.Status != nil { + objectMap["status"] = tj.Status + } + if tj.StatusDetails != nil { + objectMap["statusDetails"] = tj.StatusDetails + } + if tj.RunOn != nil { + objectMap["runOn"] = tj.RunOn + } + if tj.StartTime != nil { + objectMap["startTime"] = tj.StartTime + } + if tj.EndTime != nil { + objectMap["endTime"] = tj.EndTime + } + if tj.Exception != nil { + objectMap["exception"] = tj.Exception + } + if tj.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = tj.LastModifiedTime + } + if tj.LastStatusModifiedTime != nil { + objectMap["lastStatusModifiedTime"] = tj.LastStatusModifiedTime + } + if tj.Parameters != nil { + objectMap["parameters"] = tj.Parameters + } + return json.Marshal(objectMap) } // TestJobCreateParameters the parameters supplied to the create test job operation. @@ -5164,11 +6032,26 @@ type TestJobCreateParameters struct { // RunbookName - Gets or sets the runbook name. RunbookName *string `json:"runbookName,omitempty"` // Parameters - Gets or sets the parameters of the test job. - Parameters *map[string]*string `json:"parameters,omitempty"` + Parameters map[string]*string `json:"parameters"` // RunOn - Gets or sets the runOn which specifies the group name where the job is to be executed. RunOn *string `json:"runOn,omitempty"` } +// MarshalJSON is the custom marshaler for TestJobCreateParameters. +func (tjcp TestJobCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tjcp.RunbookName != nil { + objectMap["runbookName"] = tjcp.RunbookName + } + if tjcp.Parameters != nil { + objectMap["parameters"] = tjcp.Parameters + } + if tjcp.RunOn != nil { + objectMap["runOn"] = tjcp.RunOn + } + return json.Marshal(objectMap) +} + // TypeField information about a field of a type. type TypeField struct { // Name - Gets or sets the name of the field. @@ -5218,10 +6101,12 @@ type UsageListResult struct { // Variable definition of the varible. type Variable struct { autorest.Response `json:"-"` - // ID - Gets or sets the id of the resource. + // ID - Gets the id of the resource. ID *string `json:"id,omitempty"` - // Name - Gets or sets the name of the variable. + // Name - Gets the name of the variable. Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` // VariableProperties - Gets or sets the properties of the variable. *VariableProperties `json:"properties,omitempty"` } @@ -5233,36 +6118,45 @@ func (vVar *Variable) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - vVar.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - vVar.Name = &name - } - - v = m["properties"] - if v != nil { - var properties VariableProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vVar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vVar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vVar.Type = &typeVar + } + case "properties": + if v != nil { + var variableProperties VariableProperties + err = json.Unmarshal(*v, &variableProperties) + if err != nil { + return err + } + vVar.VariableProperties = &variableProperties + } } - vVar.VariableProperties = &properties } return nil @@ -5283,26 +6177,27 @@ func (vcoup *VariableCreateOrUpdateParameters) UnmarshalJSON(body []byte) error if err != nil { return err } - var v *json.RawMessage - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - 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 + } + vcoup.Name = &name + } + case "properties": + if v != nil { + var variableCreateOrUpdateProperties VariableCreateOrUpdateProperties + err = json.Unmarshal(*v, &variableCreateOrUpdateProperties) + if err != nil { + return err + } + vcoup.VariableCreateOrUpdateProperties = &variableCreateOrUpdateProperties + } } - vcoup.Name = &name - } - - v = m["properties"] - if v != nil { - var properties VariableCreateOrUpdateProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - vcoup.VariableCreateOrUpdateProperties = &properties } return nil @@ -5449,26 +6344,27 @@ func (vup *VariableUpdateParameters) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - vup.Name = &name - } - - v = m["properties"] - if v != nil { - var properties VariableUpdateProperties - err = json.Unmarshal(*m["properties"], &properties) - 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 + } + vup.Name = &name + } + case "properties": + if v != nil { + var variableUpdateProperties VariableUpdateProperties + err = json.Unmarshal(*v, &variableUpdateProperties) + if err != nil { + return err + } + vup.VariableUpdateProperties = &variableUpdateProperties + } } - vup.VariableUpdateProperties = &properties } return nil @@ -5500,36 +6396,36 @@ func (w *Webhook) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - w.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + w.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + w.Name = &name + } + case "properties": + if v != nil { + var webhookProperties WebhookProperties + err = json.Unmarshal(*v, &webhookProperties) + if err != nil { + return err + } + w.WebhookProperties = &webhookProperties + } } - w.Name = &name - } - - v = m["properties"] - if v != nil { - var properties WebhookProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - w.WebhookProperties = &properties } return nil @@ -5550,26 +6446,27 @@ func (wcoup *WebhookCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - 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 + } + wcoup.Name = &name + } + case "properties": + if v != nil { + var webhookCreateOrUpdateProperties WebhookCreateOrUpdateProperties + err = json.Unmarshal(*v, &webhookCreateOrUpdateProperties) + if err != nil { + return err + } + wcoup.WebhookCreateOrUpdateProperties = &webhookCreateOrUpdateProperties + } } - wcoup.Name = &name - } - - v = m["properties"] - if v != nil { - var properties WebhookCreateOrUpdateProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - wcoup.WebhookCreateOrUpdateProperties = &properties } return nil @@ -5584,13 +6481,37 @@ type WebhookCreateOrUpdateProperties struct { // ExpiryTime - Gets or sets the expiry time. ExpiryTime *date.Time `json:"expiryTime,omitempty"` // Parameters - Gets or sets the parameters of the job. - Parameters *map[string]*string `json:"parameters,omitempty"` + Parameters map[string]*string `json:"parameters"` // Runbook - Gets or sets the runbook. Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` // RunOn - Gets or sets the name of the hybrid worker group the webhook job will run on. RunOn *string `json:"runOn,omitempty"` } +// MarshalJSON is the custom marshaler for WebhookCreateOrUpdateProperties. +func (wcoup WebhookCreateOrUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wcoup.IsEnabled != nil { + objectMap["isEnabled"] = wcoup.IsEnabled + } + if wcoup.URI != nil { + objectMap["uri"] = wcoup.URI + } + if wcoup.ExpiryTime != nil { + objectMap["expiryTime"] = wcoup.ExpiryTime + } + if wcoup.Parameters != nil { + objectMap["parameters"] = wcoup.Parameters + } + if wcoup.Runbook != nil { + objectMap["runbook"] = wcoup.Runbook + } + if wcoup.RunOn != nil { + objectMap["runOn"] = wcoup.RunOn + } + return json.Marshal(objectMap) +} + // WebhookListResult the response model for the list webhook operation. type WebhookListResult struct { autorest.Response `json:"-"` @@ -5704,7 +6625,7 @@ type WebhookProperties struct { // LastInvokedTime - Gets or sets the last invoked time. LastInvokedTime *date.Time `json:"lastInvokedTime,omitempty"` // Parameters - Gets or sets the parameters of the job that is created when the webhook calls the runbook it is associated with. - Parameters *map[string]*string `json:"parameters,omitempty"` + Parameters map[string]*string `json:"parameters"` // Runbook - Gets or sets the runbook the webhook is associated with. Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` // RunOn - Gets or sets the name of the hybrid worker group the webhook job will run on. @@ -5717,6 +6638,42 @@ type WebhookProperties struct { Description *string `json:"description,omitempty"` } +// MarshalJSON is the custom marshaler for WebhookProperties. +func (wp WebhookProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wp.IsEnabled != nil { + objectMap["isEnabled"] = wp.IsEnabled + } + if wp.URI != nil { + objectMap["uri"] = wp.URI + } + if wp.ExpiryTime != nil { + objectMap["expiryTime"] = wp.ExpiryTime + } + if wp.LastInvokedTime != nil { + objectMap["lastInvokedTime"] = wp.LastInvokedTime + } + if wp.Parameters != nil { + objectMap["parameters"] = wp.Parameters + } + if wp.Runbook != nil { + objectMap["runbook"] = wp.Runbook + } + if wp.RunOn != nil { + objectMap["runOn"] = wp.RunOn + } + if wp.CreationTime != nil { + objectMap["creationTime"] = wp.CreationTime + } + if wp.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = wp.LastModifiedTime + } + if wp.Description != nil { + objectMap["description"] = wp.Description + } + return json.Marshal(objectMap) +} + // WebhookUpdateParameters the parameters supplied to the update webhook operation. type WebhookUpdateParameters struct { // Name - Gets or sets the name of the webhook. @@ -5732,26 +6689,27 @@ func (wup *WebhookUpdateParameters) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - 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 + } + wup.Name = &name + } + case "properties": + if v != nil { + var webhookUpdateProperties WebhookUpdateProperties + err = json.Unmarshal(*v, &webhookUpdateProperties) + if err != nil { + return err + } + wup.WebhookUpdateProperties = &webhookUpdateProperties + } } - wup.Name = &name - } - - v = m["properties"] - if v != nil { - var properties WebhookUpdateProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - wup.WebhookUpdateProperties = &properties } return nil @@ -5764,7 +6722,25 @@ type WebhookUpdateProperties struct { // RunOn - Gets or sets the name of the hybrid worker group the webhook job will run on. RunOn *string `json:"runOn,omitempty"` // Parameters - Gets or sets the parameters of the job. - Parameters *map[string]*string `json:"parameters,omitempty"` + Parameters map[string]*string `json:"parameters"` // Description - Gets or sets the description of the webhook. Description *string `json:"description,omitempty"` } + +// MarshalJSON is the custom marshaler for WebhookUpdateProperties. +func (wup WebhookUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wup.IsEnabled != nil { + objectMap["isEnabled"] = wup.IsEnabled + } + if wup.RunOn != nil { + objectMap["runOn"] = wup.RunOn + } + if wup.Parameters != nil { + objectMap["parameters"] = wup.Parameters + } + if wup.Description != nil { + objectMap["description"] = wup.Description + } + return json.Marshal(objectMap) +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/module.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/module.go index 973e6295f7d3..b7128066272a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/module.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/module.go @@ -42,8 +42,8 @@ func NewModuleClientWithBaseURI(baseURI string, subscriptionID string, resourceG // CreateOrUpdate create or Update the module identified by module name. // -// automationAccountName is the automation account name. moduleName is the name of module. parameters is the create or -// update parameters for module. +// automationAccountName is the automation account name. moduleName is the name of module. parameters is the create +// or update parameters for module. func (client ModuleClient) CreateOrUpdate(ctx context.Context, automationAccountName string, moduleName string, parameters ModuleCreateOrUpdateParameters) (result Module, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, @@ -57,7 +57,7 @@ func (client ModuleClient) CreateOrUpdate(ctx context.Context, automationAccount }}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.ModuleClient", "CreateOrUpdate") + return result, validation.NewError("automation.ModuleClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, automationAccountName, moduleName, parameters) @@ -132,7 +132,7 @@ func (client ModuleClient) Delete(ctx context.Context, automationAccountName str if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.ModuleClient", "Delete") + return result, validation.NewError("automation.ModuleClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, automationAccountName, moduleName) @@ -204,7 +204,7 @@ func (client ModuleClient) Get(ctx context.Context, automationAccountName string if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.ModuleClient", "Get") + return result, validation.NewError("automation.ModuleClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, automationAccountName, moduleName) @@ -277,7 +277,7 @@ func (client ModuleClient) ListByAutomationAccount(ctx context.Context, automati if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.ModuleClient", "ListByAutomationAccount") + return result, validation.NewError("automation.ModuleClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults @@ -378,7 +378,7 @@ func (client ModuleClient) Update(ctx context.Context, automationAccountName str if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.ModuleClient", "Update") + return result, validation.NewError("automation.ModuleClient", "Update", err.Error()) } req, err := client.UpdatePreparer(ctx, automationAccountName, moduleName, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/nodereports.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/nodereports.go index 81a7521af5dc..9d234bb8d989 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/nodereports.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/nodereports.go @@ -47,7 +47,7 @@ func (client NodeReportsClient) Get(ctx context.Context, automationAccountName s if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.NodeReportsClient", "Get") + return result, validation.NewError("automation.NodeReportsClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, automationAccountName, nodeID, reportID) @@ -121,7 +121,7 @@ func (client NodeReportsClient) GetContent(ctx context.Context, automationAccoun if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.NodeReportsClient", "GetContent") + return result, validation.NewError("automation.NodeReportsClient", "GetContent", err.Error()) } req, err := client.GetContentPreparer(ctx, automationAccountName, nodeID, reportID) @@ -195,7 +195,7 @@ func (client NodeReportsClient) ListByNode(ctx context.Context, automationAccoun if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.NodeReportsClient", "ListByNode") + return result, validation.NewError("automation.NodeReportsClient", "ListByNode", err.Error()) } result.fn = client.listByNodeNextResults diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/objectdatatypes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/objectdatatypes.go index 35deda6a2a13..79064f031ac2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/objectdatatypes.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/objectdatatypes.go @@ -48,7 +48,7 @@ func (client ObjectDataTypesClient) ListFieldsByModuleAndType(ctx context.Contex if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.ObjectDataTypesClient", "ListFieldsByModuleAndType") + return result, validation.NewError("automation.ObjectDataTypesClient", "ListFieldsByModuleAndType", err.Error()) } req, err := client.ListFieldsByModuleAndTypePreparer(ctx, automationAccountName, moduleName, typeName) @@ -122,7 +122,7 @@ func (client ObjectDataTypesClient) ListFieldsByType(ctx context.Context, automa if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.ObjectDataTypesClient", "ListFieldsByType") + return result, validation.NewError("automation.ObjectDataTypesClient", "ListFieldsByType", err.Error()) } req, err := client.ListFieldsByTypePreparer(ctx, automationAccountName, typeName) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/runbook.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/runbook.go index acead52cd9d4..51e5469f6ebc 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/runbook.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/runbook.go @@ -42,8 +42,8 @@ func NewRunbookClientWithBaseURI(baseURI string, subscriptionID string, resource // CreateOrUpdate create the runbook identified by runbook name. // -// automationAccountName is the automation account name. runbookName is the runbook name. parameters is the create or -// update parameters for runbook. Provide either content link for a published runbook or draft, not both. +// automationAccountName is the automation account name. runbookName is the runbook name. parameters is the create +// or update parameters for runbook. Provide either content link for a published runbook or draft, not both. func (client RunbookClient) CreateOrUpdate(ctx context.Context, automationAccountName string, runbookName string, parameters RunbookCreateOrUpdateParameters) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, @@ -65,7 +65,7 @@ func (client RunbookClient) CreateOrUpdate(ctx context.Context, automationAccoun }}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.RunbookClient", "CreateOrUpdate") + return result, validation.NewError("automation.RunbookClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, automationAccountName, runbookName, parameters) @@ -139,7 +139,7 @@ func (client RunbookClient) Delete(ctx context.Context, automationAccountName st if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.RunbookClient", "Delete") + return result, validation.NewError("automation.RunbookClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, automationAccountName, runbookName) @@ -211,7 +211,7 @@ func (client RunbookClient) Get(ctx context.Context, automationAccountName strin if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.RunbookClient", "Get") + return result, validation.NewError("automation.RunbookClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, automationAccountName, runbookName) @@ -284,7 +284,7 @@ func (client RunbookClient) GetContent(ctx context.Context, automationAccountNam if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.RunbookClient", "GetContent") + return result, validation.NewError("automation.RunbookClient", "GetContent", err.Error()) } req, err := client.GetContentPreparer(ctx, automationAccountName, runbookName) @@ -356,7 +356,7 @@ func (client RunbookClient) ListByAutomationAccount(ctx context.Context, automat if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.RunbookClient", "ListByAutomationAccount") + return result, validation.NewError("automation.RunbookClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults @@ -457,7 +457,7 @@ func (client RunbookClient) Update(ctx context.Context, automationAccountName st if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.RunbookClient", "Update") + return result, validation.NewError("automation.RunbookClient", "Update", err.Error()) } req, err := client.UpdatePreparer(ctx, automationAccountName, runbookName, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/runbookdraft.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/runbookdraft.go index d5d8163374d1..036559f4b915 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/runbookdraft.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/runbookdraft.go @@ -43,14 +43,14 @@ func NewRunbookDraftClientWithBaseURI(baseURI string, subscriptionID string, res // CreateOrUpdate updates the runbook draft with runbookStream as its content. // -// automationAccountName is the automation account name. runbookName is the runbook name. runbookContent is the runbook -// draft content. runbookContent will be closed upon successful return. Callers should ensure closure when receiving an -// error. +// automationAccountName is the automation account name. runbookName is the runbook name. runbookContent is the +// runbook draft content. runbookContent will be closed upon successful return. Callers should ensure closure when +// receiving an error. func (client RunbookDraftClient) CreateOrUpdate(ctx context.Context, automationAccountName string, runbookName string, runbookContent io.ReadCloser) (result RunbookDraftCreateOrUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.RunbookDraftClient", "CreateOrUpdate") + return result, validation.NewError("automation.RunbookDraftClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, automationAccountName, runbookName, runbookContent) @@ -83,6 +83,7 @@ func (client RunbookDraftClient) CreateOrUpdatePreparer(ctx context.Context, aut } preparer := autorest.CreatePreparer( + autorest.AsOctetStream(), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content", pathParameters), @@ -125,7 +126,7 @@ func (client RunbookDraftClient) Get(ctx context.Context, automationAccountName if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.RunbookDraftClient", "Get") + return result, validation.NewError("automation.RunbookDraftClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, automationAccountName, runbookName) @@ -198,7 +199,7 @@ func (client RunbookDraftClient) GetContent(ctx context.Context, automationAccou if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.RunbookDraftClient", "GetContent") + return result, validation.NewError("automation.RunbookDraftClient", "GetContent", err.Error()) } req, err := client.GetContentPreparer(ctx, automationAccountName, runbookName) @@ -265,13 +266,13 @@ func (client RunbookDraftClient) GetContentResponder(resp *http.Response) (resul // Publish publish runbook draft. // -// automationAccountName is the automation account name. runbookName is the parameters supplied to the publish runbook -// operation. +// automationAccountName is the automation account name. runbookName is the parameters supplied to the publish +// runbook operation. func (client RunbookDraftClient) Publish(ctx context.Context, automationAccountName string, runbookName string) (result RunbookDraftPublishFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.RunbookDraftClient", "Publish") + return result, validation.NewError("automation.RunbookDraftClient", "Publish", err.Error()) } req, err := client.PublishPreparer(ctx, automationAccountName, runbookName) @@ -346,7 +347,7 @@ func (client RunbookDraftClient) UndoEdit(ctx context.Context, automationAccount if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.RunbookDraftClient", "UndoEdit") + return result, validation.NewError("automation.RunbookDraftClient", "UndoEdit", err.Error()) } req, err := client.UndoEditPreparer(ctx, automationAccountName, runbookName) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/schedule.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/schedule.go index fdd00c4793dc..3ad3bb265793 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/schedule.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/schedule.go @@ -52,7 +52,7 @@ func (client ScheduleClient) CreateOrUpdate(ctx context.Context, automationAccou Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.ScheduleCreateOrUpdateProperties", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.ScheduleCreateOrUpdateProperties.StartTime", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.ScheduleClient", "CreateOrUpdate") + return result, validation.NewError("automation.ScheduleClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, automationAccountName, scheduleName, parameters) @@ -127,7 +127,7 @@ func (client ScheduleClient) Delete(ctx context.Context, automationAccountName s if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.ScheduleClient", "Delete") + return result, validation.NewError("automation.ScheduleClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, automationAccountName, scheduleName) @@ -199,7 +199,7 @@ func (client ScheduleClient) Get(ctx context.Context, automationAccountName stri if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.ScheduleClient", "Get") + return result, validation.NewError("automation.ScheduleClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, automationAccountName, scheduleName) @@ -272,7 +272,7 @@ func (client ScheduleClient) ListByAutomationAccount(ctx context.Context, automa if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.ScheduleClient", "ListByAutomationAccount") + return result, validation.NewError("automation.ScheduleClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults @@ -373,7 +373,7 @@ func (client ScheduleClient) Update(ctx context.Context, automationAccountName s if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.ScheduleClient", "Update") + return result, validation.NewError("automation.ScheduleClient", "Update", err.Error()) } req, err := client.UpdatePreparer(ctx, automationAccountName, scheduleName, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/statistics.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/statistics.go index 16fdd5f85b92..f60511847be2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/statistics.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/statistics.go @@ -42,13 +42,13 @@ func NewStatisticsClientWithBaseURI(baseURI string, subscriptionID string, resou // ListByAutomationAccount retrieve the statistics for the account. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. filter is the -// filter to apply on the operation. +// resourceGroupName is the resource group name. automationAccountName is the automation account name. filter is +// the filter to apply on the operation. func (client StatisticsClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result StatisticsListResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.StatisticsClient", "ListByAutomationAccount") + return result, validation.NewError("automation.StatisticsClient", "ListByAutomationAccount", err.Error()) } req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/testjobs.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/testjobs.go index 17d11ca09edc..0d78385ab122 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/testjobs.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/testjobs.go @@ -42,15 +42,15 @@ func NewTestJobsClientWithBaseURI(baseURI string, subscriptionID string, resourc // Create create a test job of the runbook. // -// automationAccountName is the automation account name. runbookName is the parameters supplied to the create test job -// operation. parameters is the parameters supplied to the create test job operation. +// automationAccountName is the automation account name. runbookName is the parameters supplied to the create test +// job operation. parameters is the parameters supplied to the create test job operation. func (client TestJobsClient) Create(ctx context.Context, automationAccountName string, runbookName string, parameters TestJobCreateParameters) (result TestJob, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.RunbookName", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.TestJobsClient", "Create") + return result, validation.NewError("automation.TestJobsClient", "Create", err.Error()) } req, err := client.CreatePreparer(ctx, automationAccountName, runbookName, parameters) @@ -125,7 +125,7 @@ func (client TestJobsClient) Get(ctx context.Context, automationAccountName stri if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.TestJobsClient", "Get") + return result, validation.NewError("automation.TestJobsClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, automationAccountName, runbookName) @@ -198,7 +198,7 @@ func (client TestJobsClient) Resume(ctx context.Context, automationAccountName s if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.TestJobsClient", "Resume") + return result, validation.NewError("automation.TestJobsClient", "Resume", err.Error()) } req, err := client.ResumePreparer(ctx, automationAccountName, runbookName) @@ -270,7 +270,7 @@ func (client TestJobsClient) Stop(ctx context.Context, automationAccountName str if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.TestJobsClient", "Stop") + return result, validation.NewError("automation.TestJobsClient", "Stop", err.Error()) } req, err := client.StopPreparer(ctx, automationAccountName, runbookName) @@ -342,7 +342,7 @@ func (client TestJobsClient) Suspend(ctx context.Context, automationAccountName if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.TestJobsClient", "Suspend") + return result, validation.NewError("automation.TestJobsClient", "Suspend", err.Error()) } req, err := client.SuspendPreparer(ctx, automationAccountName, runbookName) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/testjobstreams.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/testjobstreams.go index 36e94ffea401..3b288841698d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/testjobstreams.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/testjobstreams.go @@ -42,13 +42,13 @@ func NewTestJobStreamsClientWithBaseURI(baseURI string, subscriptionID string, r // Get retrieve a test job streams identified by runbook name and stream id. // -// automationAccountName is the automation account name. runbookName is the runbook name. jobStreamID is the job stream -// id. +// automationAccountName is the automation account name. runbookName is the runbook name. jobStreamID is the job +// stream id. func (client TestJobStreamsClient) Get(ctx context.Context, automationAccountName string, runbookName string, jobStreamID string) (result JobStream, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.TestJobStreamsClient", "Get") + return result, validation.NewError("automation.TestJobStreamsClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, automationAccountName, runbookName, jobStreamID) @@ -117,13 +117,13 @@ func (client TestJobStreamsClient) GetResponder(resp *http.Response) (result Job // ListByTestJob retrieve a list of test job streams identified by runbook name. // -// automationAccountName is the automation account name. runbookName is the runbook name. filter is the filter to apply -// on the operation. +// automationAccountName is the automation account name. runbookName is the runbook name. filter is the filter to +// apply on the operation. func (client TestJobStreamsClient) ListByTestJob(ctx context.Context, automationAccountName string, runbookName string, filter string) (result JobStreamListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.TestJobStreamsClient", "ListByTestJob") + return result, validation.NewError("automation.TestJobStreamsClient", "ListByTestJob", err.Error()) } result.fn = client.listByTestJobNextResults diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/usages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/usages.go index fa1bc1aab84f..51382ba0f0d3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/usages.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/usages.go @@ -47,7 +47,7 @@ func (client UsagesClient) ListByAutomationAccount(ctx context.Context, resource if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.UsagesClient", "ListByAutomationAccount") + return result, validation.NewError("automation.UsagesClient", "ListByAutomationAccount", err.Error()) } req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/variable.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/variable.go index 313e8f194e1d..4751a38465d5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/variable.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/variable.go @@ -51,7 +51,7 @@ func (client VariableClient) CreateOrUpdate(ctx context.Context, automationAccou {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.VariableCreateOrUpdateProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.VariableClient", "CreateOrUpdate") + return result, validation.NewError("automation.VariableClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, automationAccountName, variableName, parameters) @@ -126,7 +126,7 @@ func (client VariableClient) Delete(ctx context.Context, automationAccountName s if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.VariableClient", "Delete") + return result, validation.NewError("automation.VariableClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, automationAccountName, variableName) @@ -198,7 +198,7 @@ func (client VariableClient) Get(ctx context.Context, automationAccountName stri if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.VariableClient", "Get") + return result, validation.NewError("automation.VariableClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, automationAccountName, variableName) @@ -271,7 +271,7 @@ func (client VariableClient) ListByAutomationAccount(ctx context.Context, automa if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.VariableClient", "ListByAutomationAccount") + return result, validation.NewError("automation.VariableClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults @@ -372,7 +372,7 @@ func (client VariableClient) Update(ctx context.Context, automationAccountName s if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.VariableClient", "Update") + return result, validation.NewError("automation.VariableClient", "Update", err.Error()) } req, err := client.UpdatePreparer(ctx, automationAccountName, variableName, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/version.go index 238be6ca7270..3b1202b345aa 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/version.go @@ -1,5 +1,7 @@ package automation +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package automation // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta services" + return "Azure-SDK-For-Go/" + version.Number + " automation/2015-10-31" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/webhook.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/webhook.go index 3f49a2e3bd90..84f4a732659a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/webhook.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/webhook.go @@ -42,8 +42,8 @@ func NewWebhookClientWithBaseURI(baseURI string, subscriptionID string, resource // CreateOrUpdate create the webhook identified by webhook name. // -// automationAccountName is the automation account name. webhookName is the webhook name. parameters is the create or -// update parameters for webhook. +// automationAccountName is the automation account name. webhookName is the webhook name. parameters is the create +// or update parameters for webhook. func (client WebhookClient) CreateOrUpdate(ctx context.Context, automationAccountName string, webhookName string, parameters WebhookCreateOrUpdateParameters) (result Webhook, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, @@ -51,7 +51,7 @@ func (client WebhookClient) CreateOrUpdate(ctx context.Context, automationAccoun {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.WebhookCreateOrUpdateProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.WebhookClient", "CreateOrUpdate") + return result, validation.NewError("automation.WebhookClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, automationAccountName, webhookName, parameters) @@ -126,7 +126,7 @@ func (client WebhookClient) Delete(ctx context.Context, automationAccountName st if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.WebhookClient", "Delete") + return result, validation.NewError("automation.WebhookClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, automationAccountName, webhookName) @@ -198,7 +198,7 @@ func (client WebhookClient) GenerateURI(ctx context.Context, automationAccountNa if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.WebhookClient", "GenerateURI") + return result, validation.NewError("automation.WebhookClient", "GenerateURI", err.Error()) } req, err := client.GenerateURIPreparer(ctx, automationAccountName) @@ -270,7 +270,7 @@ func (client WebhookClient) Get(ctx context.Context, automationAccountName strin if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.WebhookClient", "Get") + return result, validation.NewError("automation.WebhookClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, automationAccountName, webhookName) @@ -343,7 +343,7 @@ func (client WebhookClient) ListByAutomationAccount(ctx context.Context, automat if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.WebhookClient", "ListByAutomationAccount") + return result, validation.NewError("automation.WebhookClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults @@ -447,7 +447,7 @@ func (client WebhookClient) Update(ctx context.Context, automationAccountName st if err := validation.Validate([]validation.Validation{ {TargetValue: client.ResourceGroupName, Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.WebhookClient", "Update") + return result, validation.NewError("automation.WebhookClient", "Update", err.Error()) } req, err := client.UpdatePreparer(ctx, automationAccountName, webhookName, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2017-04-02/cdn/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2017-04-02/cdn/client.go index b10e39b24b46..8920d8e150ce 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2017-04-02/cdn/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2017-04-02/cdn/client.go @@ -64,7 +64,7 @@ func (client BaseClient) CheckNameAvailability(ctx context.Context, checkNameAva {TargetValue: checkNameAvailabilityInput, Constraints: []validation.Constraint{{Target: "checkNameAvailabilityInput.Name", Name: validation.Null, Rule: true, Chain: nil}, {Target: "checkNameAvailabilityInput.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "cdn.BaseClient", "CheckNameAvailability") + return result, validation.NewError("cdn.BaseClient", "CheckNameAvailability", err.Error()) } req, err := client.CheckNameAvailabilityPreparer(ctx, checkNameAvailabilityInput) @@ -134,7 +134,7 @@ func (client BaseClient) ValidateProbe(ctx context.Context, validateProbeInput V if err := validation.Validate([]validation.Validation{ {TargetValue: validateProbeInput, Constraints: []validation.Constraint{{Target: "validateProbeInput.ProbeURL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "cdn.BaseClient", "ValidateProbe") + return result, validation.NewError("cdn.BaseClient", "ValidateProbe", err.Error()) } req, err := client.ValidateProbePreparer(ctx, validateProbeInput) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2017-04-02/cdn/customdomains.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2017-04-02/cdn/customdomains.go index ac7eb80b676f..61592dbff48a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2017-04-02/cdn/customdomains.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2017-04-02/cdn/customdomains.go @@ -44,8 +44,8 @@ func NewCustomDomainsClientWithBaseURI(baseURI string, subscriptionID string) Cu // Create creates a new custom domain within an endpoint. // // resourceGroupName is name of the Resource group within the Azure subscription. profileName is name of the CDN -// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which is -// unique globally. customDomainName is name of the custom domain within an endpoint. customDomainProperties is +// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which +// is unique globally. customDomainName is name of the custom domain within an endpoint. customDomainProperties is // properties required to create a new custom domain. func (client CustomDomainsClient) Create(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainProperties CustomDomainParameters) (result CustomDomainsCreateFuture, err error) { if err := validation.Validate([]validation.Validation{ @@ -56,7 +56,7 @@ func (client CustomDomainsClient) Create(ctx context.Context, resourceGroupName {TargetValue: customDomainProperties, Constraints: []validation.Constraint{{Target: "customDomainProperties.CustomDomainPropertiesParameters", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "customDomainProperties.CustomDomainPropertiesParameters.HostName", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "cdn.CustomDomainsClient", "Create") + return result, validation.NewError("cdn.CustomDomainsClient", "Create", err.Error()) } req, err := client.CreatePreparer(ctx, resourceGroupName, profileName, endpointName, customDomainName, customDomainProperties) @@ -130,15 +130,15 @@ func (client CustomDomainsClient) CreateResponder(resp *http.Response) (result C // Delete deletes an existing custom domain within an endpoint. // // resourceGroupName is name of the Resource group within the Azure subscription. profileName is name of the CDN -// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which is -// unique globally. customDomainName is name of the custom domain within an endpoint. +// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which +// is unique globally. customDomainName is name of the custom domain within an endpoint. func (client CustomDomainsClient) Delete(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result CustomDomainsDeleteFuture, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "cdn.CustomDomainsClient", "Delete") + return result, validation.NewError("cdn.CustomDomainsClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, profileName, endpointName, customDomainName) @@ -210,15 +210,15 @@ func (client CustomDomainsClient) DeleteResponder(resp *http.Response) (result C // DisableCustomHTTPS disable https delivery of the custom domain. // // resourceGroupName is name of the Resource group within the Azure subscription. profileName is name of the CDN -// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which is -// unique globally. customDomainName is name of the custom domain within an endpoint. +// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which +// is unique globally. customDomainName is name of the custom domain within an endpoint. func (client CustomDomainsClient) DisableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result CustomDomain, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "cdn.CustomDomainsClient", "DisableCustomHTTPS") + return result, validation.NewError("cdn.CustomDomainsClient", "DisableCustomHTTPS", err.Error()) } req, err := client.DisableCustomHTTPSPreparer(ctx, resourceGroupName, profileName, endpointName, customDomainName) @@ -288,15 +288,15 @@ func (client CustomDomainsClient) DisableCustomHTTPSResponder(resp *http.Respons // EnableCustomHTTPS enable https delivery of the custom domain. // // resourceGroupName is name of the Resource group within the Azure subscription. profileName is name of the CDN -// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which is -// unique globally. customDomainName is name of the custom domain within an endpoint. +// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which +// is unique globally. customDomainName is name of the custom domain within an endpoint. func (client CustomDomainsClient) EnableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result CustomDomain, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "cdn.CustomDomainsClient", "EnableCustomHTTPS") + return result, validation.NewError("cdn.CustomDomainsClient", "EnableCustomHTTPS", err.Error()) } req, err := client.EnableCustomHTTPSPreparer(ctx, resourceGroupName, profileName, endpointName, customDomainName) @@ -366,15 +366,15 @@ func (client CustomDomainsClient) EnableCustomHTTPSResponder(resp *http.Response // Get gets an exisitng custom domain within an endpoint. // // resourceGroupName is name of the Resource group within the Azure subscription. profileName is name of the CDN -// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which is -// unique globally. customDomainName is name of the custom domain within an endpoint. +// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which +// is unique globally. customDomainName is name of the custom domain within an endpoint. func (client CustomDomainsClient) Get(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result CustomDomain, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "cdn.CustomDomainsClient", "Get") + return result, validation.NewError("cdn.CustomDomainsClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, profileName, endpointName, customDomainName) @@ -444,15 +444,15 @@ func (client CustomDomainsClient) GetResponder(resp *http.Response) (result Cust // ListByEndpoint lists all of the existing custom domains within an endpoint. // // resourceGroupName is name of the Resource group within the Azure subscription. profileName is name of the CDN -// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which is -// unique globally. +// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which +// is unique globally. func (client CustomDomainsClient) ListByEndpoint(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result CustomDomainListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "cdn.CustomDomainsClient", "ListByEndpoint") + return result, validation.NewError("cdn.CustomDomainsClient", "ListByEndpoint", err.Error()) } result.fn = client.listByEndpointNextResults diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2017-04-02/cdn/endpoints.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2017-04-02/cdn/endpoints.go index d7099376a5ce..cfcbf5a349f1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2017-04-02/cdn/endpoints.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2017-04-02/cdn/endpoints.go @@ -45,8 +45,8 @@ func NewEndpointsClientWithBaseURI(baseURI string, subscriptionID string) Endpoi // and profile. // // resourceGroupName is name of the Resource group within the Azure subscription. profileName is name of the CDN -// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which is -// unique globally. endpoint is endpoint properties +// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which +// is unique globally. endpoint is endpoint properties func (client EndpointsClient) Create(ctx context.Context, resourceGroupName string, profileName string, endpointName string, endpoint Endpoint) (result EndpointsCreateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -56,7 +56,7 @@ func (client EndpointsClient) Create(ctx context.Context, resourceGroupName stri {TargetValue: endpoint, Constraints: []validation.Constraint{{Target: "endpoint.EndpointProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "endpoint.EndpointProperties.Origins", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "cdn.EndpointsClient", "Create") + return result, validation.NewError("cdn.EndpointsClient", "Create", err.Error()) } req, err := client.CreatePreparer(ctx, resourceGroupName, profileName, endpointName, endpoint) @@ -130,15 +130,15 @@ func (client EndpointsClient) CreateResponder(resp *http.Response) (result Endpo // group and profile. // // resourceGroupName is name of the Resource group within the Azure subscription. profileName is name of the CDN -// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which is -// unique globally. +// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which +// is unique globally. func (client EndpointsClient) Delete(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result EndpointsDeleteFuture, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "cdn.EndpointsClient", "Delete") + return result, validation.NewError("cdn.EndpointsClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, profileName, endpointName) @@ -209,15 +209,15 @@ func (client EndpointsClient) DeleteResponder(resp *http.Response) (result autor // and profile. // // resourceGroupName is name of the Resource group within the Azure subscription. profileName is name of the CDN -// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which is -// unique globally. +// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which +// is unique globally. func (client EndpointsClient) Get(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result Endpoint, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "cdn.EndpointsClient", "Get") + return result, validation.NewError("cdn.EndpointsClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, profileName, endpointName) @@ -293,7 +293,7 @@ func (client EndpointsClient) ListByProfile(ctx context.Context, resourceGroupNa 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.NewErrorWithValidationError(err, "cdn.EndpointsClient", "ListByProfile") + return result, validation.NewError("cdn.EndpointsClient", "ListByProfile", err.Error()) } result.fn = client.listByProfileNextResults @@ -389,15 +389,15 @@ func (client EndpointsClient) ListByProfileComplete(ctx context.Context, resourc // ListResourceUsage checks the quota and usage of geo filters and custom domains under the given endpoint. // // resourceGroupName is name of the Resource group within the Azure subscription. profileName is name of the CDN -// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which is -// unique globally. +// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which +// is unique globally. func (client EndpointsClient) ListResourceUsage(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result ResourceUsageListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "cdn.EndpointsClient", "ListResourceUsage") + return result, validation.NewError("cdn.EndpointsClient", "ListResourceUsage", err.Error()) } result.fn = client.listResourceUsageNextResults @@ -494,8 +494,8 @@ func (client EndpointsClient) ListResourceUsageComplete(ctx context.Context, res // LoadContent pre-loads a content to CDN. Available for Verizon Profiles. // // resourceGroupName is name of the Resource group within the Azure subscription. profileName is name of the CDN -// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which is -// unique globally. contentFilePaths is the path to the content to be loaded. Path should be a full URL, e.g. +// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which +// is unique globally. contentFilePaths is the path to the content to be loaded. Path should be a full URL, e.g. // ‘/pictires/city.png' which loads a single file func (client EndpointsClient) LoadContent(ctx context.Context, resourceGroupName string, profileName string, endpointName string, contentFilePaths LoadParameters) (result EndpointsLoadContentFuture, err error) { if err := validation.Validate([]validation.Validation{ @@ -505,7 +505,7 @@ func (client EndpointsClient) LoadContent(ctx context.Context, resourceGroupName {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, {TargetValue: contentFilePaths, Constraints: []validation.Constraint{{Target: "contentFilePaths.ContentPaths", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "cdn.EndpointsClient", "LoadContent") + return result, validation.NewError("cdn.EndpointsClient", "LoadContent", err.Error()) } req, err := client.LoadContentPreparer(ctx, resourceGroupName, profileName, endpointName, contentFilePaths) @@ -577,10 +577,10 @@ func (client EndpointsClient) LoadContentResponder(resp *http.Response) (result // PurgeContent removes a content from CDN. // // resourceGroupName is name of the Resource group within the Azure subscription. profileName is name of the CDN -// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which is -// unique globally. contentFilePaths is the path to the content to be purged. Path can be a full URL, e.g. -// '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes -// all folders and files in the directory. +// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which +// is unique globally. contentFilePaths is the path to the content to be purged. Path can be a full URL, e.g. +// '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which +// removes all folders and files in the directory. func (client EndpointsClient) PurgeContent(ctx context.Context, resourceGroupName string, profileName string, endpointName string, contentFilePaths PurgeParameters) (result EndpointsPurgeContentFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -589,7 +589,7 @@ func (client EndpointsClient) PurgeContent(ctx context.Context, resourceGroupNam {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, {TargetValue: contentFilePaths, Constraints: []validation.Constraint{{Target: "contentFilePaths.ContentPaths", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "cdn.EndpointsClient", "PurgeContent") + return result, validation.NewError("cdn.EndpointsClient", "PurgeContent", err.Error()) } req, err := client.PurgeContentPreparer(ctx, resourceGroupName, profileName, endpointName, contentFilePaths) @@ -661,15 +661,15 @@ func (client EndpointsClient) PurgeContentResponder(resp *http.Response) (result // Start starts an existing CDN endpoint that is on a stopped state. // // resourceGroupName is name of the Resource group within the Azure subscription. profileName is name of the CDN -// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which is -// unique globally. +// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which +// is unique globally. func (client EndpointsClient) Start(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result EndpointsStartFuture, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "cdn.EndpointsClient", "Start") + return result, validation.NewError("cdn.EndpointsClient", "Start", err.Error()) } req, err := client.StartPreparer(ctx, resourceGroupName, profileName, endpointName) @@ -740,15 +740,15 @@ func (client EndpointsClient) StartResponder(resp *http.Response) (result Endpoi // Stop stops an existing running CDN endpoint. // // resourceGroupName is name of the Resource group within the Azure subscription. profileName is name of the CDN -// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which is -// unique globally. +// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which +// is unique globally. func (client EndpointsClient) Stop(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result EndpointsStopFuture, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "cdn.EndpointsClient", "Stop") + return result, validation.NewError("cdn.EndpointsClient", "Stop", err.Error()) } req, err := client.StopPreparer(ctx, resourceGroupName, profileName, endpointName) @@ -821,15 +821,15 @@ func (client EndpointsClient) StopResponder(resp *http.Response) (result Endpoin // the Update Origin operation. To update custom domains, use the Update Custom Domain operation. // // resourceGroupName is name of the Resource group within the Azure subscription. profileName is name of the CDN -// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which is -// unique globally. endpointUpdateProperties is endpoint update properties +// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which +// is unique globally. endpointUpdateProperties is endpoint update properties func (client EndpointsClient) Update(ctx context.Context, resourceGroupName string, profileName string, endpointName string, endpointUpdateProperties EndpointUpdateParameters) (result EndpointsUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "cdn.EndpointsClient", "Update") + return result, validation.NewError("cdn.EndpointsClient", "Update", err.Error()) } req, err := client.UpdatePreparer(ctx, resourceGroupName, profileName, endpointName, endpointUpdateProperties) @@ -902,8 +902,8 @@ func (client EndpointsClient) UpdateResponder(resp *http.Response) (result Endpo // ValidateCustomDomain validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. // // resourceGroupName is name of the Resource group within the Azure subscription. profileName is name of the CDN -// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which is -// unique globally. customDomainProperties is custom domain to be validated. +// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which +// is unique globally. customDomainProperties is custom domain to be validated. func (client EndpointsClient) ValidateCustomDomain(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainProperties ValidateCustomDomainInput) (result ValidateCustomDomainOutput, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -912,7 +912,7 @@ func (client EndpointsClient) ValidateCustomDomain(ctx context.Context, resource {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, {TargetValue: customDomainProperties, Constraints: []validation.Constraint{{Target: "customDomainProperties.HostName", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "cdn.EndpointsClient", "ValidateCustomDomain") + return result, validation.NewError("cdn.EndpointsClient", "ValidateCustomDomain", err.Error()) } req, err := client.ValidateCustomDomainPreparer(ctx, resourceGroupName, profileName, endpointName, customDomainProperties) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2017-04-02/cdn/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2017-04-02/cdn/models.go index 14056521f1ff..3cfb1b849f6c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2017-04-02/cdn/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2017-04-02/cdn/models.go @@ -214,17 +214,17 @@ type CidrIPAddress struct { PrefixLength *int32 `json:"prefixLength,omitempty"` } -// CustomDomain friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, -// e.g. www.consoto.com. +// CustomDomain friendly domain name mapping to the endpoint hostname that the customer provides for branding +// purposes, e.g. www.consoto.com. type CustomDomain struct { - autorest.Response `json:"-"` + autorest.Response `json:"-"` + *CustomDomainProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. - Type *string `json:"type,omitempty"` - *CustomDomainProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` } // UnmarshalJSON is the custom unmarshaler for CustomDomain struct. @@ -234,53 +234,52 @@ func (cd *CustomDomain) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties CustomDomainProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - cd.CustomDomainProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var customDomainProperties CustomDomainProperties + err = json.Unmarshal(*v, &customDomainProperties) + if err != nil { + return err + } + cd.CustomDomainProperties = &customDomainProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cd.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cd.Type = &typeVar + } } - cd.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - cd.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - cd.Type = &typeVar } return nil } -// CustomDomainListResult result of the request to list custom domains. It contains a list of custom domain objects and -// a URL link to get the next set of results. +// CustomDomainListResult result of the request to list custom domains. It contains a list of custom domain objects +// and a URL link to get the next set of results. type CustomDomainListResult struct { autorest.Response `json:"-"` // Value - List of CDN CustomDomains within an endpoint. @@ -394,16 +393,18 @@ func (cdp *CustomDomainParameters) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties CustomDomainPropertiesParameters - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var customDomainPropertiesParameters CustomDomainPropertiesParameters + err = json.Unmarshal(*v, &customDomainPropertiesParameters) + if err != nil { + return err + } + cdp.CustomDomainPropertiesParameters = &customDomainPropertiesParameters + } } - cdp.CustomDomainPropertiesParameters = &properties } return nil @@ -443,22 +444,39 @@ func (future CustomDomainsCreateFuture) Result(client CustomDomainsClient) (cd C var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsCreateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return cd, autorest.NewError("cdn.CustomDomainsCreateFuture", "Result", "asynchronous operation has not completed") + return cd, azure.NewAsyncOpIncompleteError("cdn.CustomDomainsCreateFuture") } if future.PollingMethod() == azure.PollingLocation { cd, err = client.CreateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsCreateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsCreateFuture", "Result", resp, "Failure sending request") return } cd, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsCreateFuture", "Result", resp, "Failure responding to request") + } return } @@ -474,22 +492,39 @@ func (future CustomDomainsDeleteFuture) Result(client CustomDomainsClient) (cd C var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return cd, autorest.NewError("cdn.CustomDomainsDeleteFuture", "Result", "asynchronous operation has not completed") + return cd, azure.NewAsyncOpIncompleteError("cdn.CustomDomainsDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { cd, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsDeleteFuture", "Result", resp, "Failure sending request") return } cd, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -507,26 +542,27 @@ func (dco *DeepCreatedOrigin) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - dco.Name = &name - } - - v = m["properties"] - if v != nil { - var properties DeepCreatedOriginProperties - err = json.Unmarshal(*m["properties"], &properties) - 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 + } + dco.Name = &name + } + case "properties": + if v != nil { + var deepCreatedOriginProperties DeepCreatedOriginProperties + err = json.Unmarshal(*v, &deepCreatedOriginProperties) + if err != nil { + return err + } + dco.DeepCreatedOriginProperties = &deepCreatedOriginProperties + } } - dco.DeepCreatedOriginProperties = &properties } return nil @@ -544,13 +580,13 @@ type DeepCreatedOriginProperties struct { // EdgeNode edgenode is a global Point of Presence (POP) location used to deliver CDN content to end users. type EdgeNode struct { + *EdgeNodeProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. - Type *string `json:"type,omitempty"` - *EdgeNodeProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` } // UnmarshalJSON is the custom unmarshaler for EdgeNode struct. @@ -560,46 +596,45 @@ func (en *EdgeNode) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties EdgeNodeProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - en.EdgeNodeProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - en.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - en.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var edgeNodeProperties EdgeNodeProperties + err = json.Unmarshal(*v, &edgeNodeProperties) + if err != nil { + return err + } + en.EdgeNodeProperties = &edgeNodeProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + en.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + en.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + en.Type = &typeVar + } } - en.Type = &typeVar } return nil @@ -611,8 +646,8 @@ type EdgeNodeProperties struct { IPAddressGroups *[]IPAddressGroup `json:"ipAddressGroups,omitempty"` } -// EdgenodeResult result of the request to list CDN edgenodes. It contains a list of ip address group and a URL link to -// get the next set of results. +// EdgenodeResult result of the request to list CDN edgenodes. It contains a list of ip address group and a URL +// link to get the next set of results. type EdgenodeResult struct { autorest.Response `json:"-"` // Value - Edge node of CDN service. @@ -715,96 +750,118 @@ func (page EdgenodeResultPage) Values() []EdgeNode { } // Endpoint CDN endpoint is the entity within a CDN profile containing configuration information such as origin, -// protocol, content caching and delivery behavior. The CDN endpoint uses the URL format .azureedge.net. +// protocol, content caching and delivery behavior. The CDN endpoint uses the URL format +// .azureedge.net. type Endpoint struct { - autorest.Response `json:"-"` + autorest.Response `json:"-"` + *EndpointProperties `json:"properties,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - *EndpointProperties `json:"properties,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for Endpoint struct. -func (e *Endpoint) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for Endpoint. +func (e Endpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if e.EndpointProperties != nil { + objectMap["properties"] = e.EndpointProperties } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties EndpointProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - e.EndpointProperties = &properties + if e.Location != nil { + objectMap["location"] = e.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - e.Location = &location + if e.Tags != nil { + objectMap["tags"] = e.Tags } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - e.Tags = &tags + if e.ID != nil { + objectMap["id"] = e.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - e.ID = &ID + if e.Name != nil { + objectMap["name"] = e.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - e.Name = &name + if e.Type != nil { + objectMap["type"] = e.Type } + return json.Marshal(objectMap) +} - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for Endpoint struct. +func (e *Endpoint) 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 "properties": + if v != nil { + var endpointProperties EndpointProperties + err = json.Unmarshal(*v, &endpointProperties) + if err != nil { + return err + } + e.EndpointProperties = &endpointProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + e.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + e.Tags = tags + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + e.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + e.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + e.Type = &typeVar + } } - e.Type = &typeVar } return nil } -// EndpointListResult result of the request to list endpoints. It contains a list of endpoint objects and a URL link to -// get the the next set of results. +// EndpointListResult result of the request to list endpoints. It contains a list of endpoint objects and a URL +// link to get the the next set of results. type EndpointListResult struct { autorest.Response `json:"-"` // Value - List of CDN endpoints within a profile @@ -908,6 +965,14 @@ func (page EndpointListResultPage) Values() []Endpoint { // EndpointProperties the JSON object that contains the properties required to create an endpoint. type EndpointProperties struct { + // HostName - The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. consoto.azureedge.net + HostName *string `json:"hostName,omitempty"` + // Origins - The source of the content being delivered via CDN. + Origins *[]DeepCreatedOrigin `json:"origins,omitempty"` + // ResourceState - Resource status of the endpoint. Possible values include: 'EndpointResourceStateCreating', 'EndpointResourceStateDeleting', 'EndpointResourceStateRunning', 'EndpointResourceStateStarting', 'EndpointResourceStateStopped', 'EndpointResourceStateStopping' + ResourceState EndpointResourceState `json:"resourceState,omitempty"` + // ProvisioningState - Provisioning status of the endpoint. + ProvisioningState *string `json:"provisioningState,omitempty"` // OriginHostHeader - The host header value sent to the origin with each request. If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. OriginHostHeader *string `json:"originHostHeader,omitempty"` // OriginPath - A directory path on the origin that CDN can use to retreive content from, e.g. contoso.cloudapp.net/originpath. @@ -928,14 +993,6 @@ type EndpointProperties struct { ProbePath *string `json:"probePath,omitempty"` // GeoFilters - List of rules defining the user's geo access within a CDN endpoint. Each geo filter defines an acess rule to a specified path or content, e.g. block APAC for path /pictures/ GeoFilters *[]GeoFilter `json:"geoFilters,omitempty"` - // HostName - The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. consoto.azureedge.net - HostName *string `json:"hostName,omitempty"` - // Origins - The source of the content being delivered via CDN. - Origins *[]DeepCreatedOrigin `json:"origins,omitempty"` - // ResourceState - Resource status of the endpoint. Possible values include: 'EndpointResourceStateCreating', 'EndpointResourceStateDeleting', 'EndpointResourceStateRunning', 'EndpointResourceStateStarting', 'EndpointResourceStateStopped', 'EndpointResourceStateStopping' - ResourceState EndpointResourceState `json:"resourceState,omitempty"` - // ProvisioningState - Provisioning status of the endpoint. - ProvisioningState *string `json:"provisioningState,omitempty"` } // EndpointPropertiesUpdateParameters the JSON object containing endpoint update parameters. @@ -974,22 +1031,39 @@ func (future EndpointsCreateFuture) Result(client EndpointsClient) (e Endpoint, var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsCreateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return e, autorest.NewError("cdn.EndpointsCreateFuture", "Result", "asynchronous operation has not completed") + return e, azure.NewAsyncOpIncompleteError("cdn.EndpointsCreateFuture") } if future.PollingMethod() == azure.PollingLocation { e, err = client.CreateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsCreateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsCreateFuture", "Result", resp, "Failure sending request") return } e, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsCreateFuture", "Result", resp, "Failure responding to request") + } return } @@ -1005,22 +1079,39 @@ func (future EndpointsDeleteFuture) Result(client EndpointsClient) (ar autorest. var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("cdn.EndpointsDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("cdn.EndpointsDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -1036,26 +1127,44 @@ func (future EndpointsLoadContentFuture) Result(client EndpointsClient) (ar auto var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsLoadContentFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("cdn.EndpointsLoadContentFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("cdn.EndpointsLoadContentFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.LoadContentResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsLoadContentFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsLoadContentFuture", "Result", resp, "Failure sending request") return } ar, err = client.LoadContentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsLoadContentFuture", "Result", resp, "Failure responding to request") + } return } -// EndpointsPurgeContentFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// EndpointsPurgeContentFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type EndpointsPurgeContentFuture struct { azure.Future req *http.Request @@ -1067,22 +1176,39 @@ func (future EndpointsPurgeContentFuture) Result(client EndpointsClient) (ar aut var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsPurgeContentFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("cdn.EndpointsPurgeContentFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("cdn.EndpointsPurgeContentFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.PurgeContentResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsPurgeContentFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsPurgeContentFuture", "Result", resp, "Failure sending request") return } ar, err = client.PurgeContentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsPurgeContentFuture", "Result", resp, "Failure responding to request") + } return } @@ -1098,22 +1224,39 @@ func (future EndpointsStartFuture) Result(client EndpointsClient) (e Endpoint, e var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsStartFuture", "Result", future.Response(), "Polling failure") return } if !done { - return e, autorest.NewError("cdn.EndpointsStartFuture", "Result", "asynchronous operation has not completed") + return e, azure.NewAsyncOpIncompleteError("cdn.EndpointsStartFuture") } if future.PollingMethod() == azure.PollingLocation { e, err = client.StartResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsStartFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsStartFuture", "Result", resp, "Failure sending request") return } e, err = client.StartResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsStartFuture", "Result", resp, "Failure responding to request") + } return } @@ -1129,22 +1272,39 @@ func (future EndpointsStopFuture) Result(client EndpointsClient) (e Endpoint, er var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsStopFuture", "Result", future.Response(), "Polling failure") return } if !done { - return e, autorest.NewError("cdn.EndpointsStopFuture", "Result", "asynchronous operation has not completed") + return e, azure.NewAsyncOpIncompleteError("cdn.EndpointsStopFuture") } if future.PollingMethod() == azure.PollingLocation { e, err = client.StopResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsStopFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsStopFuture", "Result", resp, "Failure sending request") return } e, err = client.StopResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsStopFuture", "Result", resp, "Failure responding to request") + } return } @@ -1160,32 +1320,61 @@ func (future EndpointsUpdateFuture) Result(client EndpointsClient) (e Endpoint, var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return e, autorest.NewError("cdn.EndpointsUpdateFuture", "Result", "asynchronous operation has not completed") + return e, azure.NewAsyncOpIncompleteError("cdn.EndpointsUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { e, err = client.UpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsUpdateFuture", "Result", resp, "Failure sending request") return } e, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsUpdateFuture", "Result", resp, "Failure responding to request") + } return } // EndpointUpdateParameters properties required to create or update an endpoint. type EndpointUpdateParameters struct { // Tags - Endpoint tags. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` *EndpointPropertiesUpdateParameters `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for EndpointUpdateParameters. +func (eup EndpointUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if eup.Tags != nil { + objectMap["tags"] = eup.Tags + } + if eup.EndpointPropertiesUpdateParameters != nil { + objectMap["properties"] = eup.EndpointPropertiesUpdateParameters + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for EndpointUpdateParameters struct. func (eup *EndpointUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -1193,26 +1382,27 @@ func (eup *EndpointUpdateParameters) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - eup.Tags = &tags - } - - v = m["properties"] - if v != nil { - var properties EndpointPropertiesUpdateParameters - err = json.Unmarshal(*m["properties"], &properties) - 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 + } + eup.Tags = tags + } + case "properties": + if v != nil { + var endpointPropertiesUpdateParameters EndpointPropertiesUpdateParameters + err = json.Unmarshal(*v, &endpointPropertiesUpdateParameters) + if err != nil { + return err + } + eup.EndpointPropertiesUpdateParameters = &endpointPropertiesUpdateParameters + } } - eup.EndpointPropertiesUpdateParameters = &properties } return nil @@ -1271,8 +1461,8 @@ type OperationDisplay struct { Operation *string `json:"operation,omitempty"` } -// OperationsListResult result of the request to list CDN operations. It contains a list of operations and a URL link -// to get the next set of results. +// OperationsListResult result of the request to list CDN operations. It contains a list of operations and a URL +// link to get the next set of results. type OperationsListResult struct { autorest.Response `json:"-"` // Value - List of CDN operations supported by the CDN resource provider. @@ -1379,93 +1569,114 @@ func (page OperationsListResultPage) Values() []Operation { // origins. type Origin struct { autorest.Response `json:"-"` + *OriginProperties `json:"properties,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - *OriginProperties `json:"properties,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for Origin struct. -func (o *Origin) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for Origin. +func (o Origin) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if o.OriginProperties != nil { + objectMap["properties"] = o.OriginProperties } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties OriginProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - o.OriginProperties = &properties + if o.Location != nil { + objectMap["location"] = o.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - o.Location = &location + if o.Tags != nil { + objectMap["tags"] = o.Tags } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - o.Tags = &tags + if o.ID != nil { + objectMap["id"] = o.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - o.ID = &ID + if o.Name != nil { + objectMap["name"] = o.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - o.Name = &name + if o.Type != nil { + objectMap["type"] = o.Type } + return json.Marshal(objectMap) +} - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for Origin struct. +func (o *Origin) 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 "properties": + if v != nil { + var originProperties OriginProperties + err = json.Unmarshal(*v, &originProperties) + if err != nil { + return err + } + o.OriginProperties = &originProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + o.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + o.Tags = tags + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + o.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + o.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + o.Type = &typeVar + } } - o.Type = &typeVar } return nil } -// OriginListResult result of the request to list origins. It contains a list of origin objects and a URL link to get -// the next set of results. +// OriginListResult result of the request to list origins. It contains a list of origin objects and a URL link to +// get the next set of results. type OriginListResult struct { autorest.Response `json:"-"` // Value - List of CDN origins within an endpoint @@ -1603,22 +1814,39 @@ func (future OriginsUpdateFuture) Result(client OriginsClient) (o Origin, err er var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginsUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return o, autorest.NewError("cdn.OriginsUpdateFuture", "Result", "asynchronous operation has not completed") + return o, azure.NewAsyncOpIncompleteError("cdn.OriginsUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { o, err = client.UpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginsUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginsUpdateFuture", "Result", resp, "Failure sending request") return } o, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginsUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -1634,16 +1862,18 @@ func (oup *OriginUpdateParameters) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties OriginPropertiesParameters - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var originPropertiesParameters OriginPropertiesParameters + err = json.Unmarshal(*v, &originPropertiesParameters) + if err != nil { + return err + } + oup.OriginPropertiesParameters = &originPropertiesParameters + } } - oup.OriginPropertiesParameters = &properties } return nil @@ -1653,105 +1883,128 @@ func (oup *OriginUpdateParameters) UnmarshalJSON(body []byte) error { // pricing tier. type Profile struct { autorest.Response `json:"-"` + // Sku - The pricing tier (defines a CDN provider, feature list and rate) of the CDN profile. + Sku *Sku `json:"sku,omitempty"` + *ProfileProperties `json:"properties,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // Sku - The pricing tier (defines a CDN provider, feature list and rate) of the CDN profile. - Sku *Sku `json:"sku,omitempty"` - *ProfileProperties `json:"properties,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for Profile struct. -func (p *Profile) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for Profile. +func (p Profile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if p.Sku != nil { + objectMap["sku"] = p.Sku } - var v *json.RawMessage - - v = m["sku"] - if v != nil { - var sku Sku - err = json.Unmarshal(*m["sku"], &sku) - if err != nil { - return err - } - p.Sku = &sku + if p.ProfileProperties != nil { + objectMap["properties"] = p.ProfileProperties } - - v = m["properties"] - if v != nil { - var properties ProfileProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - p.ProfileProperties = &properties + if p.Location != nil { + objectMap["location"] = p.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - p.Location = &location + if p.Tags != nil { + objectMap["tags"] = p.Tags } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - p.Tags = &tags + if p.ID != nil { + objectMap["id"] = p.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - p.ID = &ID + if p.Name != nil { + objectMap["name"] = p.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - p.Name = &name + if p.Type != nil { + objectMap["type"] = p.Type } + return json.Marshal(objectMap) +} - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for Profile struct. +func (p *Profile) 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 "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + p.Sku = &sku + } + case "properties": + if v != nil { + var profileProperties ProfileProperties + err = json.Unmarshal(*v, &profileProperties) + if err != nil { + return err + } + p.ProfileProperties = &profileProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + p.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + p.Tags = tags + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + p.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + p.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + p.Type = &typeVar + } } - p.Type = &typeVar } return nil } -// ProfileListResult result of the request to list profiles. It contains a list of profile objects and a URL link to -// get the the next set of results. +// ProfileListResult result of the request to list profiles. It contains a list of profile objects and a URL link +// to get the the next set of results. type ProfileListResult struct { autorest.Response `json:"-"` // Value - List of CDN profiles within a resource group. @@ -1873,22 +2126,39 @@ func (future ProfilesCreateFuture) Result(client ProfilesClient) (p Profile, err var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesCreateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return p, autorest.NewError("cdn.ProfilesCreateFuture", "Result", "asynchronous operation has not completed") + return p, azure.NewAsyncOpIncompleteError("cdn.ProfilesCreateFuture") } if future.PollingMethod() == azure.PollingLocation { p, err = client.CreateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesCreateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesCreateFuture", "Result", resp, "Failure sending request") return } p, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesCreateFuture", "Result", resp, "Failure responding to request") + } return } @@ -1904,22 +2174,39 @@ func (future ProfilesDeleteFuture) Result(client ProfilesClient) (ar autorest.Re var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("cdn.ProfilesDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("cdn.ProfilesDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -1935,33 +2222,59 @@ func (future ProfilesUpdateFuture) Result(client ProfilesClient) (p Profile, err var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return p, autorest.NewError("cdn.ProfilesUpdateFuture", "Result", "asynchronous operation has not completed") + return p, azure.NewAsyncOpIncompleteError("cdn.ProfilesUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { p, err = client.UpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesUpdateFuture", "Result", resp, "Failure sending request") return } p, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesUpdateFuture", "Result", resp, "Failure responding to request") + } return } // ProfileUpdateParameters properties required to update a profile. type ProfileUpdateParameters struct { // Tags - Profile tags - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ProfileUpdateParameters. +func (pup ProfileUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pup.Tags != nil { + objectMap["tags"] = pup.Tags + } + return json.Marshal(objectMap) } -// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than required -// location and tags +// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than +// required location and tags type ProxyResource struct { // ID - Resource ID. ID *string `json:"id,omitempty"` @@ -2123,16 +2436,37 @@ type SupportedOptimizationTypesListResult struct { // TrackedResource the resource model definition for a ARM tracked top level resource. type TrackedResource struct { + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` +} + +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Location != nil { + objectMap["location"] = tr.Location + } + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.ID != nil { + objectMap["id"] = tr.ID + } + if tr.Name != nil { + objectMap["name"] = tr.Name + } + if tr.Type != nil { + objectMap["type"] = tr.Type + } + return json.Marshal(objectMap) } // ValidateCustomDomainInput input of the custom domain to be validated for DNS mapping. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2017-04-02/cdn/origins.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2017-04-02/cdn/origins.go index 313c35ca9899..fa95f8d109c8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2017-04-02/cdn/origins.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2017-04-02/cdn/origins.go @@ -44,15 +44,15 @@ func NewOriginsClientWithBaseURI(baseURI string, subscriptionID string) OriginsC // Get gets an existing origin within an endpoint. // // resourceGroupName is name of the Resource group within the Azure subscription. profileName is name of the CDN -// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which is -// unique globally. originName is name of the origin which is unique within the endpoint. +// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which +// is unique globally. originName is name of the origin which is unique within the endpoint. func (client OriginsClient) Get(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originName string) (result Origin, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "cdn.OriginsClient", "Get") + return result, validation.NewError("cdn.OriginsClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, profileName, endpointName, originName) @@ -122,15 +122,15 @@ func (client OriginsClient) GetResponder(resp *http.Response) (result Origin, er // ListByEndpoint lists all of the existing origins within an endpoint. // // resourceGroupName is name of the Resource group within the Azure subscription. profileName is name of the CDN -// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which is -// unique globally. +// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which +// is unique globally. func (client OriginsClient) ListByEndpoint(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result OriginListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "cdn.OriginsClient", "ListByEndpoint") + return result, validation.NewError("cdn.OriginsClient", "ListByEndpoint", err.Error()) } result.fn = client.listByEndpointNextResults @@ -227,16 +227,16 @@ func (client OriginsClient) ListByEndpointComplete(ctx context.Context, resource // Update updates an existing origin within an endpoint. // // resourceGroupName is name of the Resource group within the Azure subscription. profileName is name of the CDN -// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which is -// unique globally. originName is name of the origin which is unique within the endpoint. originUpdateProperties is -// origin properties +// profile which is unique within the resource group. endpointName is name of the endpoint under the profile which +// is unique globally. originName is name of the origin which is unique within the endpoint. originUpdateProperties +// is origin properties func (client OriginsClient) Update(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originName string, originUpdateProperties OriginUpdateParameters) (result OriginsUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "cdn.OriginsClient", "Update") + return result, validation.NewError("cdn.OriginsClient", "Update", err.Error()) } req, err := client.UpdatePreparer(ctx, resourceGroupName, profileName, endpointName, originName, originUpdateProperties) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2017-04-02/cdn/profiles.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2017-04-02/cdn/profiles.go index 4746fa727440..dca5085d73c7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2017-04-02/cdn/profiles.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2017-04-02/cdn/profiles.go @@ -53,7 +53,7 @@ func (client ProfilesClient) Create(ctx context.Context, resourceGroupName strin {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, {TargetValue: profile, Constraints: []validation.Constraint{{Target: "profile.Sku", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "cdn.ProfilesClient", "Create") + return result, validation.NewError("cdn.ProfilesClient", "Create", err.Error()) } req, err := client.CreatePreparer(ctx, resourceGroupName, profileName, profile) @@ -133,7 +133,7 @@ func (client ProfilesClient) Delete(ctx context.Context, resourceGroupName strin 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.NewErrorWithValidationError(err, "cdn.ProfilesClient", "Delete") + return result, validation.NewError("cdn.ProfilesClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, profileName) @@ -212,7 +212,7 @@ func (client ProfilesClient) GenerateSsoURI(ctx context.Context, resourceGroupNa 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.NewErrorWithValidationError(err, "cdn.ProfilesClient", "GenerateSsoURI") + return result, validation.NewError("cdn.ProfilesClient", "GenerateSsoURI", err.Error()) } req, err := client.GenerateSsoURIPreparer(ctx, resourceGroupName, profileName) @@ -287,7 +287,7 @@ func (client ProfilesClient) Get(ctx context.Context, resourceGroupName string, 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.NewErrorWithValidationError(err, "cdn.ProfilesClient", "Get") + return result, validation.NewError("cdn.ProfilesClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, profileName) @@ -451,7 +451,7 @@ func (client ProfilesClient) ListByResourceGroup(ctx context.Context, resourceGr 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.NewErrorWithValidationError(err, "cdn.ProfilesClient", "ListByResourceGroup") + return result, validation.NewError("cdn.ProfilesClient", "ListByResourceGroup", err.Error()) } result.fn = client.listByResourceGroupNextResults @@ -553,7 +553,7 @@ func (client ProfilesClient) ListResourceUsage(ctx context.Context, resourceGrou 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.NewErrorWithValidationError(err, "cdn.ProfilesClient", "ListResourceUsage") + return result, validation.NewError("cdn.ProfilesClient", "ListResourceUsage", err.Error()) } result.fn = client.listResourceUsageNextResults @@ -657,7 +657,7 @@ func (client ProfilesClient) ListSupportedOptimizationTypes(ctx context.Context, 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.NewErrorWithValidationError(err, "cdn.ProfilesClient", "ListSupportedOptimizationTypes") + return result, validation.NewError("cdn.ProfilesClient", "ListSupportedOptimizationTypes", err.Error()) } req, err := client.ListSupportedOptimizationTypesPreparer(ctx, resourceGroupName, profileName) @@ -726,15 +726,15 @@ func (client ProfilesClient) ListSupportedOptimizationTypesResponder(resp *http. // group. // // resourceGroupName is name of the Resource group within the Azure subscription. profileName is name of the CDN -// profile which is unique within the resource group. profileUpdateParameters is profile properties needed to update an -// existing profile. +// profile which is unique within the resource group. profileUpdateParameters is profile properties needed to +// update an existing profile. func (client ProfilesClient) Update(ctx context.Context, resourceGroupName string, profileName string, profileUpdateParameters ProfileUpdateParameters) (result ProfilesUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "cdn.ProfilesClient", "Update") + return result, validation.NewError("cdn.ProfilesClient", "Update", err.Error()) } req, err := client.UpdatePreparer(ctx, resourceGroupName, profileName, profileUpdateParameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2017-04-02/cdn/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2017-04-02/cdn/version.go index 711add810403..976d61a9865f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2017-04-02/cdn/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2017-04-02/cdn/version.go @@ -1,5 +1,7 @@ package cdn +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package cdn // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta services" + return "Azure-SDK-For-Go/" + version.Number + " cdn/2017-04-02" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/containerservices.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/containerservices.go index 7bc59c9ed406..7f089f250f19 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/containerservices.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/containerservices.go @@ -43,9 +43,9 @@ func NewContainerServicesClientWithBaseURI(baseURI string, subscriptionID string // CreateOrUpdate creates or updates a container service with the specified configuration of orchestrator, masters, and // agents. // -// resourceGroupName is the name of the resource group. containerServiceName is the name of the container service in -// the specified subscription and resource group. parameters is parameters supplied to the Create or Update a Container -// Service operation. +// resourceGroupName is the name of the resource group. containerServiceName is the name of the container service +// in the specified subscription and resource group. parameters is parameters supplied to the Create or Update a +// Container Service operation. func (client ContainerServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, containerServiceName string, parameters ContainerService) (result ContainerServicesCreateOrUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -62,8 +62,7 @@ func (client ContainerServicesClient) CreateOrUpdate(ctx context.Context, resour {Target: "parameters.ContainerServiceProperties.WindowsProfile", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.WindowsProfile.AdminUsername", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.WindowsProfile.AdminUsername", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([._]?[a-zA-Z0-9]+)*$`, Chain: nil}}}, - {Target: "parameters.ContainerServiceProperties.WindowsProfile.AdminPassword", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.WindowsProfile.AdminPassword", Name: validation.Pattern, Rule: `^(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%\^&\*\(\)])[a-zA-Z\d!@#$%\^&\*\(\)]{12,123}$`, Chain: nil}}}, + {Target: "parameters.ContainerServiceProperties.WindowsProfile.AdminPassword", Name: validation.Null, Rule: true, Chain: nil}, }}, {Target: "parameters.ContainerServiceProperties.LinuxProfile", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.LinuxProfile.AdminUsername", Name: validation.Null, Rule: true, @@ -76,7 +75,7 @@ func (client ContainerServicesClient) CreateOrUpdate(ctx context.Context, resour Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.DiagnosticsProfile.VMDiagnostics.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "compute.ContainerServicesClient", "CreateOrUpdate") + return result, validation.NewError("compute.ContainerServicesClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, containerServiceName, parameters) @@ -150,8 +149,8 @@ func (client ContainerServicesClient) CreateOrUpdateResponder(resp *http.Respons // availability sets. All the other resources created with the container service are part of the same resource group // and can be deleted individually. // -// resourceGroupName is the name of the resource group. containerServiceName is the name of the container service in -// the specified subscription and resource group. +// resourceGroupName is the name of the resource group. containerServiceName is the name of the container service +// in the specified subscription and resource group. func (client ContainerServicesClient) Delete(ctx context.Context, resourceGroupName string, containerServiceName string) (result ContainerServicesDeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, containerServiceName) if err != nil { @@ -220,8 +219,8 @@ func (client ContainerServicesClient) DeleteResponder(resp *http.Response) (resu // operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of masters // and agents. // -// resourceGroupName is the name of the resource group. containerServiceName is the name of the container service in -// the specified subscription and resource group. +// resourceGroupName is the name of the resource group. containerServiceName is the name of the container service +// in the specified subscription and resource group. func (client ContainerServicesClient) Get(ctx context.Context, resourceGroupName string, containerServiceName string) (result ContainerService, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, containerServiceName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/disks.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/disks.go index 6b812c6d34f5..cb73599bbe1e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/disks.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/disks.go @@ -42,9 +42,10 @@ func NewDisksClientWithBaseURI(baseURI string, subscriptionID string) DisksClien // CreateOrUpdate creates or updates a disk. // -// resourceGroupName is the name of the resource group. diskName is the name of the managed disk that is being created. -// The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The -// maximum name length is 80 characters. disk is disk object supplied in the body of the Put disk operation. +// resourceGroupName is the name of the resource group. diskName is the name of the managed disk that is being +// created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, +// 0-9 and _. The maximum name length is 80 characters. disk is disk object supplied in the body of the Put disk +// operation. func (client DisksClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, diskName string, disk Disk) (result DisksCreateOrUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: disk, @@ -64,7 +65,7 @@ func (client DisksClient) CreateOrUpdate(ctx context.Context, resourceGroupName }}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "compute.DisksClient", "CreateOrUpdate") + return result, validation.NewError("compute.DisksClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, diskName, disk) @@ -135,9 +136,9 @@ func (client DisksClient) CreateOrUpdateResponder(resp *http.Response) (result D // Delete deletes a disk. // -// resourceGroupName is the name of the resource group. diskName is the name of the managed disk that is being created. -// The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The -// maximum name length is 80 characters. +// resourceGroupName is the name of the resource group. diskName is the name of the managed disk that is being +// created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, +// 0-9 and _. The maximum name length is 80 characters. func (client DisksClient) Delete(ctx context.Context, resourceGroupName string, diskName string) (result DisksDeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, diskName) if err != nil { @@ -205,9 +206,9 @@ func (client DisksClient) DeleteResponder(resp *http.Response) (result Operation // Get gets information about a disk. // -// resourceGroupName is the name of the resource group. diskName is the name of the managed disk that is being created. -// The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The -// maximum name length is 80 characters. +// resourceGroupName is the name of the resource group. diskName is the name of the managed disk that is being +// created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, +// 0-9 and _. The maximum name length is 80 characters. func (client DisksClient) Get(ctx context.Context, resourceGroupName string, diskName string) (result Disk, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, diskName) if err != nil { @@ -273,15 +274,15 @@ func (client DisksClient) GetResponder(resp *http.Response) (result Disk, err er // GrantAccess grants access to a disk. // -// resourceGroupName is the name of the resource group. diskName is the name of the managed disk that is being created. -// The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The -// maximum name length is 80 characters. grantAccessData is access data object supplied in the body of the get disk -// access operation. +// resourceGroupName is the name of the resource group. diskName is the name of the managed disk that is being +// created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, +// 0-9 and _. The maximum name length is 80 characters. grantAccessData is access data object supplied in the body +// of the get disk access operation. func (client DisksClient) GrantAccess(ctx context.Context, resourceGroupName string, diskName string, grantAccessData GrantAccessData) (result DisksGrantAccessFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: grantAccessData, Constraints: []validation.Constraint{{Target: "grantAccessData.DurationInSeconds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "compute.DisksClient", "GrantAccess") + return result, validation.NewError("compute.DisksClient", "GrantAccess", err.Error()) } req, err := client.GrantAccessPreparer(ctx, resourceGroupName, diskName, grantAccessData) @@ -535,9 +536,9 @@ func (client DisksClient) ListByResourceGroupComplete(ctx context.Context, resou // RevokeAccess revokes access to a disk. // -// resourceGroupName is the name of the resource group. diskName is the name of the managed disk that is being created. -// The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The -// maximum name length is 80 characters. +// resourceGroupName is the name of the resource group. diskName is the name of the managed disk that is being +// created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, +// 0-9 and _. The maximum name length is 80 characters. func (client DisksClient) RevokeAccess(ctx context.Context, resourceGroupName string, diskName string) (result DisksRevokeAccessFuture, err error) { req, err := client.RevokeAccessPreparer(ctx, resourceGroupName, diskName) if err != nil { @@ -605,9 +606,10 @@ func (client DisksClient) RevokeAccessResponder(resp *http.Response) (result Ope // Update updates (patches) a disk. // -// resourceGroupName is the name of the resource group. diskName is the name of the managed disk that is being created. -// The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The -// maximum name length is 80 characters. disk is disk object supplied in the body of the Patch disk operation. +// resourceGroupName is the name of the resource group. diskName is the name of the managed disk that is being +// created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, +// 0-9 and _. The maximum name length is 80 characters. disk is disk object supplied in the body of the Patch disk +// operation. func (client DisksClient) Update(ctx context.Context, resourceGroupName string, diskName string, disk DiskUpdate) (result DisksUpdateFuture, err error) { req, err := client.UpdatePreparer(ctx, resourceGroupName, diskName, disk) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/images.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/images.go index 7cdb58154b44..2c0d0ca3f41e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/images.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/images.go @@ -42,8 +42,8 @@ func NewImagesClientWithBaseURI(baseURI string, subscriptionID string) ImagesCli // CreateOrUpdate create or update an image. // -// resourceGroupName is the name of the resource group. imageName is the name of the image. parameters is parameters -// supplied to the Create Image operation. +// resourceGroupName is the name of the resource group. imageName is the name of the image. parameters is +// parameters supplied to the Create Image operation. func (client ImagesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, imageName string, parameters Image) (result ImagesCreateOrUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -51,7 +51,7 @@ func (client ImagesClient) CreateOrUpdate(ctx context.Context, resourceGroupName Chain: []validation.Constraint{{Target: "parameters.ImageProperties.StorageProfile", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.ImageProperties.StorageProfile.OsDisk", Name: validation.Null, Rule: true, Chain: nil}}}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "compute.ImagesClient", "CreateOrUpdate") + return result, validation.NewError("compute.ImagesClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, imageName, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/loganalytics.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/loganalytics.go index f6cb3bd1ab66..0e2b5cb57f51 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/loganalytics.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/loganalytics.go @@ -43,13 +43,13 @@ func NewLogAnalyticsClientWithBaseURI(baseURI string, subscriptionID string) Log // ExportRequestRateByInterval export logs that show Api requests made by this subscription in the given time window to // show throttling activities. // -// parameters is parameters supplied to the LogAnalytics getRequestRateByInterval Api. location is the location upon -// which virtual-machine-sizes is queried. +// parameters is parameters supplied to the LogAnalytics getRequestRateByInterval Api. location is the location +// upon which virtual-machine-sizes is queried. func (client LogAnalyticsClient) ExportRequestRateByInterval(ctx context.Context, parameters RequestRateByIntervalInput, location string) (result LogAnalyticsExportRequestRateByIntervalFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: location, Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "compute.LogAnalyticsClient", "ExportRequestRateByInterval") + return result, validation.NewError("compute.LogAnalyticsClient", "ExportRequestRateByInterval", err.Error()) } req, err := client.ExportRequestRateByIntervalPreparer(ctx, parameters, location) @@ -120,13 +120,13 @@ func (client LogAnalyticsClient) ExportRequestRateByIntervalResponder(resp *http // ExportThrottledRequests export logs that show total throttled Api requests for this subscription in the given time // window. // -// parameters is parameters supplied to the LogAnalytics getThrottledRequests Api. location is the location upon which -// virtual-machine-sizes is queried. +// parameters is parameters supplied to the LogAnalytics getThrottledRequests Api. location is the location upon +// which virtual-machine-sizes is queried. func (client LogAnalyticsClient) ExportThrottledRequests(ctx context.Context, parameters ThrottledRequestsInput, location string) (result LogAnalyticsExportThrottledRequestsFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: location, Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "compute.LogAnalyticsClient", "ExportThrottledRequests") + return result, validation.NewError("compute.LogAnalyticsClient", "ExportThrottledRequests", err.Error()) } req, err := client.ExportThrottledRequestsPreparer(ctx, parameters, location) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/models.go index 02848ce546bd..a6bc835280a4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/models.go @@ -18,6 +18,7 @@ package compute // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( + "encoding/json" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/date" @@ -760,21 +761,69 @@ type AccessURI struct { *AccessURIOutput `json:"properties,omitempty"` } +// UnmarshalJSON is the custom unmarshaler for AccessURI struct. +func (au *AccessURI) 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 "properties": + if v != nil { + var accessURIOutput AccessURIOutput + err = json.Unmarshal(*v, &accessURIOutput) + if err != nil { + return err + } + au.AccessURIOutput = &accessURIOutput + } + } + } + + return nil +} + // AccessURIOutput azure properties, including output. type AccessURIOutput struct { // AccessURIRaw - Operation output data (raw JSON) *AccessURIRaw `json:"output,omitempty"` } +// UnmarshalJSON is the custom unmarshaler for AccessURIOutput struct. +func (auo *AccessURIOutput) 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 "output": + if v != nil { + var accessURIRaw AccessURIRaw + err = json.Unmarshal(*v, &accessURIRaw) + if err != nil { + return err + } + auo.AccessURIRaw = &accessURIRaw + } + } + } + + return nil +} + // AccessURIRaw this object gets 'bubbled up' through flattening. type AccessURIRaw struct { // AccessSAS - A SAS uri for accessing a disk. AccessSAS *string `json:"accessSAS,omitempty"` } -// AdditionalUnattendContent specifies additional XML formatted information that can be included in the Unattend.xml -// file, which is used by Windows Setup. Contents are defined by setting name, component name, and the pass in which -// the content is applied. +// AdditionalUnattendContent specifies additional XML formatted information that can be included in the +// Unattend.xml file, which is used by Windows Setup. Contents are defined by setting name, component name, and the +// pass in which the content is applied. type AdditionalUnattendContent struct { // PassName - The pass name. Currently, the only allowable value is OobeSystem. Possible values include: 'OobeSystem' PassName PassNames `json:"passName,omitempty"` @@ -817,15 +866,18 @@ type APIErrorBase struct { } // AvailabilitySet specifies information about the availability set that the virtual machine should be assigned to. -// Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. -// For more information about availability sets, see [Manage the availability of virtual +// Virtual machines specified in the same availability set are allocated to different nodes to maximize +// availability. For more information about availability sets, see [Manage the availability of virtual // machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). //

For more information on Azure planned maintainance, see [Planned maintenance for virtual machines in // Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) -//

Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to -// an availability set. +//

Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added +// to an availability set. type AvailabilitySet struct { - autorest.Response `json:"-"` + autorest.Response `json:"-"` + *AvailabilitySetProperties `json:"properties,omitempty"` + // Sku - Sku of the availability set + Sku *Sku `json:"sku,omitempty"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name @@ -835,10 +887,112 @@ type AvailabilitySet struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - *AvailabilitySetProperties `json:"properties,omitempty"` - // Sku - Sku of the availability set - Sku *Sku `json:"sku,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for AvailabilitySet. +func (as AvailabilitySet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if as.AvailabilitySetProperties != nil { + objectMap["properties"] = as.AvailabilitySetProperties + } + if as.Sku != nil { + objectMap["sku"] = as.Sku + } + if as.ID != nil { + objectMap["id"] = as.ID + } + if as.Name != nil { + objectMap["name"] = as.Name + } + if as.Type != nil { + objectMap["type"] = as.Type + } + if as.Location != nil { + objectMap["location"] = as.Location + } + if as.Tags != nil { + objectMap["tags"] = as.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AvailabilitySet struct. +func (as *AvailabilitySet) 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 "properties": + if v != nil { + var availabilitySetProperties AvailabilitySetProperties + err = json.Unmarshal(*v, &availabilitySetProperties) + if err != nil { + return err + } + as.AvailabilitySetProperties = &availabilitySetProperties + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + as.Sku = &sku + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + as.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + as.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + as.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + as.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + as.Tags = tags + } + } + } + + return nil } // AvailabilitySetListResult the List Availability Set operation response. @@ -860,10 +1014,10 @@ type AvailabilitySetProperties struct { Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` } -// BootDiagnostics boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to -// diagnose VM status.

For Linux Virtual Machines, you can easily view the output of your console log. -//

For both Windows and Linux virtual machines, Azure also enables you to see a screenshot of the VM from the -// hypervisor. +// BootDiagnostics boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot +// to diagnose VM status.

For Linux Virtual Machines, you can easily view the output of your console log. +//

For both Windows and Linux virtual machines, Azure also enables you to see a screenshot of the VM from +// the hypervisor. type BootDiagnostics struct { // Enabled - Whether boot diagnostics should be enabled on the Virtual Machine. Enabled *bool `json:"enabled,omitempty"` @@ -881,7 +1035,8 @@ type BootDiagnosticsInstanceView struct { // ContainerService container service. type ContainerService struct { - autorest.Response `json:"-"` + autorest.Response `json:"-"` + *ContainerServiceProperties `json:"properties,omitempty"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name @@ -891,8 +1046,100 @@ type ContainerService struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - *ContainerServiceProperties `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ContainerService. +func (cs ContainerService) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cs.ContainerServiceProperties != nil { + objectMap["properties"] = cs.ContainerServiceProperties + } + if cs.ID != nil { + objectMap["id"] = cs.ID + } + if cs.Name != nil { + objectMap["name"] = cs.Name + } + if cs.Type != nil { + objectMap["type"] = cs.Type + } + if cs.Location != nil { + objectMap["location"] = cs.Location + } + if cs.Tags != nil { + objectMap["tags"] = cs.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ContainerService struct. +func (cs *ContainerService) 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 "properties": + if v != nil { + var containerServiceProperties ContainerServiceProperties + err = json.Unmarshal(*v, &containerServiceProperties) + if err != nil { + return err + } + cs.ContainerServiceProperties = &containerServiceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cs.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cs.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cs.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + cs.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + cs.Tags = tags + } + } + } + + return nil } // ContainerServiceAgentPoolProfile profile for the container service agent pool. @@ -1082,26 +1329,44 @@ func (future ContainerServicesCreateOrUpdateFuture) Result(client ContainerServi var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.ContainerServicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return cs, autorest.NewError("compute.ContainerServicesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return cs, azure.NewAsyncOpIncompleteError("compute.ContainerServicesCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { cs, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ContainerServicesCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.ContainerServicesCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } cs, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ContainerServicesCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } -// ContainerServicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// ContainerServicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type ContainerServicesDeleteFuture struct { azure.Future req *http.Request @@ -1113,27 +1378,44 @@ func (future ContainerServicesDeleteFuture) Result(client ContainerServicesClien var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.ContainerServicesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("compute.ContainerServicesDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("compute.ContainerServicesDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ContainerServicesDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.ContainerServicesDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ContainerServicesDeleteFuture", "Result", resp, "Failure responding to request") + } return } -// ContainerServiceServicePrincipalProfile information about a service principal identity for the cluster to use for -// manipulating Azure APIs. +// ContainerServiceServicePrincipalProfile information about a service principal identity for the cluster to use +// for manipulating Azure APIs. type ContainerServiceServicePrincipalProfile struct { // ClientID - The ID for the service principal. ClientID *string `json:"clientId,omitempty"` @@ -1220,6 +1502,12 @@ type DiagnosticsProfile struct { // Disk disk resource. type Disk struct { autorest.Response `json:"-"` + // ManagedBy - A relative URI containing the ID of the VM that has the disk attached. + ManagedBy *string `json:"managedBy,omitempty"` + Sku *DiskSku `json:"sku,omitempty"` + // Zones - The Logical zone list for Disk. + Zones *[]string `json:"zones,omitempty"` + *DiskProperties `json:"properties,omitempty"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name @@ -1229,13 +1517,136 @@ type Disk struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - // ManagedBy - A relative URI containing the ID of the VM that has the disk attached. - ManagedBy *string `json:"managedBy,omitempty"` - Sku *DiskSku `json:"sku,omitempty"` - // Zones - The Logical zone list for Disk. - Zones *[]string `json:"zones,omitempty"` - *DiskProperties `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Disk. +func (d Disk) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if d.ManagedBy != nil { + objectMap["managedBy"] = d.ManagedBy + } + if d.Sku != nil { + objectMap["sku"] = d.Sku + } + if d.Zones != nil { + objectMap["zones"] = d.Zones + } + if d.DiskProperties != nil { + objectMap["properties"] = d.DiskProperties + } + if d.ID != nil { + objectMap["id"] = d.ID + } + if d.Name != nil { + objectMap["name"] = d.Name + } + if d.Type != nil { + objectMap["type"] = d.Type + } + if d.Location != nil { + objectMap["location"] = d.Location + } + if d.Tags != nil { + objectMap["tags"] = d.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Disk struct. +func (d *Disk) 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 "managedBy": + if v != nil { + var managedBy string + err = json.Unmarshal(*v, &managedBy) + if err != nil { + return err + } + d.ManagedBy = &managedBy + } + case "sku": + if v != nil { + var sku DiskSku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + d.Sku = &sku + } + case "zones": + if v != nil { + var zones []string + err = json.Unmarshal(*v, &zones) + if err != nil { + return err + } + d.Zones = &zones + } + case "properties": + if v != nil { + var diskProperties DiskProperties + err = json.Unmarshal(*v, &diskProperties) + if err != nil { + return err + } + d.DiskProperties = &diskProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + d.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + d.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + d.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + d.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + d.Tags = tags + } + } + } + + return nil } // DiskEncryptionSettings describes a Encryption Settings for a Disk @@ -1388,22 +1799,39 @@ func (future DisksCreateOrUpdateFuture) Result(client DisksClient) (d Disk, err var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return d, autorest.NewError("compute.DisksCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return d, azure.NewAsyncOpIncompleteError("compute.DisksCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { d, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } d, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -1419,22 +1847,39 @@ func (future DisksDeleteFuture) Result(client DisksClient) (osr OperationStatusR var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.DisksDeleteFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.DisksDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksDeleteFuture", "Result", resp, "Failure sending request") return } osr, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -1450,22 +1895,39 @@ func (future DisksGrantAccessFuture) Result(client DisksClient) (au AccessURI, e var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", future.Response(), "Polling failure") return } if !done { - return au, autorest.NewError("compute.DisksGrantAccessFuture", "Result", "asynchronous operation has not completed") + return au, azure.NewAsyncOpIncompleteError("compute.DisksGrantAccessFuture") } if future.PollingMethod() == azure.PollingLocation { au, err = client.GrantAccessResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", resp, "Failure sending request") return } au, err = client.GrantAccessResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", resp, "Failure responding to request") + } return } @@ -1489,22 +1951,39 @@ func (future DisksRevokeAccessFuture) Result(client DisksClient) (osr OperationS var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksRevokeAccessFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.DisksRevokeAccessFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.DisksRevokeAccessFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.RevokeAccessResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksRevokeAccessFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksRevokeAccessFuture", "Result", resp, "Failure sending request") return } osr, err = client.RevokeAccessResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksRevokeAccessFuture", "Result", resp, "Failure responding to request") + } return } @@ -1520,31 +1999,105 @@ func (future DisksUpdateFuture) Result(client DisksClient) (d Disk, err error) { var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return d, autorest.NewError("compute.DisksUpdateFuture", "Result", "asynchronous operation has not completed") + return d, azure.NewAsyncOpIncompleteError("compute.DisksUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { d, err = client.UpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", resp, "Failure sending request") return } d, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", resp, "Failure responding to request") + } return } // DiskUpdate disk update resource. type DiskUpdate struct { - // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - Sku *DiskSku `json:"sku,omitempty"` *DiskUpdateProperties `json:"properties,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + Sku *DiskSku `json:"sku,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiskUpdate. +func (du DiskUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if du.DiskUpdateProperties != nil { + objectMap["properties"] = du.DiskUpdateProperties + } + if du.Tags != nil { + objectMap["tags"] = du.Tags + } + if du.Sku != nil { + objectMap["sku"] = du.Sku + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DiskUpdate struct. +func (du *DiskUpdate) 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 "properties": + if v != nil { + var diskUpdateProperties DiskUpdateProperties + err = json.Unmarshal(*v, &diskUpdateProperties) + if err != nil { + return err + } + du.DiskUpdateProperties = &diskUpdateProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + du.Tags = tags + } + case "sku": + if v != nil { + var sku DiskSku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + du.Sku = &sku + } + } + } + + return nil } // DiskUpdateProperties disk resource update properties. @@ -1585,6 +2138,7 @@ type HardwareProfile struct { // virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist. type Image struct { autorest.Response `json:"-"` + *ImageProperties `json:"properties,omitempty"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name @@ -1594,8 +2148,100 @@ type Image struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - *ImageProperties `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Image. +func (i Image) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if i.ImageProperties != nil { + objectMap["properties"] = i.ImageProperties + } + if i.ID != nil { + objectMap["id"] = i.ID + } + if i.Name != nil { + objectMap["name"] = i.Name + } + if i.Type != nil { + objectMap["type"] = i.Type + } + if i.Location != nil { + objectMap["location"] = i.Location + } + if i.Tags != nil { + objectMap["tags"] = i.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Image struct. +func (i *Image) 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 "properties": + if v != nil { + var imageProperties ImageProperties + err = json.Unmarshal(*v, &imageProperties) + if err != nil { + return err + } + i.ImageProperties = &imageProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + i.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + i.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + i.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + i.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + i.Tags = tags + } + } + } + + return nil } // ImageDataDisk describes a data disk. @@ -1760,8 +2406,6 @@ type ImageProperties struct { // marketplace images, or virtual machine images. This element is required when you want to use a platform image, // marketplace image, or virtual machine image, but is not used in other creation operations. type ImageReference struct { - // ID - Resource Id - ID *string `json:"id,omitempty"` // Publisher - The image publisher. Publisher *string `json:"publisher,omitempty"` // Offer - Specifies the offer of the platform image or marketplace image used to create the virtual machine. @@ -1770,6 +2414,8 @@ type ImageReference struct { Sku *string `json:"sku,omitempty"` // Version - Specifies the version of the platform image or marketplace image used to create the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to use the latest version of an image available at deploy time. Even if you use 'latest', the VM image will not automatically update after deploy time even if a new version becomes available. Version *string `json:"version,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` } // ImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. @@ -1784,22 +2430,39 @@ func (future ImagesCreateOrUpdateFuture) Result(client ImagesClient) (i Image, e var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return i, autorest.NewError("compute.ImagesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return i, azure.NewAsyncOpIncompleteError("compute.ImagesCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { i, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } i, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -1815,22 +2478,39 @@ func (future ImagesDeleteFuture) Result(client ImagesClient) (osr OperationStatu var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.ImagesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.ImagesDeleteFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.ImagesDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ImagesDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.ImagesDeleteFuture", "Result", resp, "Failure sending request") return } osr, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ImagesDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -1864,8 +2544,8 @@ type InstanceViewStatus struct { Time *date.Time `json:"time,omitempty"` } -// KeyVaultAndKeyReference key Vault Key Url and vault id of KeK, KeK is optional and when provided is used to unwrap -// the encryptionKey +// KeyVaultAndKeyReference key Vault Key Url and vault id of KeK, KeK is optional and when provided is used to +// unwrap the encryptionKey type KeyVaultAndKeyReference struct { // SourceVault - Resource id of the KeyVault containing the key or secret SourceVault *SourceVault `json:"sourceVault,omitempty"` @@ -2036,27 +2716,44 @@ func (future LogAnalyticsExportRequestRateByIntervalFuture) Result(client LogAna var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", future.Response(), "Polling failure") return } if !done { - return laor, autorest.NewError("compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", "asynchronous operation has not completed") + return laor, azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportRequestRateByIntervalFuture") } if future.PollingMethod() == azure.PollingLocation { laor, err = client.ExportRequestRateByIntervalResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", resp, "Failure sending request") return } laor, err = client.ExportRequestRateByIntervalResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", resp, "Failure responding to request") + } return } -// LogAnalyticsExportThrottledRequestsFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// LogAnalyticsExportThrottledRequestsFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type LogAnalyticsExportThrottledRequestsFuture struct { azure.Future req *http.Request @@ -2068,22 +2765,39 @@ func (future LogAnalyticsExportThrottledRequestsFuture) Result(client LogAnalyti var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", future.Response(), "Polling failure") return } if !done { - return laor, autorest.NewError("compute.LogAnalyticsExportThrottledRequestsFuture", "Result", "asynchronous operation has not completed") + return laor, azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportThrottledRequestsFuture") } if future.PollingMethod() == azure.PollingLocation { laor, err = client.ExportThrottledRequestsResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", resp, "Failure sending request") return } laor, err = client.ExportThrottledRequestsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", resp, "Failure responding to request") + } return } @@ -2106,6 +2820,8 @@ type LogAnalyticsInputBase struct { // LogAnalyticsOperationResult logAnalytics operation status response type LogAnalyticsOperationResult struct { autorest.Response `json:"-"` + // Properties - LogAnalyticsOutput + Properties *LogAnalyticsOutput `json:"properties,omitempty"` // Name - Operation ID Name *string `json:"name,omitempty"` // Status - Operation status @@ -2116,8 +2832,6 @@ type LogAnalyticsOperationResult struct { EndTime *date.Time `json:"endTime,omitempty"` // Error - Api error Error *APIError `json:"error,omitempty"` - // Properties - LogAnalyticsOutput - Properties *LogAnalyticsOutput `json:"properties,omitempty"` } // LogAnalyticsOutput logAnalytics output properties @@ -2129,7 +2843,7 @@ type LogAnalyticsOutput struct { // LongRunningOperationProperties compute-specific operation properties, including output type LongRunningOperationProperties struct { // Output - Operation output data (raw JSON) - Output *map[string]interface{} `json:"output,omitempty"` + Output interface{} `json:"output,omitempty"` } // MaintenanceRedeployStatus maintenance Operation Status. @@ -2152,17 +2866,50 @@ type MaintenanceRedeployStatus struct { // ManagedDiskParameters the parameters of a managed disk. type ManagedDiskParameters struct { - // ID - Resource Id - ID *string `json:"id,omitempty"` // StorageAccountType - Specifies the storage account type for the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible values include: 'StandardLRS', 'PremiumLRS' StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` } // NetworkInterfaceReference describes a network interface reference. type NetworkInterfaceReference struct { - // ID - Resource Id - ID *string `json:"id,omitempty"` *NetworkInterfaceReferenceProperties `json:"properties,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for NetworkInterfaceReference struct. +func (nir *NetworkInterfaceReference) 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 "properties": + if v != nil { + var networkInterfaceReferenceProperties NetworkInterfaceReferenceProperties + err = json.Unmarshal(*v, &networkInterfaceReferenceProperties) + if err != nil { + return err + } + nir.NetworkInterfaceReferenceProperties = &networkInterfaceReferenceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + nir.ID = &ID + } + } + } + + return nil } // NetworkInterfaceReferenceProperties describes a network interface reference properties. @@ -2242,8 +2989,8 @@ type OSProfile struct { Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` } -// Plan specifies information about the marketplace image used to create the virtual machine. This element is only used -// for marketplace images. Before you can use a marketplace image from an API, you must enable the image for +// Plan specifies information about the marketplace image used to create the virtual machine. This element is only +// used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for // programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to // deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. type Plan struct { @@ -2278,6 +3025,8 @@ type RecoveryWalkResponse struct { // RequestRateByIntervalInput api request input for LogAnalytics getRequestRateByInterval Api. type RequestRateByIntervalInput struct { + // IntervalLength - Interval value in minutes used to create LogAnalytics call rate logs. Possible values include: 'ThreeMins', 'FiveMins', 'ThirtyMins', 'SixtyMins' + IntervalLength IntervalInMins `json:"intervalLength,omitempty"` // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` // FromTime - From time of the query @@ -2290,8 +3039,6 @@ type RequestRateByIntervalInput struct { GroupByOperationName *bool `json:"groupByOperationName,omitempty"` // GroupByResourceName - Group query result by Resource Name. GroupByResourceName *bool `json:"groupByResourceName,omitempty"` - // IntervalLength - Interval value in minutes used to create LogAnalytics call rate logs. Possible values include: 'ThreeMins', 'FiveMins', 'ThirtyMins', 'SixtyMins' - IntervalLength IntervalInMins `json:"intervalLength,omitempty"` } // Resource the Resource model definition. @@ -2305,7 +3052,28 @@ type Resource struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.ID != nil { + objectMap["id"] = r.ID + } + if r.Name != nil { + objectMap["name"] = r.Name + } + if r.Type != nil { + objectMap["type"] = r.Type + } + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) } // ResourceSku describes an available Compute SKU. @@ -2501,8 +3269,20 @@ func (page ResourceSkusResultPage) Values() []ResourceSku { // ResourceUpdate the Resource model definition. type ResourceUpdate struct { // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - Sku *DiskSku `json:"sku,omitempty"` + Tags map[string]*string `json:"tags"` + Sku *DiskSku `json:"sku,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceUpdate. +func (ru ResourceUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ru.Tags != nil { + objectMap["tags"] = ru.Tags + } + if ru.Sku != nil { + objectMap["sku"] = ru.Sku + } + return json.Marshal(objectMap) } // RollingUpgradePolicy the configuration parameters used while performing a rolling upgrade. @@ -2543,7 +3323,8 @@ type RollingUpgradeRunningStatus struct { // RollingUpgradeStatusInfo the status of the latest virtual machine scale set rolling upgrade. type RollingUpgradeStatusInfo struct { - autorest.Response `json:"-"` + autorest.Response `json:"-"` + *RollingUpgradeStatusInfoProperties `json:"properties,omitempty"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name @@ -2553,8 +3334,100 @@ type RollingUpgradeStatusInfo struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - *RollingUpgradeStatusInfoProperties `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for RollingUpgradeStatusInfo. +func (rusi RollingUpgradeStatusInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rusi.RollingUpgradeStatusInfoProperties != nil { + objectMap["properties"] = rusi.RollingUpgradeStatusInfoProperties + } + if rusi.ID != nil { + objectMap["id"] = rusi.ID + } + if rusi.Name != nil { + objectMap["name"] = rusi.Name + } + if rusi.Type != nil { + objectMap["type"] = rusi.Type + } + if rusi.Location != nil { + objectMap["location"] = rusi.Location + } + if rusi.Tags != nil { + objectMap["tags"] = rusi.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RollingUpgradeStatusInfo struct. +func (rusi *RollingUpgradeStatusInfo) 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 "properties": + if v != nil { + var rollingUpgradeStatusInfoProperties RollingUpgradeStatusInfoProperties + err = json.Unmarshal(*v, &rollingUpgradeStatusInfoProperties) + if err != nil { + return err + } + rusi.RollingUpgradeStatusInfoProperties = &rollingUpgradeStatusInfoProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rusi.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rusi.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rusi.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rusi.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + rusi.Tags = tags + } + } + } + + return nil } // RollingUpgradeStatusInfoProperties the status of the latest virtual machine scale set rolling upgrade. @@ -2572,6 +3445,10 @@ type RollingUpgradeStatusInfoProperties struct { // RunCommandDocument describes the properties of a Run Command. type RunCommandDocument struct { autorest.Response `json:"-"` + // Script - The script to be executed. + Script *[]string `json:"script,omitempty"` + // Parameters - The parameters used by the script. + Parameters *[]RunCommandParameterDefinition `json:"parameters,omitempty"` // Schema - The VM run command schema. Schema *string `json:"$schema,omitempty"` // ID - The VM run command id. @@ -2582,10 +3459,6 @@ type RunCommandDocument struct { Label *string `json:"label,omitempty"` // Description - The VM run command description. Description *string `json:"description,omitempty"` - // Script - The script to be executed. - Script *[]string `json:"script,omitempty"` - // Parameters - The parameters used by the script. - Parameters *[]RunCommandParameterDefinition `json:"parameters,omitempty"` } // RunCommandDocumentBase describes the properties of a Run Command metadata. @@ -2736,7 +3609,8 @@ type RunCommandParameterDefinition struct { // RunCommandResult run command operation response. type RunCommandResult struct { - autorest.Response `json:"-"` + autorest.Response `json:"-"` + *RunCommandResultProperties `json:"properties,omitempty"` // Name - Operation ID Name *string `json:"name,omitempty"` // Status - Operation status @@ -2746,14 +3620,82 @@ type RunCommandResult struct { // EndTime - End time of the operation EndTime *date.Time `json:"endTime,omitempty"` // Error - Api error - Error *APIError `json:"error,omitempty"` - *RunCommandResultProperties `json:"properties,omitempty"` + Error *APIError `json:"error,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RunCommandResult struct. +func (rcr *RunCommandResult) 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 "properties": + if v != nil { + var runCommandResultProperties RunCommandResultProperties + err = json.Unmarshal(*v, &runCommandResultProperties) + if err != nil { + return err + } + rcr.RunCommandResultProperties = &runCommandResultProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rcr.Name = &name + } + case "status": + if v != nil { + var status string + err = json.Unmarshal(*v, &status) + if err != nil { + return err + } + rcr.Status = &status + } + case "startTime": + if v != nil { + var startTime date.Time + err = json.Unmarshal(*v, &startTime) + if err != nil { + return err + } + rcr.StartTime = &startTime + } + case "endTime": + if v != nil { + var endTime date.Time + err = json.Unmarshal(*v, &endTime) + if err != nil { + return err + } + rcr.EndTime = &endTime + } + case "error": + if v != nil { + var errorVar APIError + err = json.Unmarshal(*v, &errorVar) + if err != nil { + return err + } + rcr.Error = &errorVar + } + } + } + + return nil } // RunCommandResultProperties compute-specific operation properties, including output type RunCommandResultProperties struct { // Output - Operation output data (raw JSON) - Output *map[string]interface{} `json:"output,omitempty"` + Output interface{} `json:"output,omitempty"` } // Sku describes a virtual machine scale set sku. @@ -2769,6 +3711,10 @@ type Sku struct { // Snapshot snapshot resource. type Snapshot struct { autorest.Response `json:"-"` + // ManagedBy - Unused. Always Null. + ManagedBy *string `json:"managedBy,omitempty"` + Sku *DiskSku `json:"sku,omitempty"` + *DiskProperties `json:"properties,omitempty"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name @@ -2778,11 +3724,124 @@ type Snapshot struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - // ManagedBy - Unused. Always Null. - ManagedBy *string `json:"managedBy,omitempty"` - Sku *DiskSku `json:"sku,omitempty"` - *DiskProperties `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Snapshot. +func (s Snapshot) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.ManagedBy != nil { + objectMap["managedBy"] = s.ManagedBy + } + if s.Sku != nil { + objectMap["sku"] = s.Sku + } + if s.DiskProperties != nil { + objectMap["properties"] = s.DiskProperties + } + if s.ID != nil { + objectMap["id"] = s.ID + } + if s.Name != nil { + objectMap["name"] = s.Name + } + if s.Type != nil { + objectMap["type"] = s.Type + } + if s.Location != nil { + objectMap["location"] = s.Location + } + if s.Tags != nil { + objectMap["tags"] = s.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Snapshot struct. +func (s *Snapshot) 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 "managedBy": + if v != nil { + var managedBy string + err = json.Unmarshal(*v, &managedBy) + if err != nil { + return err + } + s.ManagedBy = &managedBy + } + case "sku": + if v != nil { + var sku DiskSku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + s.Sku = &sku + } + case "properties": + if v != nil { + var diskProperties DiskProperties + err = json.Unmarshal(*v, &diskProperties) + if err != nil { + return err + } + s.DiskProperties = &diskProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + s.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + s.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + s.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + s.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + s.Tags = tags + } + } + } + + return nil } // SnapshotList the List Snapshots operation response. @@ -2887,7 +3946,8 @@ func (page SnapshotListPage) Values() []Snapshot { return *page.sl.Value } -// SnapshotsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// SnapshotsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type SnapshotsCreateOrUpdateFuture struct { azure.Future req *http.Request @@ -2899,22 +3959,39 @@ func (future SnapshotsCreateOrUpdateFuture) Result(client SnapshotsClient) (s Sn var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return s, autorest.NewError("compute.SnapshotsCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return s, azure.NewAsyncOpIncompleteError("compute.SnapshotsCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { s, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } s, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -2930,22 +4007,39 @@ func (future SnapshotsDeleteFuture) Result(client SnapshotsClient) (osr Operatio var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.SnapshotsDeleteFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.SnapshotsDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsDeleteFuture", "Result", resp, "Failure sending request") return } osr, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -2961,26 +4055,44 @@ func (future SnapshotsGrantAccessFuture) Result(client SnapshotsClient) (au Acce var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", future.Response(), "Polling failure") return } if !done { - return au, autorest.NewError("compute.SnapshotsGrantAccessFuture", "Result", "asynchronous operation has not completed") + return au, azure.NewAsyncOpIncompleteError("compute.SnapshotsGrantAccessFuture") } if future.PollingMethod() == azure.PollingLocation { au, err = client.GrantAccessResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", resp, "Failure sending request") return } au, err = client.GrantAccessResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", resp, "Failure responding to request") + } return } -// SnapshotsRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// SnapshotsRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type SnapshotsRevokeAccessFuture struct { azure.Future req *http.Request @@ -2992,22 +4104,39 @@ func (future SnapshotsRevokeAccessFuture) Result(client SnapshotsClient) (osr Op var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsRevokeAccessFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.SnapshotsRevokeAccessFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.SnapshotsRevokeAccessFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.RevokeAccessResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsRevokeAccessFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsRevokeAccessFuture", "Result", resp, "Failure sending request") return } osr, err = client.RevokeAccessResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsRevokeAccessFuture", "Result", resp, "Failure responding to request") + } return } @@ -3023,31 +4152,105 @@ func (future SnapshotsUpdateFuture) Result(client SnapshotsClient) (s Snapshot, var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return s, autorest.NewError("compute.SnapshotsUpdateFuture", "Result", "asynchronous operation has not completed") + return s, azure.NewAsyncOpIncompleteError("compute.SnapshotsUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { s, err = client.UpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", resp, "Failure sending request") return } s, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", resp, "Failure responding to request") + } return } // SnapshotUpdate snapshot update resource. type SnapshotUpdate struct { - // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - Sku *DiskSku `json:"sku,omitempty"` *DiskUpdateProperties `json:"properties,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + Sku *DiskSku `json:"sku,omitempty"` +} + +// MarshalJSON is the custom marshaler for SnapshotUpdate. +func (su SnapshotUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if su.DiskUpdateProperties != nil { + objectMap["properties"] = su.DiskUpdateProperties + } + if su.Tags != nil { + objectMap["tags"] = su.Tags + } + if su.Sku != nil { + objectMap["sku"] = su.Sku + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SnapshotUpdate struct. +func (su *SnapshotUpdate) 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 "properties": + if v != nil { + var diskUpdateProperties DiskUpdateProperties + err = json.Unmarshal(*v, &diskUpdateProperties) + if err != nil { + return err + } + su.DiskUpdateProperties = &diskUpdateProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + su.Tags = tags + } + case "sku": + if v != nil { + var sku DiskSku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + su.Sku = &sku + } + } + } + + return nil } // SourceVault the vault id is an Azure Resource Manager Resoure id in the form @@ -3063,8 +4266,8 @@ type SSHConfiguration struct { PublicKeys *[]SSHPublicKey `json:"publicKeys,omitempty"` } -// SSHPublicKey contains information about SSH certificate public key and the path on the Linux VM where the public key -// is placed. +// SSHPublicKey contains information about SSH certificate public key and the path on the Linux VM where the public +// key is placed. type SSHPublicKey struct { // Path - Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys Path *string `json:"path,omitempty"` @@ -3113,7 +4316,16 @@ type ThrottledRequestsInput struct { // UpdateResource the Update Resource model definition. type UpdateResource struct { // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for UpdateResource. +func (ur UpdateResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ur.Tags != nil { + objectMap["tags"] = ur.Tags + } + return json.Marshal(objectMap) } // UpgradePolicy describes an upgrade policy - automatic, manual, or rolling. @@ -3146,8 +4358,8 @@ type UsageName struct { LocalizedValue *string `json:"localizedValue,omitempty"` } -// VaultCertificate describes a single certificate reference in a Key Vault, and where the certificate should reside on -// the VM. +// VaultCertificate describes a single certificate reference in a Key Vault, and where the certificate should +// reside on the VM. type VaultCertificate struct { // CertificateURL - This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, see [Add a key or secret to the key vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8:

{
"data":"",
"dataType":"pfx",
"password":""
} CertificateURL *string `json:"certificateUrl,omitempty"` @@ -3172,16 +4384,6 @@ type VirtualHardDisk struct { // VirtualMachine describes a Virtual Machine. type VirtualMachine struct { autorest.Response `json:"-"` - // ID - Resource Id - ID *string `json:"id,omitempty"` - // Name - Resource name - Name *string `json:"name,omitempty"` - // Type - Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` // Plan - Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. Plan *Plan `json:"plan,omitempty"` *VirtualMachineProperties `json:"properties,omitempty"` @@ -3191,6 +4393,157 @@ type VirtualMachine struct { Identity *VirtualMachineIdentity `json:"identity,omitempty"` // Zones - The virtual machine zones. Zones *[]string `json:"zones,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` + // Name - Resource name + Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for VirtualMachine. +func (VM VirtualMachine) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if VM.Plan != nil { + objectMap["plan"] = VM.Plan + } + if VM.VirtualMachineProperties != nil { + objectMap["properties"] = VM.VirtualMachineProperties + } + if VM.Resources != nil { + objectMap["resources"] = VM.Resources + } + if VM.Identity != nil { + objectMap["identity"] = VM.Identity + } + if VM.Zones != nil { + objectMap["zones"] = VM.Zones + } + if VM.ID != nil { + objectMap["id"] = VM.ID + } + if VM.Name != nil { + objectMap["name"] = VM.Name + } + if VM.Type != nil { + objectMap["type"] = VM.Type + } + if VM.Location != nil { + objectMap["location"] = VM.Location + } + if VM.Tags != nil { + objectMap["tags"] = VM.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachine struct. +func (VM *VirtualMachine) 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 "plan": + if v != nil { + var plan Plan + err = json.Unmarshal(*v, &plan) + if err != nil { + return err + } + VM.Plan = &plan + } + case "properties": + if v != nil { + var virtualMachineProperties VirtualMachineProperties + err = json.Unmarshal(*v, &virtualMachineProperties) + if err != nil { + return err + } + VM.VirtualMachineProperties = &virtualMachineProperties + } + case "resources": + if v != nil { + var resources []VirtualMachineExtension + err = json.Unmarshal(*v, &resources) + if err != nil { + return err + } + VM.Resources = &resources + } + case "identity": + if v != nil { + var identity VirtualMachineIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + VM.Identity = &identity + } + case "zones": + if v != nil { + var zones []string + err = json.Unmarshal(*v, &zones) + if err != nil { + return err + } + VM.Zones = &zones + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + VM.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + VM.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + VM.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + VM.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + VM.Tags = tags + } + } + } + + return nil } // VirtualMachineAgentInstanceView the instance view of the VM Agent running on the virtual machine. @@ -3215,21 +4568,55 @@ type VirtualMachineCaptureParameters struct { // VirtualMachineCaptureResult resource Id. type VirtualMachineCaptureResult struct { - autorest.Response `json:"-"` - // ID - Resource Id - ID *string `json:"id,omitempty"` + autorest.Response `json:"-"` *VirtualMachineCaptureResultProperties `json:"properties,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineCaptureResult struct. +func (vmcr *VirtualMachineCaptureResult) 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 "properties": + if v != nil { + var virtualMachineCaptureResultProperties VirtualMachineCaptureResultProperties + err = json.Unmarshal(*v, &virtualMachineCaptureResultProperties) + if err != nil { + return err + } + vmcr.VirtualMachineCaptureResultProperties = &virtualMachineCaptureResultProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vmcr.ID = &ID + } + } + } + + return nil } // VirtualMachineCaptureResultProperties compute-specific operation properties, including output type VirtualMachineCaptureResultProperties struct { // Output - Operation output data (raw JSON) - Output *map[string]interface{} `json:"output,omitempty"` + Output interface{} `json:"output,omitempty"` } // VirtualMachineExtension describes a Virtual Machine Extension. type VirtualMachineExtension struct { - autorest.Response `json:"-"` + autorest.Response `json:"-"` + *VirtualMachineExtensionProperties `json:"properties,omitempty"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name @@ -3239,8 +4626,100 @@ type VirtualMachineExtension struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - *VirtualMachineExtensionProperties `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineExtension. +func (vme VirtualMachineExtension) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vme.VirtualMachineExtensionProperties != nil { + objectMap["properties"] = vme.VirtualMachineExtensionProperties + } + if vme.ID != nil { + objectMap["id"] = vme.ID + } + if vme.Name != nil { + objectMap["name"] = vme.Name + } + if vme.Type != nil { + objectMap["type"] = vme.Type + } + if vme.Location != nil { + objectMap["location"] = vme.Location + } + if vme.Tags != nil { + objectMap["tags"] = vme.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtension struct. +func (vme *VirtualMachineExtension) 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 "properties": + if v != nil { + var virtualMachineExtensionProperties VirtualMachineExtensionProperties + err = json.Unmarshal(*v, &virtualMachineExtensionProperties) + if err != nil { + return err + } + vme.VirtualMachineExtensionProperties = &virtualMachineExtensionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vme.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vme.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vme.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + vme.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vme.Tags = tags + } + } + } + + return nil } // VirtualMachineExtensionHandlerInstanceView the instance view of a virtual machine extension handler. @@ -3255,7 +4734,8 @@ type VirtualMachineExtensionHandlerInstanceView struct { // VirtualMachineExtensionImage describes a Virtual Machine Extension Image. type VirtualMachineExtensionImage struct { - autorest.Response `json:"-"` + autorest.Response `json:"-"` + *VirtualMachineExtensionImageProperties `json:"properties,omitempty"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name @@ -3265,8 +4745,100 @@ type VirtualMachineExtensionImage struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - *VirtualMachineExtensionImageProperties `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineExtensionImage. +func (vmei VirtualMachineExtensionImage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmei.VirtualMachineExtensionImageProperties != nil { + objectMap["properties"] = vmei.VirtualMachineExtensionImageProperties + } + if vmei.ID != nil { + objectMap["id"] = vmei.ID + } + if vmei.Name != nil { + objectMap["name"] = vmei.Name + } + if vmei.Type != nil { + objectMap["type"] = vmei.Type + } + if vmei.Location != nil { + objectMap["location"] = vmei.Location + } + if vmei.Tags != nil { + objectMap["tags"] = vmei.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionImage struct. +func (vmei *VirtualMachineExtensionImage) 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 "properties": + if v != nil { + var virtualMachineExtensionImageProperties VirtualMachineExtensionImageProperties + err = json.Unmarshal(*v, &virtualMachineExtensionImageProperties) + if err != nil { + return err + } + vmei.VirtualMachineExtensionImageProperties = &virtualMachineExtensionImageProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vmei.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vmei.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vmei.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + vmei.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vmei.Tags = tags + } + } + } + + return nil } // VirtualMachineExtensionImageProperties describes the properties of a Virtual Machine Extension Image. @@ -3310,9 +4882,9 @@ type VirtualMachineExtensionProperties struct { // AutoUpgradeMinorVersion - Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` // Settings - Json formatted public settings for the extension. - Settings *map[string]interface{} `json:"settings,omitempty"` + Settings interface{} `json:"settings,omitempty"` // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - ProtectedSettings *map[string]interface{} `json:"protectedSettings,omitempty"` + ProtectedSettings interface{} `json:"protectedSettings,omitempty"` // ProvisioningState - The provisioning state, which only appears in the response. ProvisioningState *string `json:"provisioningState,omitempty"` // InstanceView - The virtual machine extension instance view. @@ -3332,22 +4904,39 @@ func (future VirtualMachineExtensionsCreateOrUpdateFuture) Result(client Virtual var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return vme, autorest.NewError("compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return vme, azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { vme, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } vme, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -3364,22 +4953,39 @@ func (future VirtualMachineExtensionsDeleteFuture) Result(client VirtualMachineE var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.VirtualMachineExtensionsDeleteFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsDeleteFuture", "Result", resp, "Failure sending request") return } osr, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -3403,16 +5009,97 @@ type VirtualMachineIdentity struct { // VirtualMachineImage describes a Virtual Machine Image. type VirtualMachineImage struct { - autorest.Response `json:"-"` - // ID - Resource Id - ID *string `json:"id,omitempty"` + autorest.Response `json:"-"` + *VirtualMachineImageProperties `json:"properties,omitempty"` // Name - The name of the resource. Name *string `json:"name,omitempty"` // Location - The supported Azure location of the resource. Location *string `json:"location,omitempty"` // Tags - Specifies the tags that are assigned to the virtual machine. For more information about using tags, see [Using tags to organize your Azure resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). - Tags *map[string]*string `json:"tags,omitempty"` - *VirtualMachineImageProperties `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` + // ID - Resource Id + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineImage. +func (vmi VirtualMachineImage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmi.VirtualMachineImageProperties != nil { + objectMap["properties"] = vmi.VirtualMachineImageProperties + } + if vmi.Name != nil { + objectMap["name"] = vmi.Name + } + if vmi.Location != nil { + objectMap["location"] = vmi.Location + } + if vmi.Tags != nil { + objectMap["tags"] = vmi.Tags + } + if vmi.ID != nil { + objectMap["id"] = vmi.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineImage struct. +func (vmi *VirtualMachineImage) 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 "properties": + if v != nil { + var virtualMachineImageProperties VirtualMachineImageProperties + err = json.Unmarshal(*v, &virtualMachineImageProperties) + if err != nil { + return err + } + vmi.VirtualMachineImageProperties = &virtualMachineImageProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vmi.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + vmi.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vmi.Tags = tags + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vmi.ID = &ID + } + } + } + + return nil } // VirtualMachineImageProperties describes the properties of a Virtual Machine Image. @@ -3424,14 +5111,32 @@ type VirtualMachineImageProperties struct { // VirtualMachineImageResource virtual machine image resource information. type VirtualMachineImageResource struct { - // ID - Resource Id - ID *string `json:"id,omitempty"` // Name - The name of the resource. Name *string `json:"name,omitempty"` // Location - The supported Azure location of the resource. Location *string `json:"location,omitempty"` // Tags - Specifies the tags that are assigned to the virtual machine. For more information about using tags, see [Using tags to organize your Azure resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` + // ID - Resource Id + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineImageResource. +func (vmir VirtualMachineImageResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmir.Name != nil { + objectMap["name"] = vmir.Name + } + if vmir.Location != nil { + objectMap["location"] = vmir.Location + } + if vmir.Tags != nil { + objectMap["tags"] = vmir.Tags + } + if vmir.ID != nil { + objectMap["id"] = vmir.ID + } + return json.Marshal(objectMap) } // VirtualMachineInstanceView the instance view of a virtual machine. @@ -3592,16 +5297,6 @@ type VirtualMachineProperties struct { // VirtualMachineScaleSet describes a Virtual Machine Scale Set. type VirtualMachineScaleSet struct { autorest.Response `json:"-"` - // ID - Resource Id - ID *string `json:"id,omitempty"` - // Name - Resource name - Name *string `json:"name,omitempty"` - // Type - Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` // Sku - The virtual machine scale set sku. Sku *Sku `json:"sku,omitempty"` // Plan - Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. @@ -3611,6 +5306,157 @@ type VirtualMachineScaleSet struct { Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` // Zones - The virtual machine scale set zones. Zones *[]string `json:"zones,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` + // Name - Resource name + Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSet. +func (vmss VirtualMachineScaleSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmss.Sku != nil { + objectMap["sku"] = vmss.Sku + } + if vmss.Plan != nil { + objectMap["plan"] = vmss.Plan + } + if vmss.VirtualMachineScaleSetProperties != nil { + objectMap["properties"] = vmss.VirtualMachineScaleSetProperties + } + if vmss.Identity != nil { + objectMap["identity"] = vmss.Identity + } + if vmss.Zones != nil { + objectMap["zones"] = vmss.Zones + } + if vmss.ID != nil { + objectMap["id"] = vmss.ID + } + if vmss.Name != nil { + objectMap["name"] = vmss.Name + } + if vmss.Type != nil { + objectMap["type"] = vmss.Type + } + if vmss.Location != nil { + objectMap["location"] = vmss.Location + } + if vmss.Tags != nil { + objectMap["tags"] = vmss.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSet struct. +func (vmss *VirtualMachineScaleSet) 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 "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + vmss.Sku = &sku + } + case "plan": + if v != nil { + var plan Plan + err = json.Unmarshal(*v, &plan) + if err != nil { + return err + } + vmss.Plan = &plan + } + case "properties": + if v != nil { + var virtualMachineScaleSetProperties VirtualMachineScaleSetProperties + err = json.Unmarshal(*v, &virtualMachineScaleSetProperties) + if err != nil { + return err + } + vmss.VirtualMachineScaleSetProperties = &virtualMachineScaleSetProperties + } + case "identity": + if v != nil { + var identity VirtualMachineScaleSetIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + vmss.Identity = &identity + } + case "zones": + if v != nil { + var zones []string + err = json.Unmarshal(*v, &zones) + if err != nil { + return err + } + vmss.Zones = &zones + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vmss.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vmss.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vmss.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + vmss.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vmss.Tags = tags + } + } + } + + return nil } // VirtualMachineScaleSetDataDisk describes a virtual machine scale set data disk. @@ -3634,11 +5480,53 @@ type VirtualMachineScaleSetDataDisk struct { // VirtualMachineScaleSetExtension describes a Virtual Machine Scale Set Extension. type VirtualMachineScaleSetExtension struct { autorest.Response `json:"-"` - // ID - Resource Id - ID *string `json:"id,omitempty"` // Name - The name of the extension. Name *string `json:"name,omitempty"` *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtension struct. +func (vmsse *VirtualMachineScaleSetExtension) 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 + } + vmsse.Name = &name + } + case "properties": + if v != nil { + var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties + err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) + if err != nil { + return err + } + vmsse.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vmsse.ID = &ID + } + } + } + + return nil } // VirtualMachineScaleSetExtensionListResult the List VM scale set extension operation response. @@ -3763,15 +5651,15 @@ type VirtualMachineScaleSetExtensionProperties struct { // AutoUpgradeMinorVersion - Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` // Settings - Json formatted public settings for the extension. - Settings *map[string]interface{} `json:"settings,omitempty"` + Settings interface{} `json:"settings,omitempty"` // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - ProtectedSettings *map[string]interface{} `json:"protectedSettings,omitempty"` + ProtectedSettings interface{} `json:"protectedSettings,omitempty"` // ProvisioningState - The provisioning state, which only appears in the response. ProvisioningState *string `json:"provisioningState,omitempty"` } -// VirtualMachineScaleSetExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// VirtualMachineScaleSetExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. type VirtualMachineScaleSetExtensionsCreateOrUpdateFuture struct { azure.Future req *http.Request @@ -3783,22 +5671,39 @@ func (future VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) Result(client var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return vmsse, autorest.NewError("compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return vmsse, azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { vmsse, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } vmsse, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -3815,22 +5720,39 @@ func (future VirtualMachineScaleSetExtensionsDeleteFuture) Result(client Virtual var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.VirtualMachineScaleSetExtensionsDeleteFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsDeleteFuture", "Result", resp, "Failure sending request") return } osr, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -3857,8 +5779,8 @@ type VirtualMachineScaleSetInstanceView struct { Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` } -// VirtualMachineScaleSetInstanceViewStatusesSummary instance view statuses summary for virtual machines of a virtual -// machine scale set. +// VirtualMachineScaleSetInstanceViewStatusesSummary instance view statuses summary for virtual machines of a +// virtual machine scale set. type VirtualMachineScaleSetInstanceViewStatusesSummary struct { // StatusesSummary - The extensions information. StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` @@ -3866,11 +5788,53 @@ type VirtualMachineScaleSetInstanceViewStatusesSummary struct { // VirtualMachineScaleSetIPConfiguration describes a virtual machine scale set network profile's IP configuration. type VirtualMachineScaleSetIPConfiguration struct { - // ID - Resource Id - ID *string `json:"id,omitempty"` // Name - The IP configuration name. Name *string `json:"name,omitempty"` *VirtualMachineScaleSetIPConfigurationProperties `json:"properties,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetIPConfiguration struct. +func (vmssic *VirtualMachineScaleSetIPConfiguration) 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 + } + vmssic.Name = &name + } + case "properties": + if v != nil { + var virtualMachineScaleSetIPConfigurationProperties VirtualMachineScaleSetIPConfigurationProperties + err = json.Unmarshal(*v, &virtualMachineScaleSetIPConfigurationProperties) + if err != nil { + return err + } + vmssic.VirtualMachineScaleSetIPConfigurationProperties = &virtualMachineScaleSetIPConfigurationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vmssic.ID = &ID + } + } + } + + return nil } // VirtualMachineScaleSetIPConfigurationProperties describes a virtual machine scale set network profile's IP @@ -4209,11 +6173,53 @@ type VirtualMachineScaleSetManagedDiskParameters struct { // VirtualMachineScaleSetNetworkConfiguration describes a virtual machine scale set network profile's network // configurations. type VirtualMachineScaleSetNetworkConfiguration struct { - // ID - Resource Id - ID *string `json:"id,omitempty"` // Name - The network configuration name. Name *string `json:"name,omitempty"` *VirtualMachineScaleSetNetworkConfigurationProperties `json:"properties,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetNetworkConfiguration struct. +func (vmssnc *VirtualMachineScaleSetNetworkConfiguration) 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 + } + vmssnc.Name = &name + } + case "properties": + if v != nil { + var virtualMachineScaleSetNetworkConfigurationProperties VirtualMachineScaleSetNetworkConfigurationProperties + err = json.Unmarshal(*v, &virtualMachineScaleSetNetworkConfigurationProperties) + if err != nil { + return err + } + vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties = &virtualMachineScaleSetNetworkConfigurationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vmssnc.ID = &ID + } + } + } + + return nil } // VirtualMachineScaleSetNetworkConfigurationDNSSettings describes a virtual machines scale sets network @@ -4300,6 +6306,10 @@ type VirtualMachineScaleSetProperties struct { UniqueID *string `json:"uniqueId,omitempty"` // SinglePlacementGroup - When true this limits the scale set to a single placement group, of max size 100 virtual machines. SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` + // ZoneBalance - Whether to force stictly even Virtual Machine distribution cross x-zones in case there is zone outage. + ZoneBalance *bool `json:"zoneBalance,omitempty"` + // PlatformFaultDomainCount - Fault Domain count for each placement group. + PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` } // VirtualMachineScaleSetPublicIPAddressConfiguration describes a virtual machines scale set IP Configuration's @@ -4310,6 +6320,39 @@ type VirtualMachineScaleSetPublicIPAddressConfiguration struct { *VirtualMachineScaleSetPublicIPAddressConfigurationProperties `json:"properties,omitempty"` } +// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetPublicIPAddressConfiguration struct. +func (vmsspiac *VirtualMachineScaleSetPublicIPAddressConfiguration) 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 + } + vmsspiac.Name = &name + } + case "properties": + if v != nil { + var virtualMachineScaleSetPublicIPAddressConfigurationProperties VirtualMachineScaleSetPublicIPAddressConfigurationProperties + err = json.Unmarshal(*v, &virtualMachineScaleSetPublicIPAddressConfigurationProperties) + if err != nil { + return err + } + vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties = &virtualMachineScaleSetPublicIPAddressConfigurationProperties + } + } + } + + return nil +} + // VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings describes a virtual machines scale sets network // configuration's DNS settings. type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings struct { @@ -4339,27 +6382,44 @@ func (future VirtualMachineScaleSetRollingUpgradesCancelFuture) Result(client Vi var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesCancelFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.VirtualMachineScaleSetRollingUpgradesCancelFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesCancelFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.CancelResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesCancelFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesCancelFuture", "Result", resp, "Failure sending request") return } osr, err = client.CancelResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesCancelFuture", "Result", resp, "Failure responding to request") + } return } -// VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. +// VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. type VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture struct { azure.Future req *http.Request @@ -4371,22 +6431,39 @@ func (future VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) Result(c var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.StartOSUpgradeResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture", "Result", resp, "Failure sending request") return } osr, err = client.StartOSUpgradeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture", "Result", resp, "Failure responding to request") + } return } @@ -4403,27 +6480,44 @@ func (future VirtualMachineScaleSetsCreateOrUpdateFuture) Result(client VirtualM var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return vmss, autorest.NewError("compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return vmss, azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { vmss, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } vmss, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } -// VirtualMachineScaleSetsDeallocateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// VirtualMachineScaleSetsDeallocateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type VirtualMachineScaleSetsDeallocateFuture struct { azure.Future req *http.Request @@ -4435,22 +6529,39 @@ func (future VirtualMachineScaleSetsDeallocateFuture) Result(client VirtualMachi var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeallocateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.VirtualMachineScaleSetsDeallocateFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeallocateFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.DeallocateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeallocateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeallocateFuture", "Result", resp, "Failure sending request") return } osr, err = client.DeallocateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeallocateFuture", "Result", resp, "Failure responding to request") + } return } @@ -4467,22 +6578,39 @@ func (future VirtualMachineScaleSetsDeleteFuture) Result(client VirtualMachineSc var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.VirtualMachineScaleSetsDeleteFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteFuture", "Result", resp, "Failure sending request") return } osr, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -4499,22 +6627,39 @@ func (future VirtualMachineScaleSetsDeleteInstancesFuture) Result(client Virtual var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteInstancesFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.VirtualMachineScaleSetsDeleteInstancesFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeleteInstancesFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.DeleteInstancesResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteInstancesFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteInstancesFuture", "Result", resp, "Failure sending request") return } osr, err = client.DeleteInstancesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteInstancesFuture", "Result", resp, "Failure responding to request") + } return } @@ -4553,27 +6698,44 @@ func (future VirtualMachineScaleSetsPowerOffFuture) Result(client VirtualMachine var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPowerOffFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.VirtualMachineScaleSetsPowerOffFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsPowerOffFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.PowerOffResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPowerOffFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPowerOffFuture", "Result", resp, "Failure sending request") return } osr, err = client.PowerOffResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPowerOffFuture", "Result", resp, "Failure responding to request") + } return } -// VirtualMachineScaleSetsReimageAllFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// VirtualMachineScaleSetsReimageAllFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type VirtualMachineScaleSetsReimageAllFuture struct { azure.Future req *http.Request @@ -4585,22 +6747,39 @@ func (future VirtualMachineScaleSetsReimageAllFuture) Result(client VirtualMachi var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageAllFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.VirtualMachineScaleSetsReimageAllFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsReimageAllFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.ReimageAllResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageAllFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageAllFuture", "Result", resp, "Failure sending request") return } osr, err = client.ReimageAllResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageAllFuture", "Result", resp, "Failure responding to request") + } return } @@ -4617,22 +6796,39 @@ func (future VirtualMachineScaleSetsReimageFuture) Result(client VirtualMachineS var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.VirtualMachineScaleSetsReimageFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsReimageFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.ReimageResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageFuture", "Result", resp, "Failure sending request") return } osr, err = client.ReimageResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageFuture", "Result", resp, "Failure responding to request") + } return } @@ -4649,22 +6845,39 @@ func (future VirtualMachineScaleSetsRestartFuture) Result(client VirtualMachineS var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRestartFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.VirtualMachineScaleSetsRestartFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsRestartFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.RestartResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRestartFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRestartFuture", "Result", resp, "Failure sending request") return } osr, err = client.RestartResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRestartFuture", "Result", resp, "Failure responding to request") + } return } @@ -4681,22 +6894,39 @@ func (future VirtualMachineScaleSetsStartFuture) Result(client VirtualMachineSca var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsStartFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.VirtualMachineScaleSetsStartFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsStartFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.StartResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsStartFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsStartFuture", "Result", resp, "Failure sending request") return } osr, err = client.StartResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsStartFuture", "Result", resp, "Failure responding to request") + } return } @@ -4723,22 +6953,39 @@ func (future VirtualMachineScaleSetsUpdateFuture) Result(client VirtualMachineSc var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return vmss, autorest.NewError("compute.VirtualMachineScaleSetsUpdateFuture", "Result", "asynchronous operation has not completed") + return vmss, azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { vmss, err = client.UpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", resp, "Failure sending request") return } vmss, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -4755,29 +7002,44 @@ func (future VirtualMachineScaleSetsUpdateInstancesFuture) Result(client Virtual var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateInstancesFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.VirtualMachineScaleSetsUpdateInstancesFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsUpdateInstancesFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.UpdateInstancesResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateInstancesFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateInstancesFuture", "Result", resp, "Failure sending request") return } osr, err = client.UpdateInstancesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateInstancesFuture", "Result", resp, "Failure responding to request") + } return } // VirtualMachineScaleSetUpdate describes a Virtual Machine Scale Set. type VirtualMachineScaleSetUpdate struct { - // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` // Sku - The virtual machine scale set sku. Sku *Sku `json:"sku,omitempty"` // Plan - The purchase plan when deploying a virtual machine scale set from VM Marketplace images. @@ -4785,16 +7047,141 @@ type VirtualMachineScaleSetUpdate struct { *VirtualMachineScaleSetUpdateProperties `json:"properties,omitempty"` // Identity - The identity of the virtual machine scale set, if configured. Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdate. +func (vmssu VirtualMachineScaleSetUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssu.Sku != nil { + objectMap["sku"] = vmssu.Sku + } + if vmssu.Plan != nil { + objectMap["plan"] = vmssu.Plan + } + if vmssu.VirtualMachineScaleSetUpdateProperties != nil { + objectMap["properties"] = vmssu.VirtualMachineScaleSetUpdateProperties + } + if vmssu.Identity != nil { + objectMap["identity"] = vmssu.Identity + } + if vmssu.Tags != nil { + objectMap["tags"] = vmssu.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdate struct. +func (vmssu *VirtualMachineScaleSetUpdate) 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 "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + vmssu.Sku = &sku + } + case "plan": + if v != nil { + var plan Plan + err = json.Unmarshal(*v, &plan) + if err != nil { + return err + } + vmssu.Plan = &plan + } + case "properties": + if v != nil { + var virtualMachineScaleSetUpdateProperties VirtualMachineScaleSetUpdateProperties + err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateProperties) + if err != nil { + return err + } + vmssu.VirtualMachineScaleSetUpdateProperties = &virtualMachineScaleSetUpdateProperties + } + case "identity": + if v != nil { + var identity VirtualMachineScaleSetIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + vmssu.Identity = &identity + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vmssu.Tags = tags + } + } + } + + return nil } // VirtualMachineScaleSetUpdateIPConfiguration describes a virtual machine scale set network profile's IP // configuration. type VirtualMachineScaleSetUpdateIPConfiguration struct { - // ID - Resource Id - ID *string `json:"id,omitempty"` // Name - The IP configuration name. Name *string `json:"name,omitempty"` *VirtualMachineScaleSetUpdateIPConfigurationProperties `json:"properties,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdateIPConfiguration struct. +func (vmssuic *VirtualMachineScaleSetUpdateIPConfiguration) 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 + } + vmssuic.Name = &name + } + case "properties": + if v != nil { + var virtualMachineScaleSetUpdateIPConfigurationProperties VirtualMachineScaleSetUpdateIPConfigurationProperties + err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateIPConfigurationProperties) + if err != nil { + return err + } + vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties = &virtualMachineScaleSetUpdateIPConfigurationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vmssuic.ID = &ID + } + } + } + + return nil } // VirtualMachineScaleSetUpdateIPConfigurationProperties describes a virtual machine scale set network profile's IP @@ -4819,15 +7206,57 @@ type VirtualMachineScaleSetUpdateIPConfigurationProperties struct { // VirtualMachineScaleSetUpdateNetworkConfiguration describes a virtual machine scale set network profile's network // configurations. type VirtualMachineScaleSetUpdateNetworkConfiguration struct { - // ID - Resource Id - ID *string `json:"id,omitempty"` // Name - The network configuration name. Name *string `json:"name,omitempty"` *VirtualMachineScaleSetUpdateNetworkConfigurationProperties `json:"properties,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdateNetworkConfiguration struct. +func (vmssunc *VirtualMachineScaleSetUpdateNetworkConfiguration) 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 + } + vmssunc.Name = &name + } + case "properties": + if v != nil { + var virtualMachineScaleSetUpdateNetworkConfigurationProperties VirtualMachineScaleSetUpdateNetworkConfigurationProperties + err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateNetworkConfigurationProperties) + if err != nil { + return err + } + vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties = &virtualMachineScaleSetUpdateNetworkConfigurationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vmssunc.ID = &ID + } + } + } + + return nil } -// VirtualMachineScaleSetUpdateNetworkConfigurationProperties describes a virtual machine scale set updatable network -// profile's IP configuration.Use this object for updating network profile's IP Configuration. +// VirtualMachineScaleSetUpdateNetworkConfigurationProperties describes a virtual machine scale set updatable +// network profile's IP configuration.Use this object for updating network profile's IP Configuration. type VirtualMachineScaleSetUpdateNetworkConfigurationProperties struct { // Primary - Whether this is a primary NIC on a virtual machine. Primary *bool `json:"primary,omitempty"` @@ -4888,14 +7317,47 @@ type VirtualMachineScaleSetUpdateProperties struct { SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` } -// VirtualMachineScaleSetUpdatePublicIPAddressConfiguration describes a virtual machines scale set IP Configuration's -// PublicIPAddress configuration +// VirtualMachineScaleSetUpdatePublicIPAddressConfiguration describes a virtual machines scale set IP +// Configuration's PublicIPAddress configuration type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct { // Name - The publicIP address configuration name. Name *string `json:"name,omitempty"` *VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties `json:"properties,omitempty"` } +// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct. +func (vmssupiac *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) 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 + } + vmssupiac.Name = &name + } + case "properties": + if v != nil { + var virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties + err = json.Unmarshal(*v, &virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties) + if err != nil { + return err + } + vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties = &virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties + } + } + } + + return nil +} + // VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties describes a virtual machines scale set IP // Configuration's PublicIPAddress configuration type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties struct { @@ -4934,16 +7396,6 @@ type VirtualMachineScaleSetUpdateVMProfile struct { // VirtualMachineScaleSetVM describes a virtual machine scale set virtual machine. type VirtualMachineScaleSetVM struct { autorest.Response `json:"-"` - // ID - Resource Id - ID *string `json:"id,omitempty"` - // Name - Resource name - Name *string `json:"name,omitempty"` - // Type - Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` // InstanceID - The virtual machine instance ID. InstanceID *string `json:"instanceId,omitempty"` // Sku - The virtual machine SKU. @@ -4953,9 +7405,161 @@ type VirtualMachineScaleSetVM struct { Plan *Plan `json:"plan,omitempty"` // Resources - The virtual machine child extension resources. Resources *[]VirtualMachineExtension `json:"resources,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` + // Name - Resource name + Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` } -// VirtualMachineScaleSetVMExtensionsSummary extensions summary for virtual machines of a virtual machine scale set. +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVM. +func (vmssv VirtualMachineScaleSetVM) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssv.InstanceID != nil { + objectMap["instanceId"] = vmssv.InstanceID + } + if vmssv.Sku != nil { + objectMap["sku"] = vmssv.Sku + } + if vmssv.VirtualMachineScaleSetVMProperties != nil { + objectMap["properties"] = vmssv.VirtualMachineScaleSetVMProperties + } + if vmssv.Plan != nil { + objectMap["plan"] = vmssv.Plan + } + if vmssv.Resources != nil { + objectMap["resources"] = vmssv.Resources + } + if vmssv.ID != nil { + objectMap["id"] = vmssv.ID + } + if vmssv.Name != nil { + objectMap["name"] = vmssv.Name + } + if vmssv.Type != nil { + objectMap["type"] = vmssv.Type + } + if vmssv.Location != nil { + objectMap["location"] = vmssv.Location + } + if vmssv.Tags != nil { + objectMap["tags"] = vmssv.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVM struct. +func (vmssv *VirtualMachineScaleSetVM) 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 "instanceId": + if v != nil { + var instanceID string + err = json.Unmarshal(*v, &instanceID) + if err != nil { + return err + } + vmssv.InstanceID = &instanceID + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + vmssv.Sku = &sku + } + case "properties": + if v != nil { + var virtualMachineScaleSetVMProperties VirtualMachineScaleSetVMProperties + err = json.Unmarshal(*v, &virtualMachineScaleSetVMProperties) + if err != nil { + return err + } + vmssv.VirtualMachineScaleSetVMProperties = &virtualMachineScaleSetVMProperties + } + case "plan": + if v != nil { + var plan Plan + err = json.Unmarshal(*v, &plan) + if err != nil { + return err + } + vmssv.Plan = &plan + } + case "resources": + if v != nil { + var resources []VirtualMachineExtension + err = json.Unmarshal(*v, &resources) + if err != nil { + return err + } + vmssv.Resources = &resources + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vmssv.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vmssv.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vmssv.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + vmssv.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vmssv.Tags = tags + } + } + } + + return nil +} + +// VirtualMachineScaleSetVMExtensionsSummary extensions summary for virtual machines of a virtual machine scale +// set. type VirtualMachineScaleSetVMExtensionsSummary struct { // Name - The extension name. Name *string `json:"name,omitempty"` @@ -4969,7 +7573,8 @@ type VirtualMachineScaleSetVMInstanceIDs struct { InstanceIds *[]string `json:"instanceIds,omitempty"` } -// VirtualMachineScaleSetVMInstanceRequiredIDs specifies a list of virtual machine instance IDs from the VM scale set. +// VirtualMachineScaleSetVMInstanceRequiredIDs specifies a list of virtual machine instance IDs from the VM scale +// set. type VirtualMachineScaleSetVMInstanceRequiredIDs struct { // InstanceIds - The virtual machine scale set instance ids. InstanceIds *[]string `json:"instanceIds,omitempty"` @@ -5009,7 +7614,8 @@ type VirtualMachineScaleSetVMListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// VirtualMachineScaleSetVMListResultIterator provides access to a complete listing of VirtualMachineScaleSetVM values. +// VirtualMachineScaleSetVMListResultIterator provides access to a complete listing of VirtualMachineScaleSetVM +// values. type VirtualMachineScaleSetVMListResultIterator struct { i int page VirtualMachineScaleSetVMListResultPage @@ -5146,8 +7752,8 @@ type VirtualMachineScaleSetVMProperties struct { LicenseType *string `json:"licenseType,omitempty"` } -// VirtualMachineScaleSetVMsDeallocateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// VirtualMachineScaleSetVMsDeallocateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type VirtualMachineScaleSetVMsDeallocateFuture struct { azure.Future req *http.Request @@ -5159,22 +7765,39 @@ func (future VirtualMachineScaleSetVMsDeallocateFuture) Result(client VirtualMac var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeallocateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.VirtualMachineScaleSetVMsDeallocateFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsDeallocateFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.DeallocateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeallocateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeallocateFuture", "Result", resp, "Failure sending request") return } osr, err = client.DeallocateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeallocateFuture", "Result", resp, "Failure responding to request") + } return } @@ -5191,27 +7814,44 @@ func (future VirtualMachineScaleSetVMsDeleteFuture) Result(client VirtualMachine var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.VirtualMachineScaleSetVMsDeleteFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeleteFuture", "Result", resp, "Failure sending request") return } osr, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeleteFuture", "Result", resp, "Failure responding to request") + } return } -// VirtualMachineScaleSetVMsPowerOffFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// VirtualMachineScaleSetVMsPowerOffFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type VirtualMachineScaleSetVMsPowerOffFuture struct { azure.Future req *http.Request @@ -5223,27 +7863,44 @@ func (future VirtualMachineScaleSetVMsPowerOffFuture) Result(client VirtualMachi var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPowerOffFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.VirtualMachineScaleSetVMsPowerOffFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsPowerOffFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.PowerOffResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPowerOffFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPowerOffFuture", "Result", resp, "Failure sending request") return } osr, err = client.PowerOffResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPowerOffFuture", "Result", resp, "Failure responding to request") + } return } -// VirtualMachineScaleSetVMsReimageAllFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// VirtualMachineScaleSetVMsReimageAllFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type VirtualMachineScaleSetVMsReimageAllFuture struct { azure.Future req *http.Request @@ -5255,27 +7912,44 @@ func (future VirtualMachineScaleSetVMsReimageAllFuture) Result(client VirtualMac var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageAllFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.VirtualMachineScaleSetVMsReimageAllFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsReimageAllFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.ReimageAllResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageAllFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageAllFuture", "Result", resp, "Failure sending request") return } osr, err = client.ReimageAllResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageAllFuture", "Result", resp, "Failure responding to request") + } return } -// VirtualMachineScaleSetVMsReimageFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// VirtualMachineScaleSetVMsReimageFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type VirtualMachineScaleSetVMsReimageFuture struct { azure.Future req *http.Request @@ -5287,27 +7961,44 @@ func (future VirtualMachineScaleSetVMsReimageFuture) Result(client VirtualMachin var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.VirtualMachineScaleSetVMsReimageFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsReimageFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.ReimageResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageFuture", "Result", resp, "Failure sending request") return } osr, err = client.ReimageResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageFuture", "Result", resp, "Failure responding to request") + } return } -// VirtualMachineScaleSetVMsRestartFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// VirtualMachineScaleSetVMsRestartFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type VirtualMachineScaleSetVMsRestartFuture struct { azure.Future req *http.Request @@ -5319,22 +8010,39 @@ func (future VirtualMachineScaleSetVMsRestartFuture) Result(client VirtualMachin var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRestartFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.VirtualMachineScaleSetVMsRestartFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRestartFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.RestartResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRestartFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRestartFuture", "Result", resp, "Failure sending request") return } osr, err = client.RestartResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRestartFuture", "Result", resp, "Failure responding to request") + } return } @@ -5351,22 +8059,39 @@ func (future VirtualMachineScaleSetVMsStartFuture) Result(client VirtualMachineS var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsStartFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.VirtualMachineScaleSetVMsStartFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsStartFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.StartResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsStartFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsStartFuture", "Result", resp, "Failure sending request") return } osr, err = client.StartResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsStartFuture", "Result", resp, "Failure responding to request") + } return } @@ -5383,26 +8108,44 @@ func (future VirtualMachineScaleSetVMsUpdateFuture) Result(client VirtualMachine var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return vmssv, autorest.NewError("compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", "asynchronous operation has not completed") + return vmssv, azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { vmssv, err = client.UpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", resp, "Failure sending request") return } vmssv, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", resp, "Failure responding to request") + } return } -// VirtualMachinesCaptureFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// VirtualMachinesCaptureFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type VirtualMachinesCaptureFuture struct { azure.Future req *http.Request @@ -5414,22 +8157,39 @@ func (future VirtualMachinesCaptureFuture) Result(client VirtualMachinesClient) var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", future.Response(), "Polling failure") return } if !done { - return vmcr, autorest.NewError("compute.VirtualMachinesCaptureFuture", "Result", "asynchronous operation has not completed") + return vmcr, azure.NewAsyncOpIncompleteError("compute.VirtualMachinesCaptureFuture") } if future.PollingMethod() == azure.PollingLocation { vmcr, err = client.CaptureResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", resp, "Failure sending request") return } vmcr, err = client.CaptureResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", resp, "Failure responding to request") + } return } @@ -5446,22 +8206,39 @@ func (future VirtualMachinesConvertToManagedDisksFuture) Result(client VirtualMa var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesConvertToManagedDisksFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.VirtualMachinesConvertToManagedDisksFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.VirtualMachinesConvertToManagedDisksFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.ConvertToManagedDisksResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesConvertToManagedDisksFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesConvertToManagedDisksFuture", "Result", resp, "Failure sending request") return } osr, err = client.ConvertToManagedDisksResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesConvertToManagedDisksFuture", "Result", resp, "Failure responding to request") + } return } @@ -5478,22 +8255,39 @@ func (future VirtualMachinesCreateOrUpdateFuture) Result(client VirtualMachinesC var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return VM, autorest.NewError("compute.VirtualMachinesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return VM, azure.NewAsyncOpIncompleteError("compute.VirtualMachinesCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { VM, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } VM, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -5510,26 +8304,44 @@ func (future VirtualMachinesDeallocateFuture) Result(client VirtualMachinesClien var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeallocateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.VirtualMachinesDeallocateFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.VirtualMachinesDeallocateFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.DeallocateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeallocateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeallocateFuture", "Result", resp, "Failure sending request") return } osr, err = client.DeallocateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeallocateFuture", "Result", resp, "Failure responding to request") + } return } -// VirtualMachinesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// VirtualMachinesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type VirtualMachinesDeleteFuture struct { azure.Future req *http.Request @@ -5541,22 +8353,39 @@ func (future VirtualMachinesDeleteFuture) Result(client VirtualMachinesClient) ( var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.VirtualMachinesDeleteFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.VirtualMachinesDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeleteFuture", "Result", resp, "Failure sending request") return } osr, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -5583,8 +8412,8 @@ type VirtualMachineSizeListResult struct { Value *[]VirtualMachineSize `json:"value,omitempty"` } -// VirtualMachinesPerformMaintenanceFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// VirtualMachinesPerformMaintenanceFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type VirtualMachinesPerformMaintenanceFuture struct { azure.Future req *http.Request @@ -5596,26 +8425,44 @@ func (future VirtualMachinesPerformMaintenanceFuture) Result(client VirtualMachi var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.VirtualMachinesPerformMaintenanceFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.VirtualMachinesPerformMaintenanceFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.PerformMaintenanceResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPerformMaintenanceFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPerformMaintenanceFuture", "Result", resp, "Failure sending request") return } osr, err = client.PerformMaintenanceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPerformMaintenanceFuture", "Result", resp, "Failure responding to request") + } return } -// VirtualMachinesPowerOffFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// VirtualMachinesPowerOffFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type VirtualMachinesPowerOffFuture struct { azure.Future req *http.Request @@ -5627,26 +8474,44 @@ func (future VirtualMachinesPowerOffFuture) Result(client VirtualMachinesClient) var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPowerOffFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.VirtualMachinesPowerOffFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.VirtualMachinesPowerOffFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.PowerOffResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPowerOffFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPowerOffFuture", "Result", resp, "Failure sending request") return } osr, err = client.PowerOffResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPowerOffFuture", "Result", resp, "Failure responding to request") + } return } -// VirtualMachinesRedeployFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// VirtualMachinesRedeployFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type VirtualMachinesRedeployFuture struct { azure.Future req *http.Request @@ -5658,26 +8523,44 @@ func (future VirtualMachinesRedeployFuture) Result(client VirtualMachinesClient) var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRedeployFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.VirtualMachinesRedeployFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRedeployFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.RedeployResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRedeployFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRedeployFuture", "Result", resp, "Failure sending request") return } osr, err = client.RedeployResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRedeployFuture", "Result", resp, "Failure responding to request") + } return } -// VirtualMachinesRestartFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// VirtualMachinesRestartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type VirtualMachinesRestartFuture struct { azure.Future req *http.Request @@ -5689,22 +8572,39 @@ func (future VirtualMachinesRestartFuture) Result(client VirtualMachinesClient) var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRestartFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.VirtualMachinesRestartFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRestartFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.RestartResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRestartFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRestartFuture", "Result", resp, "Failure sending request") return } osr, err = client.RestartResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRestartFuture", "Result", resp, "Failure responding to request") + } return } @@ -5721,22 +8621,39 @@ func (future VirtualMachinesRunCommandFuture) Result(client VirtualMachinesClien var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRunCommandFuture", "Result", future.Response(), "Polling failure") return } if !done { - return rcr, autorest.NewError("compute.VirtualMachinesRunCommandFuture", "Result", "asynchronous operation has not completed") + return rcr, azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRunCommandFuture") } if future.PollingMethod() == azure.PollingLocation { rcr, err = client.RunCommandResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRunCommandFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRunCommandFuture", "Result", resp, "Failure sending request") return } rcr, err = client.RunCommandResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRunCommandFuture", "Result", resp, "Failure responding to request") + } return } @@ -5752,22 +8669,39 @@ func (future VirtualMachinesStartFuture) Result(client VirtualMachinesClient) (o var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesStartFuture", "Result", future.Response(), "Polling failure") return } if !done { - return osr, autorest.NewError("compute.VirtualMachinesStartFuture", "Result", "asynchronous operation has not completed") + return osr, azure.NewAsyncOpIncompleteError("compute.VirtualMachinesStartFuture") } if future.PollingMethod() == azure.PollingLocation { osr, err = client.StartResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesStartFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesStartFuture", "Result", resp, "Failure sending request") return } osr, err = client.StartResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesStartFuture", "Result", resp, "Failure responding to request") + } return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/snapshots.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/snapshots.go index e5e1a9dd85a4..a43705c55790 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/snapshots.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/snapshots.go @@ -42,9 +42,10 @@ func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) Snapsh // CreateOrUpdate creates or updates a snapshot. // -// resourceGroupName is the name of the resource group. snapshotName is the name of the snapshot that is being created. -// The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9 and _. -// The max name length is 80 characters. snapshot is snapshot object supplied in the body of the Put disk operation. +// resourceGroupName is the name of the resource group. snapshotName is the name of the snapshot that is being +// created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, +// A-Z, 0-9 and _. The max name length is 80 characters. snapshot is snapshot object supplied in the body of the +// Put disk operation. func (client SnapshotsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, snapshotName string, snapshot Snapshot) (result SnapshotsCreateOrUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: snapshot, @@ -64,7 +65,7 @@ func (client SnapshotsClient) CreateOrUpdate(ctx context.Context, resourceGroupN }}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "compute.SnapshotsClient", "CreateOrUpdate") + return result, validation.NewError("compute.SnapshotsClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, snapshotName, snapshot) @@ -135,9 +136,9 @@ func (client SnapshotsClient) CreateOrUpdateResponder(resp *http.Response) (resu // Delete deletes a snapshot. // -// resourceGroupName is the name of the resource group. snapshotName is the name of the snapshot that is being created. -// The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9 and _. -// The max name length is 80 characters. +// resourceGroupName is the name of the resource group. snapshotName is the name of the snapshot that is being +// created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, +// A-Z, 0-9 and _. The max name length is 80 characters. func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, snapshotName string) (result SnapshotsDeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, snapshotName) if err != nil { @@ -205,9 +206,9 @@ func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result Opera // Get gets information about a snapshot. // -// resourceGroupName is the name of the resource group. snapshotName is the name of the snapshot that is being created. -// The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9 and _. -// The max name length is 80 characters. +// resourceGroupName is the name of the resource group. snapshotName is the name of the snapshot that is being +// created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, +// A-Z, 0-9 and _. The max name length is 80 characters. func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, snapshotName string) (result Snapshot, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, snapshotName) if err != nil { @@ -273,15 +274,15 @@ func (client SnapshotsClient) GetResponder(resp *http.Response) (result Snapshot // GrantAccess grants access to a snapshot. // -// resourceGroupName is the name of the resource group. snapshotName is the name of the snapshot that is being created. -// The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9 and _. -// The max name length is 80 characters. grantAccessData is access data object supplied in the body of the get snapshot -// access operation. +// resourceGroupName is the name of the resource group. snapshotName is the name of the snapshot that is being +// created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, +// A-Z, 0-9 and _. The max name length is 80 characters. grantAccessData is access data object supplied in the body +// of the get snapshot access operation. func (client SnapshotsClient) GrantAccess(ctx context.Context, resourceGroupName string, snapshotName string, grantAccessData GrantAccessData) (result SnapshotsGrantAccessFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: grantAccessData, Constraints: []validation.Constraint{{Target: "grantAccessData.DurationInSeconds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "compute.SnapshotsClient", "GrantAccess") + return result, validation.NewError("compute.SnapshotsClient", "GrantAccess", err.Error()) } req, err := client.GrantAccessPreparer(ctx, resourceGroupName, snapshotName, grantAccessData) @@ -535,9 +536,9 @@ func (client SnapshotsClient) ListByResourceGroupComplete(ctx context.Context, r // RevokeAccess revokes access to a snapshot. // -// resourceGroupName is the name of the resource group. snapshotName is the name of the snapshot that is being created. -// The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9 and _. -// The max name length is 80 characters. +// resourceGroupName is the name of the resource group. snapshotName is the name of the snapshot that is being +// created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, +// A-Z, 0-9 and _. The max name length is 80 characters. func (client SnapshotsClient) RevokeAccess(ctx context.Context, resourceGroupName string, snapshotName string) (result SnapshotsRevokeAccessFuture, err error) { req, err := client.RevokeAccessPreparer(ctx, resourceGroupName, snapshotName) if err != nil { @@ -605,10 +606,10 @@ func (client SnapshotsClient) RevokeAccessResponder(resp *http.Response) (result // Update updates (patches) a snapshot. // -// resourceGroupName is the name of the resource group. snapshotName is the name of the snapshot that is being created. -// The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9 and _. -// The max name length is 80 characters. snapshot is snapshot object supplied in the body of the Patch snapshot -// operation. +// resourceGroupName is the name of the resource group. snapshotName is the name of the snapshot that is being +// created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, +// A-Z, 0-9 and _. The max name length is 80 characters. snapshot is snapshot object supplied in the body of the +// Patch snapshot operation. func (client SnapshotsClient) Update(ctx context.Context, resourceGroupName string, snapshotName string, snapshot SnapshotUpdate) (result SnapshotsUpdateFuture, err error) { req, err := client.UpdatePreparer(ctx, resourceGroupName, snapshotName, snapshot) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/usage.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/usage.go index 3a316670fda0..688781d4851a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/usage.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/usage.go @@ -48,7 +48,7 @@ func (client UsageClient) List(ctx context.Context, location string) (result Lis if err := validation.Validate([]validation.Validation{ {TargetValue: location, Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "compute.UsageClient", "List") + return result, validation.NewError("compute.UsageClient", "List", err.Error()) } result.fn = client.listNextResults diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/version.go index ff502fd572e4..a935e9590fab 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/version.go @@ -1,5 +1,7 @@ package compute +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package compute // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta arm-compute/" + return "Azure-SDK-For-Go/" + version.Number + " compute/2017-12-01" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachineextensions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachineextensions.go index d6d9066ccfa4..65db3e13f9f4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachineextensions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachineextensions.go @@ -41,9 +41,9 @@ func NewVirtualMachineExtensionsClientWithBaseURI(baseURI string, subscriptionID // CreateOrUpdate the operation to create or update the extension. // -// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine where the extension -// should be create or updated. VMExtensionName is the name of the virtual machine extension. extensionParameters is -// parameters supplied to the Create Virtual Machine Extension operation. +// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine where the +// extension should be create or updated. VMExtensionName is the name of the virtual machine extension. +// extensionParameters is parameters supplied to the Create Virtual Machine Extension operation. func (client VirtualMachineExtensionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtension) (result VirtualMachineExtensionsCreateOrUpdateFuture, err error) { req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMName, VMExtensionName, extensionParameters) if err != nil { @@ -114,8 +114,8 @@ func (client VirtualMachineExtensionsClient) CreateOrUpdateResponder(resp *http. // Delete the operation to delete the extension. // -// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine where the extension -// should be deleted. VMExtensionName is the name of the virtual machine extension. +// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine where the +// extension should be deleted. VMExtensionName is the name of the virtual machine extension. func (client VirtualMachineExtensionsClient) Delete(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string) (result VirtualMachineExtensionsDeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, VMName, VMExtensionName) if err != nil { @@ -185,8 +185,8 @@ func (client VirtualMachineExtensionsClient) DeleteResponder(resp *http.Response // Get the operation to get the extension. // // resourceGroupName is the name of the resource group. VMName is the name of the virtual machine containing the -// extension. VMExtensionName is the name of the virtual machine extension. expand is the expand expression to apply on -// the operation. +// extension. VMExtensionName is the name of the virtual machine extension. expand is the expand expression to +// apply on the operation. func (client VirtualMachineExtensionsClient) Get(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, expand string) (result VirtualMachineExtension, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, VMName, VMExtensionName, expand) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachineimages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachineimages.go index e3aa2bc8224e..e8643d0651f5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachineimages.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachineimages.go @@ -41,8 +41,8 @@ func NewVirtualMachineImagesClientWithBaseURI(baseURI string, subscriptionID str // Get gets a virtual machine image. // -// location is the name of a supported Azure region. publisherName is a valid image publisher. offer is a valid image -// publisher offer. skus is a valid image SKU. version is a valid image SKU version. +// location is the name of a supported Azure region. publisherName is a valid image publisher. offer is a valid +// image publisher offer. skus is a valid image SKU. version is a valid image SKU version. func (client VirtualMachineImagesClient) Get(ctx context.Context, location string, publisherName string, offer string, skus string, version string) (result VirtualMachineImage, err error) { req, err := client.GetPreparer(ctx, location, publisherName, offer, skus, version) if err != nil { @@ -111,8 +111,8 @@ func (client VirtualMachineImagesClient) GetResponder(resp *http.Response) (resu // List gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. // -// location is the name of a supported Azure region. publisherName is a valid image publisher. offer is a valid image -// publisher offer. skus is a valid image SKU. filter is the filter to apply on the operation. +// location is the name of a supported Azure region. publisherName is a valid image publisher. offer is a valid +// image publisher offer. skus is a valid image SKU. filter is the filter to apply on the operation. func (client VirtualMachineImagesClient) List(ctx context.Context, location string, publisherName string, offer string, skus string, filter string, top *int32, orderby string) (result ListVirtualMachineImageResource, err error) { req, err := client.ListPreparer(ctx, location, publisherName, offer, skus, filter, top, orderby) if err != nil { @@ -320,8 +320,8 @@ func (client VirtualMachineImagesClient) ListPublishersResponder(resp *http.Resp // ListSkus gets a list of virtual machine image SKUs for the specified location, publisher, and offer. // -// location is the name of a supported Azure region. publisherName is a valid image publisher. offer is a valid image -// publisher offer. +// location is the name of a supported Azure region. publisherName is a valid image publisher. offer is a valid +// image publisher offer. func (client VirtualMachineImagesClient) ListSkus(ctx context.Context, location string, publisherName string, offer string) (result ListVirtualMachineImageResource, err error) { req, err := client.ListSkusPreparer(ctx, location, publisherName, offer) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachineruncommands.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachineruncommands.go index 79674138d2cb..6c38888d62de 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachineruncommands.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachineruncommands.go @@ -47,7 +47,7 @@ func (client VirtualMachineRunCommandsClient) Get(ctx context.Context, location if err := validation.Validate([]validation.Validation{ {TargetValue: location, Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "compute.VirtualMachineRunCommandsClient", "Get") + return result, validation.NewError("compute.VirtualMachineRunCommandsClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, location, commandID) @@ -119,7 +119,7 @@ func (client VirtualMachineRunCommandsClient) List(ctx context.Context, location if err := validation.Validate([]validation.Validation{ {TargetValue: location, Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "compute.VirtualMachineRunCommandsClient", "List") + return result, validation.NewError("compute.VirtualMachineRunCommandsClient", "List", err.Error()) } result.fn = client.listNextResults diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachines.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachines.go index 8e61949a5240..096880e6cd92 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachines.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachines.go @@ -51,7 +51,7 @@ func (client VirtualMachinesClient) Capture(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "parameters.VhdPrefix", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.DestinationContainerName", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.OverwriteVhds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "compute.VirtualMachinesClient", "Capture") + return result, validation.NewError("compute.VirtualMachinesClient", "Capture", err.Error()) } req, err := client.CapturePreparer(ctx, resourceGroupName, VMName, parameters) @@ -212,7 +212,7 @@ func (client VirtualMachinesClient) CreateOrUpdate(ctx context.Context, resource }}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "compute.VirtualMachinesClient", "CreateOrUpdate") + return result, validation.NewError("compute.VirtualMachinesClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMName, parameters) @@ -486,8 +486,8 @@ func (client VirtualMachinesClient) GeneralizeResponder(resp *http.Response) (re // Get retrieves information about the model view or the instance view of a virtual machine. // -// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine. expand is the expand -// expression to apply on the operation. +// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine. expand is the +// expand expression to apply on the operation. func (client VirtualMachinesClient) Get(ctx context.Context, resourceGroupName string, VMName string, expand InstanceViewTypes) (result VirtualMachine, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, VMName, expand) if err != nil { @@ -1152,7 +1152,7 @@ func (client VirtualMachinesClient) RunCommand(ctx context.Context, resourceGrou if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.CommandID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "compute.VirtualMachinesClient", "RunCommand") + return result, validation.NewError("compute.VirtualMachinesClient", "RunCommand", err.Error()) } req, err := client.RunCommandPreparer(ctx, resourceGroupName, VMName, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinescalesetextensions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinescalesetextensions.go index d27a62b7954f..1146863e85dd 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinescalesetextensions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinescalesetextensions.go @@ -185,9 +185,9 @@ func (client VirtualMachineScaleSetExtensionsClient) DeleteResponder(resp *http. // Get the operation to get the extension. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set containing the -// extension. vmssExtensionName is the name of the VM scale set extension. expand is the expand expression to apply on -// the operation. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set containing +// the extension. vmssExtensionName is the name of the VM scale set extension. expand is the expand expression to +// apply on the operation. func (client VirtualMachineScaleSetExtensionsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, expand string) (result VirtualMachineScaleSetExtension, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName, expand) if err != nil { @@ -257,8 +257,8 @@ func (client VirtualMachineScaleSetExtensionsClient) GetResponder(resp *http.Res // List gets a list of all extensions in a VM scale set. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set containing the -// extension. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set containing +// the extension. func (client VirtualMachineScaleSetExtensionsClient) List(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetExtensionListResultPage, err error) { result.fn = client.listNextResults req, err := client.ListPreparer(ctx, resourceGroupName, VMScaleSetName) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinescalesets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinescalesets.go index 9045380d1d1f..e3d763501553 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinescalesets.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinescalesets.go @@ -65,7 +65,7 @@ func (client VirtualMachineScaleSetsClient) CreateOrUpdate(ctx context.Context, }}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "compute.VirtualMachineScaleSetsClient", "CreateOrUpdate") + return result, validation.NewError("compute.VirtualMachineScaleSetsClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMScaleSetName, parameters) @@ -137,8 +137,8 @@ func (client VirtualMachineScaleSetsClient) CreateOrUpdateResponder(resp *http.R // Deallocate deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the // compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. VMInstanceIDs -// is a list of virtual machine instance IDs from the VM scale set. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. +// VMInstanceIDs is a list of virtual machine instance IDs from the VM scale set. func (client VirtualMachineScaleSetsClient) Deallocate(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsDeallocateFuture, err error) { req, err := client.DeallocatePreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) if err != nil { @@ -279,13 +279,13 @@ func (client VirtualMachineScaleSetsClient) DeleteResponder(resp *http.Response) // DeleteInstances deletes virtual machines in a VM scale set. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. VMInstanceIDs -// is a list of virtual machine instance IDs from the VM scale set. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. +// VMInstanceIDs is a list of virtual machine instance IDs from the VM scale set. func (client VirtualMachineScaleSetsClient) DeleteInstances(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs) (result VirtualMachineScaleSetsDeleteInstancesFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: VMInstanceIDs, Constraints: []validation.Constraint{{Target: "VMInstanceIDs.InstanceIds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "compute.VirtualMachineScaleSetsClient", "DeleteInstances") + return result, validation.NewError("compute.VirtualMachineScaleSetsClient", "DeleteInstances", err.Error()) } req, err := client.DeleteInstancesPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) @@ -838,8 +838,8 @@ func (client VirtualMachineScaleSetsClient) ListSkusComplete(ctx context.Context // PowerOff power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and // you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. VMInstanceIDs -// is a list of virtual machine instance IDs from the VM scale set. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. +// VMInstanceIDs is a list of virtual machine instance IDs from the VM scale set. func (client VirtualMachineScaleSetsClient) PowerOff(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsPowerOffFuture, err error) { req, err := client.PowerOffPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) if err != nil { @@ -912,8 +912,8 @@ func (client VirtualMachineScaleSetsClient) PowerOffResponder(resp *http.Respons // Reimage reimages (upgrade the operating system) one or more virtual machines in a VM scale set. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. VMInstanceIDs -// is a list of virtual machine instance IDs from the VM scale set. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. +// VMInstanceIDs is a list of virtual machine instance IDs from the VM scale set. func (client VirtualMachineScaleSetsClient) Reimage(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsReimageFuture, err error) { req, err := client.ReimagePreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) if err != nil { @@ -987,8 +987,8 @@ func (client VirtualMachineScaleSetsClient) ReimageResponder(resp *http.Response // ReimageAll reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation // is only supported for managed disks. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. VMInstanceIDs -// is a list of virtual machine instance IDs from the VM scale set. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. +// VMInstanceIDs is a list of virtual machine instance IDs from the VM scale set. func (client VirtualMachineScaleSetsClient) ReimageAll(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsReimageAllFuture, err error) { req, err := client.ReimageAllPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) if err != nil { @@ -1061,8 +1061,8 @@ func (client VirtualMachineScaleSetsClient) ReimageAllResponder(resp *http.Respo // Restart restarts one or more virtual machines in a VM scale set. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. VMInstanceIDs -// is a list of virtual machine instance IDs from the VM scale set. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. +// VMInstanceIDs is a list of virtual machine instance IDs from the VM scale set. func (client VirtualMachineScaleSetsClient) Restart(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsRestartFuture, err error) { req, err := client.RestartPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) if err != nil { @@ -1135,8 +1135,8 @@ func (client VirtualMachineScaleSetsClient) RestartResponder(resp *http.Response // Start starts one or more virtual machines in a VM scale set. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. VMInstanceIDs -// is a list of virtual machine instance IDs from the VM scale set. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. +// VMInstanceIDs is a list of virtual machine instance IDs from the VM scale set. func (client VirtualMachineScaleSetsClient) Start(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsStartFuture, err error) { req, err := client.StartPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) if err != nil { @@ -1280,13 +1280,13 @@ func (client VirtualMachineScaleSetsClient) UpdateResponder(resp *http.Response) // UpdateInstances upgrades one or more virtual machines to the latest SKU set in the VM scale set model. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. VMInstanceIDs -// is a list of virtual machine instance IDs from the VM scale set. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. +// VMInstanceIDs is a list of virtual machine instance IDs from the VM scale set. func (client VirtualMachineScaleSetsClient) UpdateInstances(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs) (result VirtualMachineScaleSetsUpdateInstancesFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: VMInstanceIDs, Constraints: []validation.Constraint{{Target: "VMInstanceIDs.InstanceIds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "compute.VirtualMachineScaleSetsClient", "UpdateInstances") + return result, validation.NewError("compute.VirtualMachineScaleSetsClient", "UpdateInstances", err.Error()) } req, err := client.UpdateInstancesPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinescalesetvms.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinescalesetvms.go index 9a55b534b5a8..1bc08f7a7f13 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinescalesetvms.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinescalesetvms.go @@ -44,8 +44,8 @@ func NewVirtualMachineScaleSetVMsClientWithBaseURI(baseURI string, subscriptionI // compute resources it uses. You are not billed for the compute resources of this virtual machine once it is // deallocated. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID is -// the instance ID of the virtual machine. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID +// is the instance ID of the virtual machine. func (client VirtualMachineScaleSetVMsClient) Deallocate(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsDeallocateFuture, err error) { req, err := client.DeallocatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) if err != nil { @@ -114,8 +114,8 @@ func (client VirtualMachineScaleSetVMsClient) DeallocateResponder(resp *http.Res // Delete deletes a virtual machine from a VM scale set. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID is -// the instance ID of the virtual machine. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID +// is the instance ID of the virtual machine. func (client VirtualMachineScaleSetVMsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsDeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) if err != nil { @@ -184,8 +184,8 @@ func (client VirtualMachineScaleSetVMsClient) DeleteResponder(resp *http.Respons // Get gets a virtual machine from a VM scale set. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID is -// the instance ID of the virtual machine. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID +// is the instance ID of the virtual machine. func (client VirtualMachineScaleSetVMsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVM, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) if err != nil { @@ -252,8 +252,8 @@ func (client VirtualMachineScaleSetVMsClient) GetResponder(resp *http.Response) // GetInstanceView gets the status of a virtual machine from a VM scale set. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID is -// the instance ID of the virtual machine. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID +// is the instance ID of the virtual machine. func (client VirtualMachineScaleSetVMsClient) GetInstanceView(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMInstanceView, err error) { req, err := client.GetInstanceViewPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) if err != nil { @@ -426,8 +426,8 @@ func (client VirtualMachineScaleSetVMsClient) ListComplete(ctx context.Context, // PowerOff power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are // getting charged for the resources. Instead, use deallocate to release resources and avoid charges. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID is -// the instance ID of the virtual machine. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID +// is the instance ID of the virtual machine. func (client VirtualMachineScaleSetVMsClient) PowerOff(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsPowerOffFuture, err error) { req, err := client.PowerOffPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) if err != nil { @@ -496,8 +496,8 @@ func (client VirtualMachineScaleSetVMsClient) PowerOffResponder(resp *http.Respo // Reimage reimages (upgrade the operating system) a specific virtual machine in a VM scale set. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID is -// the instance ID of the virtual machine. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID +// is the instance ID of the virtual machine. func (client VirtualMachineScaleSetVMsClient) Reimage(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsReimageFuture, err error) { req, err := client.ReimagePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) if err != nil { @@ -567,8 +567,8 @@ func (client VirtualMachineScaleSetVMsClient) ReimageResponder(resp *http.Respon // ReimageAll allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This // operation is only supported for managed disks. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID is -// the instance ID of the virtual machine. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID +// is the instance ID of the virtual machine. func (client VirtualMachineScaleSetVMsClient) ReimageAll(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsReimageAllFuture, err error) { req, err := client.ReimageAllPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) if err != nil { @@ -637,8 +637,8 @@ func (client VirtualMachineScaleSetVMsClient) ReimageAllResponder(resp *http.Res // Restart restarts a virtual machine in a VM scale set. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID is -// the instance ID of the virtual machine. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID +// is the instance ID of the virtual machine. func (client VirtualMachineScaleSetVMsClient) Restart(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsRestartFuture, err error) { req, err := client.RestartPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) if err != nil { @@ -707,8 +707,8 @@ func (client VirtualMachineScaleSetVMsClient) RestartResponder(resp *http.Respon // Start starts a virtual machine in a VM scale set. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID is -// the instance ID of the virtual machine. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID +// is the instance ID of the virtual machine. func (client VirtualMachineScaleSetVMsClient) Start(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsStartFuture, err error) { req, err := client.StartPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) if err != nil { @@ -799,7 +799,7 @@ func (client VirtualMachineScaleSetVMsClient) Update(ctx context.Context, resour }}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "compute.VirtualMachineScaleSetVMsClient", "Update") + return result, validation.NewError("compute.VirtualMachineScaleSetVMsClient", "Update", err.Error()) } req, err := client.UpdatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinesizes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinesizes.go index 22b8756043be..c091724bbe06 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinesizes.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinesizes.go @@ -47,7 +47,7 @@ func (client VirtualMachineSizesClient) List(ctx context.Context, location strin if err := validation.Validate([]validation.Validation{ {TargetValue: location, Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "compute.VirtualMachineSizesClient", "List") + return result, validation.NewError("compute.VirtualMachineSizesClient", "List", err.Error()) } req, err := client.ListPreparer(ctx, location) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-02-01-preview/containerinstance/containergroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-02-01-preview/containerinstance/containergroups.go index 019bd33fae75..b909982bca14 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-02-01-preview/containerinstance/containergroups.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-02-01-preview/containerinstance/containergroups.go @@ -54,7 +54,7 @@ func (client ContainerGroupsClient) CreateOrUpdate(ctx context.Context, resource {Target: "containerGroup.ContainerGroupProperties.IPAddress.Type", Name: validation.Null, Rule: true, Chain: nil}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "containerinstance.ContainerGroupsClient", "CreateOrUpdate") + return result, validation.NewError("containerinstance.ContainerGroupsClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, containerGroupName, containerGroup) @@ -445,8 +445,8 @@ func (client ContainerGroupsClient) ListByResourceGroupComplete(ctx context.Cont // Update updates container group tags with specified values. // -// resourceGroupName is the name of the resource group. containerGroupName is the name of the container group. resource -// is the container group resource with just the tags to be updated. +// resourceGroupName is the name of the resource group. containerGroupName is the name of the container group. +// resource is the container group resource with just the tags to be updated. func (client ContainerGroupsClient) Update(ctx context.Context, resourceGroupName string, containerGroupName string, resource *Resource) (result ContainerGroup, err error) { req, err := client.UpdatePreparer(ctx, resourceGroupName, containerGroupName, resource) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-02-01-preview/containerinstance/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-02-01-preview/containerinstance/models.go index 6b9f4ff71886..713d0e65463c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-02-01-preview/containerinstance/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-02-01-preview/containerinstance/models.go @@ -104,26 +104,27 @@ func (c *Container) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - 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 + } + c.Name = &name + } + case "properties": + if v != nil { + var containerProperties ContainerProperties + err = json.Unmarshal(*v, &containerProperties) + if err != nil { + return err + } + c.ContainerProperties = &containerProperties + } } - c.Name = &name - } - - v = m["properties"] - if v != nil { - var properties ContainerProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - c.ContainerProperties = &properties } return nil @@ -131,7 +132,8 @@ func (c *Container) UnmarshalJSON(body []byte) error { // ContainerGroup a container group. type ContainerGroup struct { - autorest.Response `json:"-"` + autorest.Response `json:"-"` + *ContainerGroupProperties `json:"properties,omitempty"` // ID - The resource id. ID *string `json:"id,omitempty"` // Name - The resource name. @@ -141,77 +143,97 @@ type ContainerGroup struct { // Location - The resource location. Location *string `json:"location,omitempty"` // Tags - The resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - *ContainerGroupProperties `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for ContainerGroup struct. -func (cg *ContainerGroup) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for ContainerGroup. +func (cg ContainerGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cg.ContainerGroupProperties != nil { + objectMap["properties"] = cg.ContainerGroupProperties } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ContainerGroupProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - cg.ContainerGroupProperties = &properties + if cg.ID != nil { + objectMap["id"] = cg.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - cg.ID = &ID + if cg.Name != nil { + objectMap["name"] = cg.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - cg.Name = &name + if cg.Type != nil { + objectMap["type"] = cg.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - cg.Type = &typeVar + if cg.Location != nil { + objectMap["location"] = cg.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - cg.Location = &location + if cg.Tags != nil { + objectMap["tags"] = cg.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for ContainerGroup struct. +func (cg *ContainerGroup) 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 "properties": + if v != nil { + var containerGroupProperties ContainerGroupProperties + err = json.Unmarshal(*v, &containerGroupProperties) + if err != nil { + return err + } + cg.ContainerGroupProperties = &containerGroupProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cg.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cg.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cg.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + cg.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + cg.Tags = tags + } } - cg.Tags = &tags } return nil @@ -490,7 +512,8 @@ type OperationDisplay struct { Description *string `json:"description,omitempty"` } -// OperationListResult the operation list response that contains all operations for Azure Container Instance service. +// OperationListResult the operation list response that contains all operations for Azure Container Instance +// service. type OperationListResult struct { autorest.Response `json:"-"` // Value - The list of operations. @@ -518,7 +541,28 @@ type Resource struct { // Location - The resource location. Location *string `json:"location,omitempty"` // Tags - The resource tags. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.ID != nil { + objectMap["id"] = r.ID + } + if r.Name != nil { + objectMap["name"] = r.Name + } + if r.Type != nil { + objectMap["type"] = r.Type + } + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) } // ResourceLimits the resource limits. @@ -578,13 +622,32 @@ type Volume struct { // AzureFile - The Azure File volume. AzureFile *AzureFileVolume `json:"azureFile,omitempty"` // EmptyDir - The empty directory volume. - EmptyDir *map[string]interface{} `json:"emptyDir,omitempty"` + EmptyDir interface{} `json:"emptyDir,omitempty"` // Secret - The secret volume. - Secret *map[string]*string `json:"secret,omitempty"` + Secret map[string]*string `json:"secret"` // GitRepo - The git repo volume. GitRepo *GitRepoVolume `json:"gitRepo,omitempty"` } +// MarshalJSON is the custom marshaler for Volume. +func (vVar Volume) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vVar.Name != nil { + objectMap["name"] = vVar.Name + } + if vVar.AzureFile != nil { + objectMap["azureFile"] = vVar.AzureFile + } + objectMap["emptyDir"] = vVar.EmptyDir + if vVar.Secret != nil { + objectMap["secret"] = vVar.Secret + } + if vVar.GitRepo != nil { + objectMap["gitRepo"] = vVar.GitRepo + } + return json.Marshal(objectMap) +} + // VolumeMount the properties of the volume mount. type VolumeMount struct { // Name - The name of the volume mount. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-02-01-preview/containerinstance/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-02-01-preview/containerinstance/version.go index b39b4743ff8d..877004c00336 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-02-01-preview/containerinstance/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-02-01-preview/containerinstance/version.go @@ -1,5 +1,7 @@ package containerinstance +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package containerinstance // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta services" + return "Azure-SDK-For-Go/" + version.Number + " containerinstance/2018-02-01-preview" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2017-10-01/containerregistry/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2017-10-01/containerregistry/models.go index 00998f8f0e03..507c820aabda 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2017-10-01/containerregistry/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2017-10-01/containerregistry/models.go @@ -112,8 +112,8 @@ const ( Enabled WebhookStatus = "enabled" ) -// Actor the agent that initiated the event. For most situations, this could be from the authorization context of the -// request. +// Actor the agent that initiated the event. For most situations, this could be from the authorization context of +// the request. type Actor struct { // Name - The subject or username associated with the request context that generated the event. Name *string `json:"name,omitempty"` @@ -125,17 +125,29 @@ type CallbackConfig struct { // ServiceURI - The service URI for the webhook to post notifications. ServiceURI *string `json:"serviceUri,omitempty"` // CustomHeaders - Custom headers that will be added to the webhook notifications. - CustomHeaders *map[string]*string `json:"customHeaders,omitempty"` + CustomHeaders map[string]*string `json:"customHeaders"` +} + +// MarshalJSON is the custom marshaler for CallbackConfig. +func (cc CallbackConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cc.ServiceURI != nil { + objectMap["serviceUri"] = cc.ServiceURI + } + if cc.CustomHeaders != nil { + objectMap["customHeaders"] = cc.CustomHeaders + } + return json.Marshal(objectMap) } // Event the event for a webhook. type Event struct { - // ID - The event ID. - ID *string `json:"id,omitempty"` // EventRequestMessage - The event request message sent to the service URI. EventRequestMessage *EventRequestMessage `json:"eventRequestMessage,omitempty"` // EventResponseMessage - The event response message received from the service URI. EventResponseMessage *EventResponseMessage `json:"eventResponseMessage,omitempty"` + // ID - The event ID. + ID *string `json:"id,omitempty"` } // EventContent the content of the event request message. @@ -270,7 +282,7 @@ type EventRequestMessage struct { // Content - The content of the event request message. Content *EventContent `json:"content,omitempty"` // Headers - The headers of the event request message. - Headers *map[string]*string `json:"headers,omitempty"` + Headers map[string]*string `json:"headers"` // Method - The HTTP method used to send the event request message. Method *string `json:"method,omitempty"` // RequestURI - The URI used to send the event request message. @@ -279,12 +291,33 @@ type EventRequestMessage struct { Version *string `json:"version,omitempty"` } +// MarshalJSON is the custom marshaler for EventRequestMessage. +func (erm EventRequestMessage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if erm.Content != nil { + objectMap["content"] = erm.Content + } + if erm.Headers != nil { + objectMap["headers"] = erm.Headers + } + if erm.Method != nil { + objectMap["method"] = erm.Method + } + if erm.RequestURI != nil { + objectMap["requestUri"] = erm.RequestURI + } + if erm.Version != nil { + objectMap["version"] = erm.Version + } + return json.Marshal(objectMap) +} + // EventResponseMessage the event response message received from the service URI. type EventResponseMessage struct { // Content - The content of the event response message. Content *string `json:"content,omitempty"` // Headers - The headers of the event response message. - Headers *map[string]*string `json:"headers,omitempty"` + Headers map[string]*string `json:"headers"` // ReasonPhrase - The reason phrase of the event response message. ReasonPhrase *string `json:"reasonPhrase,omitempty"` // StatusCode - The status code of the event response message. @@ -293,6 +326,27 @@ type EventResponseMessage struct { Version *string `json:"version,omitempty"` } +// MarshalJSON is the custom marshaler for EventResponseMessage. +func (erm EventResponseMessage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if erm.Content != nil { + objectMap["content"] = erm.Content + } + if erm.Headers != nil { + objectMap["headers"] = erm.Headers + } + if erm.ReasonPhrase != nil { + objectMap["reasonPhrase"] = erm.ReasonPhrase + } + if erm.StatusCode != nil { + objectMap["statusCode"] = erm.StatusCode + } + if erm.Version != nil { + objectMap["version"] = erm.Version + } + return json.Marshal(objectMap) +} + // OperationDefinition the definition of a container registry operation. type OperationDefinition struct { // Name - Operation name: {provider}/{resource}/{operation}. @@ -433,22 +487,39 @@ func (future RegistriesCreateFuture) Result(client RegistriesClient) (r Registry var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesCreateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return r, autorest.NewError("containerregistry.RegistriesCreateFuture", "Result", "asynchronous operation has not completed") + return r, azure.NewAsyncOpIncompleteError("containerregistry.RegistriesCreateFuture") } if future.PollingMethod() == azure.PollingLocation { r, err = client.CreateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesCreateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesCreateFuture", "Result", resp, "Failure sending request") return } r, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesCreateFuture", "Result", resp, "Failure responding to request") + } return } @@ -464,22 +535,39 @@ func (future RegistriesDeleteFuture) Result(client RegistriesClient) (ar autores var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("containerregistry.RegistriesDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("containerregistry.RegistriesDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -495,28 +583,49 @@ func (future RegistriesUpdateFuture) Result(client RegistriesClient) (r Registry var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return r, autorest.NewError("containerregistry.RegistriesUpdateFuture", "Result", "asynchronous operation has not completed") + return r, azure.NewAsyncOpIncompleteError("containerregistry.RegistriesUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { r, err = client.UpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesUpdateFuture", "Result", resp, "Failure sending request") return } r, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesUpdateFuture", "Result", resp, "Failure responding to request") + } return } // Registry an object that represents a container registry. type Registry struct { autorest.Response `json:"-"` + // Sku - The SKU of the container registry. + Sku *Sku `json:"sku,omitempty"` + // RegistryProperties - The properties of the container registry. + *RegistryProperties `json:"properties,omitempty"` // ID - The resource ID. ID *string `json:"id,omitempty"` // Name - The name of the resource. @@ -526,90 +635,109 @@ type Registry struct { // Location - The location of the resource. This cannot be changed after the resource is created. Location *string `json:"location,omitempty"` // Tags - The tags of the resource. - Tags *map[string]*string `json:"tags,omitempty"` - // Sku - The SKU of the container registry. - Sku *Sku `json:"sku,omitempty"` - // RegistryProperties - The properties of the container registry. - *RegistryProperties `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for Registry struct. -func (r *Registry) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for Registry. +func (r Registry) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.Sku != nil { + objectMap["sku"] = r.Sku } - var v *json.RawMessage - - v = m["sku"] - if v != nil { - var sku Sku - err = json.Unmarshal(*m["sku"], &sku) - if err != nil { - return err - } - r.Sku = &sku + if r.RegistryProperties != nil { + objectMap["properties"] = r.RegistryProperties } - - v = m["properties"] - if v != nil { - var properties RegistryProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - r.RegistryProperties = &properties + if r.ID != nil { + objectMap["id"] = r.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - r.ID = &ID + if r.Name != nil { + objectMap["name"] = r.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - r.Name = &name + if r.Type != nil { + objectMap["type"] = r.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - r.Type = &typeVar + if r.Location != nil { + objectMap["location"] = r.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - r.Location = &location + if r.Tags != nil { + objectMap["tags"] = r.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for Registry struct. +func (r *Registry) 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 "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + r.Sku = &sku + } + case "properties": + if v != nil { + var registryProperties RegistryProperties + err = json.Unmarshal(*v, ®istryProperties) + if err != nil { + return err + } + r.RegistryProperties = ®istryProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + r.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + r.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + r.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + r.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + r.Tags = tags + } } - r.Tags = &tags } return nil @@ -780,13 +908,28 @@ type RegistryPropertiesUpdateParameters struct { // RegistryUpdateParameters the parameters for updating a container registry. type RegistryUpdateParameters struct { // Tags - The tags for the container registry. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` // Sku - The SKU of the container registry. Sku *Sku `json:"sku,omitempty"` // RegistryPropertiesUpdateParameters - The properties that the container registry will be updated with. *RegistryPropertiesUpdateParameters `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for RegistryUpdateParameters. +func (rup RegistryUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rup.Tags != nil { + objectMap["tags"] = rup.Tags + } + if rup.Sku != nil { + objectMap["sku"] = rup.Sku + } + if rup.RegistryPropertiesUpdateParameters != nil { + objectMap["properties"] = rup.RegistryPropertiesUpdateParameters + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for RegistryUpdateParameters struct. func (rup *RegistryUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -794,36 +937,36 @@ func (rup *RegistryUpdateParameters) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - rup.Tags = &tags - } - - v = m["sku"] - if v != nil { - var sku Sku - err = json.Unmarshal(*m["sku"], &sku) - if err != nil { - return err - } - rup.Sku = &sku - } - - v = m["properties"] - if v != nil { - var properties RegistryPropertiesUpdateParameters - err = json.Unmarshal(*m["properties"], &properties) - 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 + } + rup.Tags = tags + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + rup.Sku = &sku + } + case "properties": + if v != nil { + var registryPropertiesUpdateParameters RegistryPropertiesUpdateParameters + err = json.Unmarshal(*v, ®istryPropertiesUpdateParameters) + if err != nil { + return err + } + rup.RegistryPropertiesUpdateParameters = ®istryPropertiesUpdateParameters + } } - rup.RegistryPropertiesUpdateParameters = &properties } return nil @@ -851,6 +994,8 @@ type RegistryUsageListResult struct { // Replication an object that represents a replication for a container registry. type Replication struct { autorest.Response `json:"-"` + // ReplicationProperties - The properties of the replication. + *ReplicationProperties `json:"properties,omitempty"` // ID - The resource ID. ID *string `json:"id,omitempty"` // Name - The name of the resource. @@ -860,78 +1005,97 @@ type Replication struct { // Location - The location of the resource. This cannot be changed after the resource is created. Location *string `json:"location,omitempty"` // Tags - The tags of the resource. - Tags *map[string]*string `json:"tags,omitempty"` - // ReplicationProperties - The properties of the replication. - *ReplicationProperties `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for Replication struct. -func (r *Replication) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for Replication. +func (r Replication) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.ReplicationProperties != nil { + objectMap["properties"] = r.ReplicationProperties } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ReplicationProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - r.ReplicationProperties = &properties + if r.ID != nil { + objectMap["id"] = r.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - r.ID = &ID + if r.Name != nil { + objectMap["name"] = r.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - r.Name = &name + if r.Type != nil { + objectMap["type"] = r.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - r.Type = &typeVar + if r.Location != nil { + objectMap["location"] = r.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - r.Location = &location + if r.Tags != nil { + objectMap["tags"] = r.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for Replication struct. +func (r *Replication) 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 "properties": + if v != nil { + var replicationProperties ReplicationProperties + err = json.Unmarshal(*v, &replicationProperties) + if err != nil { + return err + } + r.ReplicationProperties = &replicationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + r.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + r.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + r.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + r.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + r.Tags = tags + } } - r.Tags = &tags } return nil @@ -1059,22 +1223,39 @@ func (future ReplicationsCreateFuture) Result(client ReplicationsClient) (r Repl var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsCreateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return r, autorest.NewError("containerregistry.ReplicationsCreateFuture", "Result", "asynchronous operation has not completed") + return r, azure.NewAsyncOpIncompleteError("containerregistry.ReplicationsCreateFuture") } if future.PollingMethod() == azure.PollingLocation { r, err = client.CreateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsCreateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsCreateFuture", "Result", resp, "Failure sending request") return } r, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsCreateFuture", "Result", resp, "Failure responding to request") + } return } @@ -1090,22 +1271,39 @@ func (future ReplicationsDeleteFuture) Result(client ReplicationsClient) (ar aut var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("containerregistry.ReplicationsDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("containerregistry.ReplicationsDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -1121,29 +1319,55 @@ func (future ReplicationsUpdateFuture) Result(client ReplicationsClient) (r Repl var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return r, autorest.NewError("containerregistry.ReplicationsUpdateFuture", "Result", "asynchronous operation has not completed") + return r, azure.NewAsyncOpIncompleteError("containerregistry.ReplicationsUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { r, err = client.UpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsUpdateFuture", "Result", resp, "Failure sending request") return } r, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsUpdateFuture", "Result", resp, "Failure responding to request") + } return } // ReplicationUpdateParameters the parameters for updating a replication. type ReplicationUpdateParameters struct { // Tags - The tags for the replication. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ReplicationUpdateParameters. +func (rup ReplicationUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rup.Tags != nil { + objectMap["tags"] = rup.Tags + } + return json.Marshal(objectMap) } // Request the request that generated the event. @@ -1171,7 +1395,28 @@ type Resource struct { // Location - The location of the resource. This cannot be changed after the resource is created. Location *string `json:"location,omitempty"` // Tags - The tags of the resource. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.ID != nil { + objectMap["id"] = r.ID + } + if r.Name != nil { + objectMap["name"] = r.Name + } + if r.Type != nil { + objectMap["type"] = r.Type + } + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) } // Sku the SKU of a container registry. @@ -1182,8 +1427,8 @@ type Sku struct { Tier SkuTier `json:"tier,omitempty"` } -// Source the registry node that generated the event. Put differently, while the actor initiates the event, the source -// generates it. +// Source the registry node that generated the event. Put differently, while the actor initiates the event, the +// source generates it. type Source struct { // Addr - The IP or hostname and the port of the registry node that generated the event. Generally, this will be resolved by os.Hostname() along with the running port. Addr *string `json:"addr,omitempty"` @@ -1201,8 +1446,8 @@ type Status struct { Timestamp *date.Time `json:"timestamp,omitempty"` } -// StorageAccountProperties the properties of a storage account for a container registry. Only applicable to Classic -// SKU. +// StorageAccountProperties the properties of a storage account for a container registry. Only applicable to +// Classic SKU. type StorageAccountProperties struct { // ID - The resource ID of the storage account. ID *string `json:"id,omitempty"` @@ -1229,6 +1474,8 @@ type Target struct { // Webhook an object that represents a webhook for a container registry. type Webhook struct { autorest.Response `json:"-"` + // WebhookProperties - The properties of the webhook. + *WebhookProperties `json:"properties,omitempty"` // ID - The resource ID. ID *string `json:"id,omitempty"` // Name - The name of the resource. @@ -1238,78 +1485,97 @@ type Webhook struct { // Location - The location of the resource. This cannot be changed after the resource is created. Location *string `json:"location,omitempty"` // Tags - The tags of the resource. - Tags *map[string]*string `json:"tags,omitempty"` - // WebhookProperties - The properties of the webhook. - *WebhookProperties `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for Webhook struct. -func (w *Webhook) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for Webhook. +func (w Webhook) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if w.WebhookProperties != nil { + objectMap["properties"] = w.WebhookProperties } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties WebhookProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - w.WebhookProperties = &properties + if w.ID != nil { + objectMap["id"] = w.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - w.ID = &ID + if w.Name != nil { + objectMap["name"] = w.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - w.Name = &name + if w.Type != nil { + objectMap["type"] = w.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - w.Type = &typeVar + if w.Location != nil { + objectMap["location"] = w.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - w.Location = &location + if w.Tags != nil { + objectMap["tags"] = w.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for Webhook struct. +func (w *Webhook) 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 "properties": + if v != nil { + var webhookProperties WebhookProperties + err = json.Unmarshal(*v, &webhookProperties) + if err != nil { + return err + } + w.WebhookProperties = &webhookProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + w.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + w.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + w.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + w.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + w.Tags = tags + } } - w.Tags = &tags } return nil @@ -1318,13 +1584,28 @@ func (w *Webhook) UnmarshalJSON(body []byte) error { // WebhookCreateParameters the parameters for creating a webhook. type WebhookCreateParameters struct { // Tags - The tags for the webhook. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` // Location - The location of the webhook. This cannot be changed after the resource is created. Location *string `json:"location,omitempty"` // WebhookPropertiesCreateParameters - The properties that the webhook will be created with. *WebhookPropertiesCreateParameters `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for WebhookCreateParameters. +func (wcp WebhookCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wcp.Tags != nil { + objectMap["tags"] = wcp.Tags + } + if wcp.Location != nil { + objectMap["location"] = wcp.Location + } + if wcp.WebhookPropertiesCreateParameters != nil { + objectMap["properties"] = wcp.WebhookPropertiesCreateParameters + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for WebhookCreateParameters struct. func (wcp *WebhookCreateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -1332,36 +1613,36 @@ func (wcp *WebhookCreateParameters) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - wcp.Tags = &tags - } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - wcp.Location = &location - } - - v = m["properties"] - if v != nil { - var properties WebhookPropertiesCreateParameters - err = json.Unmarshal(*m["properties"], &properties) - 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 + } + wcp.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + wcp.Location = &location + } + case "properties": + if v != nil { + var webhookPropertiesCreateParameters WebhookPropertiesCreateParameters + err = json.Unmarshal(*v, &webhookPropertiesCreateParameters) + if err != nil { + return err + } + wcp.WebhookPropertiesCreateParameters = &webhookPropertiesCreateParameters + } } - wcp.WebhookPropertiesCreateParameters = &properties } return nil @@ -1486,7 +1767,7 @@ type WebhookPropertiesCreateParameters struct { // ServiceURI - The service URI for the webhook to post notifications. ServiceURI *string `json:"serviceUri,omitempty"` // CustomHeaders - Custom headers that will be added to the webhook notifications. - CustomHeaders *map[string]*string `json:"customHeaders,omitempty"` + CustomHeaders map[string]*string `json:"customHeaders"` // Status - The status of the webhook at the time the operation was called. Possible values include: 'Enabled', 'Disabled' Status WebhookStatus `json:"status,omitempty"` // Scope - The scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. @@ -1495,12 +1776,31 @@ type WebhookPropertiesCreateParameters struct { Actions *[]WebhookAction `json:"actions,omitempty"` } +// MarshalJSON is the custom marshaler for WebhookPropertiesCreateParameters. +func (wpcp WebhookPropertiesCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wpcp.ServiceURI != nil { + objectMap["serviceUri"] = wpcp.ServiceURI + } + if wpcp.CustomHeaders != nil { + objectMap["customHeaders"] = wpcp.CustomHeaders + } + objectMap["status"] = wpcp.Status + if wpcp.Scope != nil { + objectMap["scope"] = wpcp.Scope + } + if wpcp.Actions != nil { + objectMap["actions"] = wpcp.Actions + } + return json.Marshal(objectMap) +} + // WebhookPropertiesUpdateParameters the parameters for updating the properties of a webhook. type WebhookPropertiesUpdateParameters struct { // ServiceURI - The service URI for the webhook to post notifications. ServiceURI *string `json:"serviceUri,omitempty"` // CustomHeaders - Custom headers that will be added to the webhook notifications. - CustomHeaders *map[string]*string `json:"customHeaders,omitempty"` + CustomHeaders map[string]*string `json:"customHeaders"` // Status - The status of the webhook at the time the operation was called. Possible values include: 'Enabled', 'Disabled' Status WebhookStatus `json:"status,omitempty"` // Scope - The scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. @@ -1509,6 +1809,25 @@ type WebhookPropertiesUpdateParameters struct { Actions *[]WebhookAction `json:"actions,omitempty"` } +// MarshalJSON is the custom marshaler for WebhookPropertiesUpdateParameters. +func (wpup WebhookPropertiesUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wpup.ServiceURI != nil { + objectMap["serviceUri"] = wpup.ServiceURI + } + if wpup.CustomHeaders != nil { + objectMap["customHeaders"] = wpup.CustomHeaders + } + objectMap["status"] = wpup.Status + if wpup.Scope != nil { + objectMap["scope"] = wpup.Scope + } + if wpup.Actions != nil { + objectMap["actions"] = wpup.Actions + } + return json.Marshal(objectMap) +} + // WebhooksCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. type WebhooksCreateFuture struct { azure.Future @@ -1521,22 +1840,39 @@ func (future WebhooksCreateFuture) Result(client WebhooksClient) (w Webhook, err var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksCreateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return w, autorest.NewError("containerregistry.WebhooksCreateFuture", "Result", "asynchronous operation has not completed") + return w, azure.NewAsyncOpIncompleteError("containerregistry.WebhooksCreateFuture") } if future.PollingMethod() == azure.PollingLocation { w, err = client.CreateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksCreateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksCreateFuture", "Result", resp, "Failure sending request") return } w, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksCreateFuture", "Result", resp, "Failure responding to request") + } return } @@ -1552,22 +1888,39 @@ func (future WebhooksDeleteFuture) Result(client WebhooksClient) (ar autorest.Re var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("containerregistry.WebhooksDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("containerregistry.WebhooksDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -1583,33 +1936,62 @@ func (future WebhooksUpdateFuture) Result(client WebhooksClient) (w Webhook, err var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return w, autorest.NewError("containerregistry.WebhooksUpdateFuture", "Result", "asynchronous operation has not completed") + return w, azure.NewAsyncOpIncompleteError("containerregistry.WebhooksUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { w, err = client.UpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksUpdateFuture", "Result", resp, "Failure sending request") return } w, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksUpdateFuture", "Result", resp, "Failure responding to request") + } return } // WebhookUpdateParameters the parameters for updating a webhook. type WebhookUpdateParameters struct { // Tags - The tags for the webhook. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` // WebhookPropertiesUpdateParameters - The properties that the webhook will be updated with. *WebhookPropertiesUpdateParameters `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for WebhookUpdateParameters. +func (wup WebhookUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wup.Tags != nil { + objectMap["tags"] = wup.Tags + } + if wup.WebhookPropertiesUpdateParameters != nil { + objectMap["properties"] = wup.WebhookPropertiesUpdateParameters + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for WebhookUpdateParameters struct. func (wup *WebhookUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -1617,26 +1999,27 @@ func (wup *WebhookUpdateParameters) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - wup.Tags = &tags - } - - v = m["properties"] - if v != nil { - var properties WebhookPropertiesUpdateParameters - err = json.Unmarshal(*m["properties"], &properties) - 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 + } + wup.Tags = tags + } + case "properties": + if v != nil { + var webhookPropertiesUpdateParameters WebhookPropertiesUpdateParameters + err = json.Unmarshal(*v, &webhookPropertiesUpdateParameters) + if err != nil { + return err + } + wup.WebhookPropertiesUpdateParameters = &webhookPropertiesUpdateParameters + } } - wup.WebhookPropertiesUpdateParameters = &properties } return nil diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2017-10-01/containerregistry/registries.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2017-10-01/containerregistry/registries.go index da272dd7266c..8c20cca1c805 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2017-10-01/containerregistry/registries.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2017-10-01/containerregistry/registries.go @@ -53,7 +53,7 @@ func (client RegistriesClient) CheckNameAvailability(ctx context.Context, regist {Target: "registryNameCheckRequest.Name", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}, }}, {Target: "registryNameCheckRequest.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "containerregistry.RegistriesClient", "CheckNameAvailability") + return result, validation.NewError("containerregistry.RegistriesClient", "CheckNameAvailability", err.Error()) } req, err := client.CheckNameAvailabilityPreparer(ctx, registryNameCheckRequest) @@ -134,7 +134,7 @@ func (client RegistriesClient) Create(ctx context.Context, resourceGroupName str Chain: []validation.Constraint{{Target: "registry.RegistryProperties.StorageAccount", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "registry.RegistryProperties.StorageAccount.ID", Name: validation.Null, Rule: true, Chain: nil}}}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "containerregistry.RegistriesClient", "Create") + return result, validation.NewError("containerregistry.RegistriesClient", "Create", err.Error()) } req, err := client.CreatePreparer(ctx, resourceGroupName, registryName, registry) @@ -213,7 +213,7 @@ func (client RegistriesClient) Delete(ctx context.Context, resourceGroupName str Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "containerregistry.RegistriesClient", "Delete") + return result, validation.NewError("containerregistry.RegistriesClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, registryName) @@ -289,7 +289,7 @@ func (client RegistriesClient) Get(ctx context.Context, resourceGroupName string Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "containerregistry.RegistriesClient", "Get") + return result, validation.NewError("containerregistry.RegistriesClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, registryName) @@ -547,7 +547,7 @@ func (client RegistriesClient) ListCredentials(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "containerregistry.RegistriesClient", "ListCredentials") + return result, validation.NewError("containerregistry.RegistriesClient", "ListCredentials", err.Error()) } req, err := client.ListCredentialsPreparer(ctx, resourceGroupName, registryName) @@ -622,7 +622,7 @@ func (client RegistriesClient) ListUsages(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "containerregistry.RegistriesClient", "ListUsages") + return result, validation.NewError("containerregistry.RegistriesClient", "ListUsages", err.Error()) } req, err := client.ListUsagesPreparer(ctx, resourceGroupName, registryName) @@ -698,7 +698,7 @@ func (client RegistriesClient) RegenerateCredential(ctx context.Context, resourc Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "containerregistry.RegistriesClient", "RegenerateCredential") + return result, validation.NewError("containerregistry.RegistriesClient", "RegenerateCredential", err.Error()) } req, err := client.RegenerateCredentialPreparer(ctx, resourceGroupName, registryName, regenerateCredentialParameters) @@ -775,7 +775,7 @@ func (client RegistriesClient) Update(ctx context.Context, resourceGroupName str Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "containerregistry.RegistriesClient", "Update") + return result, validation.NewError("containerregistry.RegistriesClient", "Update", err.Error()) } req, err := client.UpdatePreparer(ctx, resourceGroupName, registryName, registryUpdateParameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2017-10-01/containerregistry/replications.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2017-10-01/containerregistry/replications.go index d2cc359b54f5..1e6e1191c353 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2017-10-01/containerregistry/replications.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2017-10-01/containerregistry/replications.go @@ -43,8 +43,8 @@ func NewReplicationsClientWithBaseURI(baseURI string, subscriptionID string) Rep // Create creates a replication for a container registry with the specified parameters. // // resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the -// name of the container registry. replicationName is the name of the replication. replication is the parameters for -// creating a replication. +// name of the container registry. replicationName is the name of the replication. replication is the parameters +// for creating a replication. func (client ReplicationsClient) Create(ctx context.Context, resourceGroupName string, registryName string, replicationName string, replication Replication) (result ReplicationsCreateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: registryName, @@ -55,7 +55,7 @@ func (client ReplicationsClient) Create(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "replicationName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "replicationName", Name: validation.MinLength, Rule: 5, Chain: nil}, {Target: "replicationName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "containerregistry.ReplicationsClient", "Create") + return result, validation.NewError("containerregistry.ReplicationsClient", "Create", err.Error()) } req, err := client.CreatePreparer(ctx, resourceGroupName, registryName, replicationName, replication) @@ -139,7 +139,7 @@ func (client ReplicationsClient) Delete(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "replicationName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "replicationName", Name: validation.MinLength, Rule: 5, Chain: nil}, {Target: "replicationName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "containerregistry.ReplicationsClient", "Delete") + return result, validation.NewError("containerregistry.ReplicationsClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, registryName, replicationName) @@ -220,7 +220,7 @@ func (client ReplicationsClient) Get(ctx context.Context, resourceGroupName stri Constraints: []validation.Constraint{{Target: "replicationName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "replicationName", Name: validation.MinLength, Rule: 5, Chain: nil}, {Target: "replicationName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "containerregistry.ReplicationsClient", "Get") + return result, validation.NewError("containerregistry.ReplicationsClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, registryName, replicationName) @@ -296,7 +296,7 @@ func (client ReplicationsClient) List(ctx context.Context, resourceGroupName str Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "containerregistry.ReplicationsClient", "List") + return result, validation.NewError("containerregistry.ReplicationsClient", "List", err.Error()) } result.fn = client.listNextResults @@ -392,8 +392,8 @@ func (client ReplicationsClient) ListComplete(ctx context.Context, resourceGroup // Update updates a replication for a container registry with the specified parameters. // // resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the -// name of the container registry. replicationName is the name of the replication. replicationUpdateParameters is the -// parameters for updating a replication. +// name of the container registry. replicationName is the name of the replication. replicationUpdateParameters is +// the parameters for updating a replication. func (client ReplicationsClient) Update(ctx context.Context, resourceGroupName string, registryName string, replicationName string, replicationUpdateParameters ReplicationUpdateParameters) (result ReplicationsUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: registryName, @@ -404,7 +404,7 @@ func (client ReplicationsClient) Update(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "replicationName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "replicationName", Name: validation.MinLength, Rule: 5, Chain: nil}, {Target: "replicationName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "containerregistry.ReplicationsClient", "Update") + return result, validation.NewError("containerregistry.ReplicationsClient", "Update", err.Error()) } req, err := client.UpdatePreparer(ctx, resourceGroupName, registryName, replicationName, replicationUpdateParameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2017-10-01/containerregistry/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2017-10-01/containerregistry/version.go index 6bb963ea624d..6245f7b38863 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2017-10-01/containerregistry/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2017-10-01/containerregistry/version.go @@ -1,5 +1,7 @@ package containerregistry +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package containerregistry // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta services" + return "Azure-SDK-For-Go/" + version.Number + " containerregistry/2017-10-01" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2017-10-01/containerregistry/webhooks.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2017-10-01/containerregistry/webhooks.go index a27af1cff4be..f86fbdde1970 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2017-10-01/containerregistry/webhooks.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2017-10-01/containerregistry/webhooks.go @@ -43,8 +43,8 @@ func NewWebhooksClientWithBaseURI(baseURI string, subscriptionID string) Webhook // Create creates a webhook for a container registry with the specified parameters. // // resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the -// name of the container registry. webhookName is the name of the webhook. webhookCreateParameters is the parameters -// for creating a webhook. +// name of the container registry. webhookName is the name of the webhook. webhookCreateParameters is the +// parameters for creating a webhook. func (client WebhooksClient) Create(ctx context.Context, resourceGroupName string, registryName string, webhookName string, webhookCreateParameters WebhookCreateParameters) (result WebhooksCreateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: registryName, @@ -61,7 +61,7 @@ func (client WebhooksClient) Create(ctx context.Context, resourceGroupName strin Chain: []validation.Constraint{{Target: "webhookCreateParameters.WebhookPropertiesCreateParameters.ServiceURI", Name: validation.Null, Rule: true, Chain: nil}, {Target: "webhookCreateParameters.WebhookPropertiesCreateParameters.Actions", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "containerregistry.WebhooksClient", "Create") + return result, validation.NewError("containerregistry.WebhooksClient", "Create", err.Error()) } req, err := client.CreatePreparer(ctx, resourceGroupName, registryName, webhookName, webhookCreateParameters) @@ -145,7 +145,7 @@ func (client WebhooksClient) Delete(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "webhookName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "webhookName", Name: validation.MinLength, Rule: 5, Chain: nil}, {Target: "webhookName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "containerregistry.WebhooksClient", "Delete") + return result, validation.NewError("containerregistry.WebhooksClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, registryName, webhookName) @@ -226,7 +226,7 @@ func (client WebhooksClient) Get(ctx context.Context, resourceGroupName string, Constraints: []validation.Constraint{{Target: "webhookName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "webhookName", Name: validation.MinLength, Rule: 5, Chain: nil}, {Target: "webhookName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "containerregistry.WebhooksClient", "Get") + return result, validation.NewError("containerregistry.WebhooksClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, registryName, webhookName) @@ -306,7 +306,7 @@ func (client WebhooksClient) GetCallbackConfig(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "webhookName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "webhookName", Name: validation.MinLength, Rule: 5, Chain: nil}, {Target: "webhookName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "containerregistry.WebhooksClient", "GetCallbackConfig") + return result, validation.NewError("containerregistry.WebhooksClient", "GetCallbackConfig", err.Error()) } req, err := client.GetCallbackConfigPreparer(ctx, resourceGroupName, registryName, webhookName) @@ -382,7 +382,7 @@ func (client WebhooksClient) List(ctx context.Context, resourceGroupName string, Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "containerregistry.WebhooksClient", "List") + return result, validation.NewError("containerregistry.WebhooksClient", "List", err.Error()) } result.fn = client.listNextResults @@ -489,7 +489,7 @@ func (client WebhooksClient) ListEvents(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "webhookName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "webhookName", Name: validation.MinLength, Rule: 5, Chain: nil}, {Target: "webhookName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "containerregistry.WebhooksClient", "ListEvents") + return result, validation.NewError("containerregistry.WebhooksClient", "ListEvents", err.Error()) } result.fn = client.listEventsNextResults @@ -597,7 +597,7 @@ func (client WebhooksClient) Ping(ctx context.Context, resourceGroupName string, Constraints: []validation.Constraint{{Target: "webhookName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "webhookName", Name: validation.MinLength, Rule: 5, Chain: nil}, {Target: "webhookName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "containerregistry.WebhooksClient", "Ping") + return result, validation.NewError("containerregistry.WebhooksClient", "Ping", err.Error()) } req, err := client.PingPreparer(ctx, resourceGroupName, registryName, webhookName) @@ -666,8 +666,8 @@ func (client WebhooksClient) PingResponder(resp *http.Response) (result EventInf // Update updates a webhook with the specified parameters. // // resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the -// name of the container registry. webhookName is the name of the webhook. webhookUpdateParameters is the parameters -// for updating a webhook. +// name of the container registry. webhookName is the name of the webhook. webhookUpdateParameters is the +// parameters for updating a webhook. func (client WebhooksClient) Update(ctx context.Context, resourceGroupName string, registryName string, webhookName string, webhookUpdateParameters WebhookUpdateParameters) (result WebhooksUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: registryName, @@ -678,7 +678,7 @@ func (client WebhooksClient) Update(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "webhookName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "webhookName", Name: validation.MinLength, Rule: 5, Chain: nil}, {Target: "webhookName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "containerregistry.WebhooksClient", "Update") + return result, validation.NewError("containerregistry.WebhooksClient", "Update", err.Error()) } req, err := client.UpdatePreparer(ctx, resourceGroupName, registryName, webhookName, webhookUpdateParameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-09-30/containerservice/containerservices.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-09-30/containerservice/containerservices.go index 6e39b2802187..3c85dc511939 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-09-30/containerservice/containerservices.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-09-30/containerservice/containerservices.go @@ -43,10 +43,10 @@ func NewContainerServicesClientWithBaseURI(baseURI string, subscriptionID string // CreateOrUpdate creates or updates a container service with the specified configuration of orchestrator, masters, and // agents. // -// resourceGroupName is the name of the resource group. containerServiceName is the name of the container service in -// the specified subscription and resource group. parameters is parameters supplied to the Create or Update a Container -// Service operation. -func (client ContainerServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, containerServiceName string, parameters ContainerService) (result ContainerServicesCreateOrUpdateFuture, err error) { +// resourceGroupName is the name of the resource group. containerServiceName is the name of the container service +// in the specified subscription and resource group. parameters is parameters supplied to the Create or Update a +// Container Service operation. +func (client ContainerServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, containerServiceName string, parameters ContainerService) (result ContainerServicesCreateOrUpdateFutureType, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: false, @@ -65,8 +65,7 @@ func (client ContainerServicesClient) CreateOrUpdate(ctx context.Context, resour {Target: "parameters.Properties.WindowsProfile", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.Properties.WindowsProfile.AdminUsername", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.Properties.WindowsProfile.AdminUsername", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([._]?[a-zA-Z0-9]+)*$`, Chain: nil}}}, - {Target: "parameters.Properties.WindowsProfile.AdminPassword", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.Properties.WindowsProfile.AdminPassword", Name: validation.Pattern, Rule: `^(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%\^&\*\(\)])[a-zA-Z\d!@#$%\^&\*\(\)]{12,123}$`, Chain: nil}}}, + {Target: "parameters.Properties.WindowsProfile.AdminPassword", Name: validation.Null, Rule: true, Chain: nil}, }}, {Target: "parameters.Properties.LinuxProfile", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.Properties.LinuxProfile.AdminUsername", Name: validation.Null, Rule: true, @@ -79,7 +78,7 @@ func (client ContainerServicesClient) CreateOrUpdate(ctx context.Context, resour Chain: []validation.Constraint{{Target: "parameters.Properties.DiagnosticsProfile.VMDiagnostics.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "containerservice.ContainerServicesClient", "CreateOrUpdate") + return result, validation.NewError("containerservice.ContainerServicesClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, containerServiceName, parameters) @@ -122,7 +121,7 @@ func (client ContainerServicesClient) CreateOrUpdatePreparer(ctx context.Context // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client ContainerServicesClient) CreateOrUpdateSender(req *http.Request) (future ContainerServicesCreateOrUpdateFuture, err error) { +func (client ContainerServicesClient) CreateOrUpdateSender(req *http.Request) (future ContainerServicesCreateOrUpdateFutureType, err error) { sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) future.Future = azure.NewFuture(req) future.req = req @@ -153,9 +152,9 @@ func (client ContainerServicesClient) CreateOrUpdateResponder(resp *http.Respons // availability sets. All the other resources created with the container service are part of the same resource group // and can be deleted individually. // -// resourceGroupName is the name of the resource group. containerServiceName is the name of the container service in -// the specified subscription and resource group. -func (client ContainerServicesClient) Delete(ctx context.Context, resourceGroupName string, containerServiceName string) (result ContainerServicesDeleteFuture, err error) { +// resourceGroupName is the name of the resource group. containerServiceName is the name of the container service +// in the specified subscription and resource group. +func (client ContainerServicesClient) Delete(ctx context.Context, resourceGroupName string, containerServiceName string) (result ContainerServicesDeleteFutureType, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, containerServiceName) if err != nil { err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "Delete", nil, "Failure preparing request") @@ -194,7 +193,7 @@ func (client ContainerServicesClient) DeletePreparer(ctx context.Context, resour // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. -func (client ContainerServicesClient) DeleteSender(req *http.Request) (future ContainerServicesDeleteFuture, err error) { +func (client ContainerServicesClient) DeleteSender(req *http.Request) (future ContainerServicesDeleteFutureType, err error) { sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) future.Future = azure.NewFuture(req) future.req = req @@ -223,8 +222,8 @@ func (client ContainerServicesClient) DeleteResponder(resp *http.Response) (resu // operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of masters // and agents. // -// resourceGroupName is the name of the resource group. containerServiceName is the name of the container service in -// the specified subscription and resource group. +// resourceGroupName is the name of the resource group. containerServiceName is the name of the container service +// in the specified subscription and resource group. func (client ContainerServicesClient) Get(ctx context.Context, resourceGroupName string, containerServiceName string) (result ContainerService, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, containerServiceName) if err != nil { @@ -477,8 +476,8 @@ func (client ContainerServicesClient) ListByResourceGroupComplete(ctx context.Co // ListOrchestrators gets a list of supported orchestrators in the specified subscription. The operation returns // properties of each orchestrator including verison and available upgrades. // -// location is the name of a supported Azure region. resourceType is resource type for which the list of orchestrators -// needs to be returned +// location is the name of a supported Azure region. resourceType is resource type for which the list of +// orchestrators needs to be returned func (client ContainerServicesClient) ListOrchestrators(ctx context.Context, location string, resourceType string) (result OrchestratorVersionProfileListResult, err error) { req, err := client.ListOrchestratorsPreparer(ctx, location, resourceType) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-09-30/containerservice/managedclusters.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-09-30/containerservice/managedclusters.go index ec4e1ba35fa2..3d0a6d863508 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-09-30/containerservice/managedclusters.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-09-30/containerservice/managedclusters.go @@ -63,7 +63,7 @@ func (client ManagedClustersClient) CreateOrUpdate(ctx context.Context, resource }}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "containerservice.ManagedClustersClient", "CreateOrUpdate") + return result, validation.NewError("containerservice.ManagedClustersClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-09-30/containerservice/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-09-30/containerservice/models.go index a071a68619f4..692440508d24 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-09-30/containerservice/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-09-30/containerservice/models.go @@ -360,6 +360,8 @@ type AgentPoolProfile struct { // ContainerService container service. type ContainerService struct { autorest.Response `json:"-"` + // Properties - Properties of the container service. + *Properties `json:"properties,omitempty"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name @@ -369,143 +371,197 @@ type ContainerService struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - // Properties - Properties of the container service. - *Properties `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for ContainerService struct. -func (cs *ContainerService) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for ContainerService. +func (cs ContainerService) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cs.Properties != nil { + objectMap["properties"] = cs.Properties } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties Properties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - cs.Properties = &properties + if cs.ID != nil { + objectMap["id"] = cs.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - cs.ID = &ID + if cs.Name != nil { + objectMap["name"] = cs.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - cs.Name = &name + if cs.Type != nil { + objectMap["type"] = cs.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - cs.Type = &typeVar + if cs.Location != nil { + objectMap["location"] = cs.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - cs.Location = &location + if cs.Tags != nil { + objectMap["tags"] = cs.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for ContainerService struct. +func (cs *ContainerService) 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 "properties": + if v != nil { + var properties Properties + err = json.Unmarshal(*v, &properties) + if err != nil { + return err + } + cs.Properties = &properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cs.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cs.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cs.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + cs.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + cs.Tags = tags + } } - cs.Tags = &tags } return nil } -// ContainerServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ContainerServicesCreateOrUpdateFuture struct { +// ContainerServicesCreateOrUpdateFutureType an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ContainerServicesCreateOrUpdateFutureType struct { azure.Future req *http.Request } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. -func (future ContainerServicesCreateOrUpdateFuture) Result(client ContainerServicesClient) (cs ContainerService, err error) { +func (future ContainerServicesCreateOrUpdateFutureType) Result(client ContainerServicesClient) (cs ContainerService, err error) { var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesCreateOrUpdateFutureType", "Result", future.Response(), "Polling failure") return } if !done { - return cs, autorest.NewError("containerservice.ContainerServicesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return cs, azure.NewAsyncOpIncompleteError("containerservice.ContainerServicesCreateOrUpdateFutureType") } if future.PollingMethod() == azure.PollingLocation { cs, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesCreateOrUpdateFutureType", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesCreateOrUpdateFutureType", "Result", resp, "Failure sending request") return } cs, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesCreateOrUpdateFutureType", "Result", resp, "Failure responding to request") + } return } -// ContainerServicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type ContainerServicesDeleteFuture struct { +// ContainerServicesDeleteFutureType an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ContainerServicesDeleteFutureType struct { azure.Future req *http.Request } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. -func (future ContainerServicesDeleteFuture) Result(client ContainerServicesClient) (ar autorest.Response, err error) { +func (future ContainerServicesDeleteFutureType) Result(client ContainerServicesClient) (ar autorest.Response, err error) { var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesDeleteFutureType", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("containerservice.ContainerServicesDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("containerservice.ContainerServicesDeleteFutureType") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesDeleteFutureType", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesDeleteFutureType", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesDeleteFutureType", "Result", resp, "Failure responding to request") + } return } @@ -644,6 +700,8 @@ func (page ListResultPage) Values() []ContainerService { // ManagedCluster managed cluster. type ManagedCluster struct { autorest.Response `json:"-"` + // ManagedClusterProperties - Properties of a managed cluster. + *ManagedClusterProperties `json:"properties,omitempty"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name @@ -653,78 +711,97 @@ type ManagedCluster struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - // ManagedClusterProperties - Properties of a managed cluster. - *ManagedClusterProperties `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for ManagedCluster struct. -func (mc *ManagedCluster) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for ManagedCluster. +func (mc ManagedCluster) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mc.ManagedClusterProperties != nil { + objectMap["properties"] = mc.ManagedClusterProperties } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ManagedClusterProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - mc.ManagedClusterProperties = &properties + if mc.ID != nil { + objectMap["id"] = mc.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - mc.ID = &ID + if mc.Name != nil { + objectMap["name"] = mc.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - mc.Name = &name + if mc.Type != nil { + objectMap["type"] = mc.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - mc.Type = &typeVar + if mc.Location != nil { + objectMap["location"] = mc.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - mc.Location = &location + if mc.Tags != nil { + objectMap["tags"] = mc.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for ManagedCluster struct. +func (mc *ManagedCluster) 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 "properties": + if v != nil { + var managedClusterProperties ManagedClusterProperties + err = json.Unmarshal(*v, &managedClusterProperties) + if err != nil { + return err + } + mc.ManagedClusterProperties = &managedClusterProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mc.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mc.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mc.Tags = tags + } } - mc.Tags = &tags } return nil @@ -733,6 +810,8 @@ func (mc *ManagedCluster) UnmarshalJSON(body []byte) error { // ManagedClusterAccessProfile managed cluster Access Profile. type ManagedClusterAccessProfile struct { autorest.Response `json:"-"` + // AccessProfile - AccessProfile of a managed cluster. + *AccessProfile `json:"properties,omitempty"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name @@ -742,78 +821,97 @@ type ManagedClusterAccessProfile struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - // AccessProfile - AccessProfile of a managed cluster. - *AccessProfile `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for ManagedClusterAccessProfile struct. -func (mcap *ManagedClusterAccessProfile) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for ManagedClusterAccessProfile. +func (mcap ManagedClusterAccessProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcap.AccessProfile != nil { + objectMap["properties"] = mcap.AccessProfile } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties AccessProfile - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - mcap.AccessProfile = &properties + if mcap.ID != nil { + objectMap["id"] = mcap.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - mcap.ID = &ID + if mcap.Name != nil { + objectMap["name"] = mcap.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - mcap.Name = &name + if mcap.Type != nil { + objectMap["type"] = mcap.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - mcap.Type = &typeVar + if mcap.Location != nil { + objectMap["location"] = mcap.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - mcap.Location = &location + if mcap.Tags != nil { + objectMap["tags"] = mcap.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for ManagedClusterAccessProfile struct. +func (mcap *ManagedClusterAccessProfile) 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 "properties": + if v != nil { + var accessProfile AccessProfile + err = json.Unmarshal(*v, &accessProfile) + if err != nil { + return err + } + mcap.AccessProfile = &accessProfile + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mcap.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mcap.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mcap.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mcap.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mcap.Tags = tags + } } - mcap.Tags = &tags } return nil @@ -964,26 +1062,44 @@ func (future ManagedClustersCreateOrUpdateFuture) Result(client ManagedClustersC var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return mc, autorest.NewError("containerservice.ManagedClustersCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return mc, azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { mc, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } mc, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } -// ManagedClustersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// ManagedClustersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type ManagedClustersDeleteFuture struct { azure.Future req *http.Request @@ -995,22 +1111,39 @@ func (future ManagedClustersDeleteFuture) Result(client ManagedClustersClient) ( var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("containerservice.ManagedClustersDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -1034,46 +1167,45 @@ func (mcup *ManagedClusterUpgradeProfile) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - mcup.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - mcup.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - mcup.Type = &typeVar - } - - v = m["properties"] - if v != nil { - var properties ManagedClusterUpgradeProfileProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mcup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mcup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mcup.Type = &typeVar + } + case "properties": + if v != nil { + var managedClusterUpgradeProfileProperties ManagedClusterUpgradeProfileProperties + err = json.Unmarshal(*v, &managedClusterUpgradeProfileProperties) + if err != nil { + return err + } + mcup.ManagedClusterUpgradeProfileProperties = &managedClusterUpgradeProfileProperties + } } - mcup.ManagedClusterUpgradeProfileProperties = &properties } return nil @@ -1155,46 +1287,45 @@ func (ovplr *OrchestratorVersionProfileListResult) UnmarshalJSON(body []byte) er if err != nil { return err } - var v *json.RawMessage - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - ovplr.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ovplr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ovplr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ovplr.Type = &typeVar + } + case "properties": + if v != nil { + var orchestratorVersionProfileProperties OrchestratorVersionProfileProperties + err = json.Unmarshal(*v, &orchestratorVersionProfileProperties) + if err != nil { + return err + } + ovplr.OrchestratorVersionProfileProperties = &orchestratorVersionProfileProperties + } } - ovplr.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - ovplr.Type = &typeVar - } - - v = m["properties"] - if v != nil { - var properties OrchestratorVersionProfileProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - ovplr.OrchestratorVersionProfileProperties = &properties } return nil @@ -1202,8 +1333,8 @@ func (ovplr *OrchestratorVersionProfileListResult) UnmarshalJSON(body []byte) er // OrchestratorVersionProfileProperties the properties of an orchestrator version profile. type OrchestratorVersionProfileProperties struct { - // Orchestrators - List of orchstrator version profiles. - Orchestrators *OrchestratorVersionProfile `json:"orchestrators,omitempty"` + // Orchestrators - List of orchestrator version profiles. + Orchestrators *[]OrchestratorVersionProfile `json:"orchestrators,omitempty"` } // Properties properties of the container service. @@ -1239,11 +1370,32 @@ type Resource struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.ID != nil { + objectMap["id"] = r.ID + } + if r.Name != nil { + objectMap["name"] = r.Name + } + if r.Type != nil { + objectMap["type"] = r.Type + } + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) } -// ServicePrincipalProfile information about a service principal identity for the cluster to use for manipulating Azure -// APIs. Either secret or keyVaultSecretRef must be specified. +// ServicePrincipalProfile information about a service principal identity for the cluster to use for manipulating +// Azure APIs. Either secret or keyVaultSecretRef must be specified. type ServicePrincipalProfile struct { // ClientID - The ID for the service principal. ClientID *string `json:"clientId,omitempty"` diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-09-30/containerservice/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-09-30/containerservice/version.go index 222437f11a20..550a9a973280 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-09-30/containerservice/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-09-30/containerservice/version.go @@ -1,5 +1,7 @@ package containerservice +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package containerservice // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta services" + return "Azure-SDK-For-Go/" + version.Number + " containerservice/2017-09-30" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/client.go index ac4b28daee09..8799ab4fb9c6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/client.go @@ -34,28 +34,18 @@ type BaseClient struct { autorest.Client BaseURI string SubscriptionID string - Filter string - Filter1 string - DatabaseRid string - CollectionRid string - Region string } // New creates an instance of the BaseClient client. -func New(subscriptionID string, filter string, filter1 string, databaseRid string, collectionRid string, region string) BaseClient { - return NewWithBaseURI(DefaultBaseURI, subscriptionID, filter, filter1, databaseRid, collectionRid, region) +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) } // NewWithBaseURI creates an instance of the BaseClient client. -func NewWithBaseURI(baseURI string, subscriptionID string, filter string, filter1 string, databaseRid string, collectionRid string, region string) BaseClient { +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return BaseClient{ Client: autorest.NewClientWithUserAgent(UserAgent()), BaseURI: baseURI, SubscriptionID: subscriptionID, - Filter: filter, - Filter1: filter1, - DatabaseRid: databaseRid, - CollectionRid: collectionRid, - Region: region, } } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/collection.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/collection.go index fa3e48ab7b1a..03a00d8d9492 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/collection.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/collection.go @@ -31,19 +31,20 @@ type CollectionClient struct { } // NewCollectionClient creates an instance of the CollectionClient client. -func NewCollectionClient(subscriptionID string, filter string, filter1 string, databaseRid string, collectionRid string, region string) CollectionClient { - return NewCollectionClientWithBaseURI(DefaultBaseURI, subscriptionID, filter, filter1, databaseRid, collectionRid, region) +func NewCollectionClient(subscriptionID string) CollectionClient { + return NewCollectionClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewCollectionClientWithBaseURI creates an instance of the CollectionClient client. -func NewCollectionClientWithBaseURI(baseURI string, subscriptionID string, filter string, filter1 string, databaseRid string, collectionRid string, region string) CollectionClient { - return CollectionClient{NewWithBaseURI(baseURI, subscriptionID, filter, filter1, databaseRid, collectionRid, region)} +func NewCollectionClientWithBaseURI(baseURI string, subscriptionID string) CollectionClient { + return CollectionClient{NewWithBaseURI(baseURI, subscriptionID)} } // ListMetricDefinitions retrieves metric defintions for the given collection. // // resourceGroupName is name of an Azure resource group. accountName is cosmos DB database account name. -func (client CollectionClient) ListMetricDefinitions(ctx context.Context, resourceGroupName string, accountName string) (result MetricDefinitionsListResult, err error) { +// databaseRid is cosmos DB database rid. collectionRid is cosmos DB collection rid. +func (client CollectionClient) ListMetricDefinitions(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string) (result MetricDefinitionsListResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, @@ -52,10 +53,10 @@ func (client CollectionClient) ListMetricDefinitions(ctx context.Context, resour {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "documentdb.CollectionClient", "ListMetricDefinitions") + return result, validation.NewError("documentdb.CollectionClient", "ListMetricDefinitions", err.Error()) } - req, err := client.ListMetricDefinitionsPreparer(ctx, resourceGroupName, accountName) + req, err := client.ListMetricDefinitionsPreparer(ctx, resourceGroupName, accountName, databaseRid, collectionRid) if err != nil { err = autorest.NewErrorWithError(err, "documentdb.CollectionClient", "ListMetricDefinitions", nil, "Failure preparing request") return @@ -77,11 +78,11 @@ func (client CollectionClient) ListMetricDefinitions(ctx context.Context, resour } // ListMetricDefinitionsPreparer prepares the ListMetricDefinitions request. -func (client CollectionClient) ListMetricDefinitionsPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { +func (client CollectionClient) ListMetricDefinitionsPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), - "collectionRid": autorest.Encode("path", client.CollectionRid), - "databaseRid": autorest.Encode("path", client.DatabaseRid), + "collectionRid": autorest.Encode("path", collectionRid), + "databaseRid": autorest.Encode("path", databaseRid), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -122,7 +123,11 @@ func (client CollectionClient) ListMetricDefinitionsResponder(resp *http.Respons // ListMetrics retrieves the metrics determined by the given filter for the given database account and collection. // // resourceGroupName is name of an Azure resource group. accountName is cosmos DB database account name. -func (client CollectionClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string) (result MetricListResult, err error) { +// databaseRid is cosmos DB database rid. collectionRid is cosmos DB collection rid. filter is an OData filter +// expression that describes a subset of metrics to return. The parameters that can be filtered are name.value +// (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported +// operator is eq. +func (client CollectionClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string) (result MetricListResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, @@ -131,10 +136,10 @@ func (client CollectionClient) ListMetrics(ctx context.Context, resourceGroupNam {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "documentdb.CollectionClient", "ListMetrics") + return result, validation.NewError("documentdb.CollectionClient", "ListMetrics", err.Error()) } - req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName) + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, databaseRid, collectionRid, filter) if err != nil { err = autorest.NewErrorWithError(err, "documentdb.CollectionClient", "ListMetrics", nil, "Failure preparing request") return @@ -156,18 +161,18 @@ func (client CollectionClient) ListMetrics(ctx context.Context, resourceGroupNam } // ListMetricsPreparer prepares the ListMetrics request. -func (client CollectionClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { +func (client CollectionClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), - "collectionRid": autorest.Encode("path", client.CollectionRid), - "databaseRid": autorest.Encode("path", client.DatabaseRid), + "collectionRid": autorest.Encode("path", collectionRid), + "databaseRid": autorest.Encode("path", databaseRid), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2015-04-08" queryParameters := map[string]interface{}{ - "$filter": autorest.Encode("query", client.Filter), + "$filter": autorest.Encode("query", filter), "api-version": APIVersion, } @@ -202,7 +207,10 @@ func (client CollectionClient) ListMetricsResponder(resp *http.Response) (result // ListUsages retrieves the usages (most recent storage data) for the given collection. // // resourceGroupName is name of an Azure resource group. accountName is cosmos DB database account name. -func (client CollectionClient) ListUsages(ctx context.Context, resourceGroupName string, accountName string) (result UsagesResult, err error) { +// databaseRid is cosmos DB database rid. collectionRid is cosmos DB collection rid. filter is an OData filter +// expression that describes a subset of usages to return. The supported parameter is name.value (name of the +// metric, can have an or of multiple names). +func (client CollectionClient) ListUsages(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string) (result UsagesResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, @@ -211,10 +219,10 @@ func (client CollectionClient) ListUsages(ctx context.Context, resourceGroupName {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "documentdb.CollectionClient", "ListUsages") + return result, validation.NewError("documentdb.CollectionClient", "ListUsages", err.Error()) } - req, err := client.ListUsagesPreparer(ctx, resourceGroupName, accountName) + req, err := client.ListUsagesPreparer(ctx, resourceGroupName, accountName, databaseRid, collectionRid, filter) if err != nil { err = autorest.NewErrorWithError(err, "documentdb.CollectionClient", "ListUsages", nil, "Failure preparing request") return @@ -236,11 +244,11 @@ func (client CollectionClient) ListUsages(ctx context.Context, resourceGroupName } // ListUsagesPreparer prepares the ListUsages request. -func (client CollectionClient) ListUsagesPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { +func (client CollectionClient) ListUsagesPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), - "collectionRid": autorest.Encode("path", client.CollectionRid), - "databaseRid": autorest.Encode("path", client.DatabaseRid), + "collectionRid": autorest.Encode("path", collectionRid), + "databaseRid": autorest.Encode("path", databaseRid), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -249,8 +257,8 @@ func (client CollectionClient) ListUsagesPreparer(ctx context.Context, resourceG queryParameters := map[string]interface{}{ "api-version": APIVersion, } - if len(client.Filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", client.Filter) + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) } preparer := autorest.CreatePreparer( diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/collectionpartition.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/collectionpartition.go new file mode 100644 index 000000000000..e895d340ce46 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/collectionpartition.go @@ -0,0 +1,210 @@ +package documentdb + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" + "net/http" +) + +// CollectionPartitionClient is the azure Cosmos DB Database Service Resource Provider REST API +type CollectionPartitionClient struct { + BaseClient +} + +// NewCollectionPartitionClient creates an instance of the CollectionPartitionClient client. +func NewCollectionPartitionClient(subscriptionID string) CollectionPartitionClient { + return NewCollectionPartitionClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCollectionPartitionClientWithBaseURI creates an instance of the CollectionPartitionClient client. +func NewCollectionPartitionClientWithBaseURI(baseURI string, subscriptionID string) CollectionPartitionClient { + return CollectionPartitionClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListMetrics retrieves the metrics determined by the given filter for the given collection, split by partition. +// +// resourceGroupName is name of an Azure resource group. accountName is cosmos DB database account name. +// databaseRid is cosmos DB database rid. collectionRid is cosmos DB collection rid. filter is an OData filter +// expression that describes a subset of metrics to return. The parameters that can be filtered are name.value +// (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported +// operator is eq. +func (client CollectionPartitionClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string) (result PartitionMetricListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {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: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CollectionPartitionClient", "ListMetrics", err.Error()) + } + + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, databaseRid, collectionRid, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionPartitionClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CollectionPartitionClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionPartitionClient", "ListMetrics", resp, "Failure responding to request") + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client CollectionPartitionClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionRid": autorest.Encode("path", collectionRid), + "databaseRid": autorest.Encode("path", databaseRid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-04-08" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client CollectionPartitionClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client CollectionPartitionClient) ListMetricsResponder(resp *http.Response) (result PartitionMetricListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListUsages retrieves the usages (most recent storage data) for the given collection, split by partition. +// +// resourceGroupName is name of an Azure resource group. accountName is cosmos DB database account name. +// databaseRid is cosmos DB database rid. collectionRid is cosmos DB collection rid. filter is an OData filter +// expression that describes a subset of usages to return. The supported parameter is name.value (name of the +// metric, can have an or of multiple names). +func (client CollectionPartitionClient) ListUsages(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string) (result PartitionUsagesResult, err error) { + if err := validation.Validate([]validation.Validation{ + {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: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CollectionPartitionClient", "ListUsages", err.Error()) + } + + req, err := client.ListUsagesPreparer(ctx, resourceGroupName, accountName, databaseRid, collectionRid, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionPartitionClient", "ListUsages", nil, "Failure preparing request") + return + } + + resp, err := client.ListUsagesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CollectionPartitionClient", "ListUsages", resp, "Failure sending request") + return + } + + result, err = client.ListUsagesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionPartitionClient", "ListUsages", resp, "Failure responding to request") + } + + return +} + +// ListUsagesPreparer prepares the ListUsages request. +func (client CollectionPartitionClient) ListUsagesPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionRid": autorest.Encode("path", collectionRid), + "databaseRid": autorest.Encode("path", databaseRid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-04-08" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/usages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListUsagesSender sends the ListUsages request. The method will close the +// http.Response Body if it receives an error. +func (client CollectionPartitionClient) ListUsagesSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListUsagesResponder handles the response to the ListUsages request. The method always +// closes the http.Response Body. +func (client CollectionPartitionClient) ListUsagesResponder(resp *http.Response) (result PartitionUsagesResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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/cosmos-db/mgmt/2015-04-08/documentdb/collectionpartitionregion.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/collectionpartitionregion.go new file mode 100644 index 000000000000..46e010eaebff --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/collectionpartitionregion.go @@ -0,0 +1,127 @@ +package documentdb + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" + "net/http" +) + +// CollectionPartitionRegionClient is the azure Cosmos DB Database Service Resource Provider REST API +type CollectionPartitionRegionClient struct { + BaseClient +} + +// NewCollectionPartitionRegionClient creates an instance of the CollectionPartitionRegionClient client. +func NewCollectionPartitionRegionClient(subscriptionID string) CollectionPartitionRegionClient { + return NewCollectionPartitionRegionClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCollectionPartitionRegionClientWithBaseURI creates an instance of the CollectionPartitionRegionClient client. +func NewCollectionPartitionRegionClientWithBaseURI(baseURI string, subscriptionID string) CollectionPartitionRegionClient { + return CollectionPartitionRegionClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListMetrics retrieves the metrics determined by the given filter for the given collection and region, split by +// partition. +// +// resourceGroupName is name of an Azure resource group. accountName is cosmos DB database account name. region is +// cosmos DB region, with spaces between words and each word capitalized. databaseRid is cosmos DB database rid. +// collectionRid is cosmos DB collection rid. filter is an OData filter expression that describes a subset of +// metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of +// multiple names), startTime, endTime, and timeGrain. The supported operator is eq. +func (client CollectionPartitionRegionClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, region string, databaseRid string, collectionRid string, filter string) (result PartitionMetricListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {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: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.CollectionPartitionRegionClient", "ListMetrics", err.Error()) + } + + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, region, databaseRid, collectionRid, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionPartitionRegionClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.CollectionPartitionRegionClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.CollectionPartitionRegionClient", "ListMetrics", resp, "Failure responding to request") + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client CollectionPartitionRegionClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, region string, databaseRid string, collectionRid string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionRid": autorest.Encode("path", collectionRid), + "databaseRid": autorest.Encode("path", databaseRid), + "region": autorest.Encode("path", region), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-04-08" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client CollectionPartitionRegionClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client CollectionPartitionRegionClient) ListMetricsResponder(resp *http.Response) (result PartitionMetricListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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/cosmos-db/mgmt/2015-04-08/documentdb/collectionregion.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/collectionregion.go index ec9b24cf6dc3..3dfcb252e1f5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/collectionregion.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/collectionregion.go @@ -31,20 +31,24 @@ type CollectionRegionClient struct { } // NewCollectionRegionClient creates an instance of the CollectionRegionClient client. -func NewCollectionRegionClient(subscriptionID string, filter string, filter1 string, databaseRid string, collectionRid string, region string) CollectionRegionClient { - return NewCollectionRegionClientWithBaseURI(DefaultBaseURI, subscriptionID, filter, filter1, databaseRid, collectionRid, region) +func NewCollectionRegionClient(subscriptionID string) CollectionRegionClient { + return NewCollectionRegionClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewCollectionRegionClientWithBaseURI creates an instance of the CollectionRegionClient client. -func NewCollectionRegionClientWithBaseURI(baseURI string, subscriptionID string, filter string, filter1 string, databaseRid string, collectionRid string, region string) CollectionRegionClient { - return CollectionRegionClient{NewWithBaseURI(baseURI, subscriptionID, filter, filter1, databaseRid, collectionRid, region)} +func NewCollectionRegionClientWithBaseURI(baseURI string, subscriptionID string) CollectionRegionClient { + return CollectionRegionClient{NewWithBaseURI(baseURI, subscriptionID)} } // ListMetrics retrieves the metrics determined by the given filter for the given database account, collection and // region. // -// resourceGroupName is name of an Azure resource group. accountName is cosmos DB database account name. -func (client CollectionRegionClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string) (result MetricListResult, err error) { +// resourceGroupName is name of an Azure resource group. accountName is cosmos DB database account name. region is +// cosmos DB region, with spaces between words and each word capitalized. databaseRid is cosmos DB database rid. +// collectionRid is cosmos DB collection rid. filter is an OData filter expression that describes a subset of +// metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of +// multiple names), startTime, endTime, and timeGrain. The supported operator is eq. +func (client CollectionRegionClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, region string, databaseRid string, collectionRid string, filter string) (result MetricListResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, @@ -53,10 +57,10 @@ func (client CollectionRegionClient) ListMetrics(ctx context.Context, resourceGr {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "documentdb.CollectionRegionClient", "ListMetrics") + return result, validation.NewError("documentdb.CollectionRegionClient", "ListMetrics", err.Error()) } - req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName) + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, region, databaseRid, collectionRid, filter) if err != nil { err = autorest.NewErrorWithError(err, "documentdb.CollectionRegionClient", "ListMetrics", nil, "Failure preparing request") return @@ -78,19 +82,19 @@ func (client CollectionRegionClient) ListMetrics(ctx context.Context, resourceGr } // ListMetricsPreparer prepares the ListMetrics request. -func (client CollectionRegionClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { +func (client CollectionRegionClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, region string, databaseRid string, collectionRid string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), - "collectionRid": autorest.Encode("path", client.CollectionRid), - "databaseRid": autorest.Encode("path", client.DatabaseRid), - "region": autorest.Encode("path", client.Region), + "collectionRid": autorest.Encode("path", collectionRid), + "databaseRid": autorest.Encode("path", databaseRid), + "region": autorest.Encode("path", region), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2015-04-08" queryParameters := map[string]interface{}{ - "$filter": autorest.Encode("query", client.Filter), + "$filter": autorest.Encode("query", filter), "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/database.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/database.go index 4af246c6d138..d0615b1a004c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/database.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/database.go @@ -31,19 +31,20 @@ type DatabaseClient struct { } // NewDatabaseClient creates an instance of the DatabaseClient client. -func NewDatabaseClient(subscriptionID string, filter string, filter1 string, databaseRid string, collectionRid string, region string) DatabaseClient { - return NewDatabaseClientWithBaseURI(DefaultBaseURI, subscriptionID, filter, filter1, databaseRid, collectionRid, region) +func NewDatabaseClient(subscriptionID string) DatabaseClient { + return NewDatabaseClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewDatabaseClientWithBaseURI creates an instance of the DatabaseClient client. -func NewDatabaseClientWithBaseURI(baseURI string, subscriptionID string, filter string, filter1 string, databaseRid string, collectionRid string, region string) DatabaseClient { - return DatabaseClient{NewWithBaseURI(baseURI, subscriptionID, filter, filter1, databaseRid, collectionRid, region)} +func NewDatabaseClientWithBaseURI(baseURI string, subscriptionID string) DatabaseClient { + return DatabaseClient{NewWithBaseURI(baseURI, subscriptionID)} } // ListMetricDefinitions retrieves metric defintions for the given database. // // resourceGroupName is name of an Azure resource group. accountName is cosmos DB database account name. -func (client DatabaseClient) ListMetricDefinitions(ctx context.Context, resourceGroupName string, accountName string) (result MetricDefinitionsListResult, err error) { +// databaseRid is cosmos DB database rid. +func (client DatabaseClient) ListMetricDefinitions(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (result MetricDefinitionsListResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, @@ -52,10 +53,10 @@ func (client DatabaseClient) ListMetricDefinitions(ctx context.Context, resource {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "documentdb.DatabaseClient", "ListMetricDefinitions") + return result, validation.NewError("documentdb.DatabaseClient", "ListMetricDefinitions", err.Error()) } - req, err := client.ListMetricDefinitionsPreparer(ctx, resourceGroupName, accountName) + req, err := client.ListMetricDefinitionsPreparer(ctx, resourceGroupName, accountName, databaseRid) if err != nil { err = autorest.NewErrorWithError(err, "documentdb.DatabaseClient", "ListMetricDefinitions", nil, "Failure preparing request") return @@ -77,10 +78,10 @@ func (client DatabaseClient) ListMetricDefinitions(ctx context.Context, resource } // ListMetricDefinitionsPreparer prepares the ListMetricDefinitions request. -func (client DatabaseClient) ListMetricDefinitionsPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { +func (client DatabaseClient) ListMetricDefinitionsPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), - "databaseRid": autorest.Encode("path", client.DatabaseRid), + "databaseRid": autorest.Encode("path", databaseRid), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -121,7 +122,10 @@ func (client DatabaseClient) ListMetricDefinitionsResponder(resp *http.Response) // ListMetrics retrieves the metrics determined by the given filter for the given database account and database. // // resourceGroupName is name of an Azure resource group. accountName is cosmos DB database account name. -func (client DatabaseClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string) (result MetricListResult, err error) { +// databaseRid is cosmos DB database rid. filter is an OData filter expression that describes a subset of metrics +// to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple +// names), startTime, endTime, and timeGrain. The supported operator is eq. +func (client DatabaseClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, filter string) (result MetricListResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, @@ -130,10 +134,10 @@ func (client DatabaseClient) ListMetrics(ctx context.Context, resourceGroupName {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "documentdb.DatabaseClient", "ListMetrics") + return result, validation.NewError("documentdb.DatabaseClient", "ListMetrics", err.Error()) } - req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName) + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, databaseRid, filter) if err != nil { err = autorest.NewErrorWithError(err, "documentdb.DatabaseClient", "ListMetrics", nil, "Failure preparing request") return @@ -155,17 +159,17 @@ func (client DatabaseClient) ListMetrics(ctx context.Context, resourceGroupName } // ListMetricsPreparer prepares the ListMetrics request. -func (client DatabaseClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { +func (client DatabaseClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), - "databaseRid": autorest.Encode("path", client.DatabaseRid), + "databaseRid": autorest.Encode("path", databaseRid), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2015-04-08" queryParameters := map[string]interface{}{ - "$filter": autorest.Encode("query", client.Filter), + "$filter": autorest.Encode("query", filter), "api-version": APIVersion, } @@ -200,7 +204,9 @@ func (client DatabaseClient) ListMetricsResponder(resp *http.Response) (result M // ListUsages retrieves the usages (most recent data) for the given database. // // resourceGroupName is name of an Azure resource group. accountName is cosmos DB database account name. -func (client DatabaseClient) ListUsages(ctx context.Context, resourceGroupName string, accountName string) (result UsagesResult, err error) { +// databaseRid is cosmos DB database rid. filter is an OData filter expression that describes a subset of usages to +// return. The supported parameter is name.value (name of the metric, can have an or of multiple names). +func (client DatabaseClient) ListUsages(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, filter string) (result UsagesResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, @@ -209,10 +215,10 @@ func (client DatabaseClient) ListUsages(ctx context.Context, resourceGroupName s {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "documentdb.DatabaseClient", "ListUsages") + return result, validation.NewError("documentdb.DatabaseClient", "ListUsages", err.Error()) } - req, err := client.ListUsagesPreparer(ctx, resourceGroupName, accountName) + req, err := client.ListUsagesPreparer(ctx, resourceGroupName, accountName, databaseRid, filter) if err != nil { err = autorest.NewErrorWithError(err, "documentdb.DatabaseClient", "ListUsages", nil, "Failure preparing request") return @@ -234,10 +240,10 @@ func (client DatabaseClient) ListUsages(ctx context.Context, resourceGroupName s } // ListUsagesPreparer prepares the ListUsages request. -func (client DatabaseClient) ListUsagesPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { +func (client DatabaseClient) ListUsagesPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), - "databaseRid": autorest.Encode("path", client.DatabaseRid), + "databaseRid": autorest.Encode("path", databaseRid), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -246,8 +252,8 @@ func (client DatabaseClient) ListUsagesPreparer(ctx context.Context, resourceGro queryParameters := map[string]interface{}{ "api-version": APIVersion, } - if len(client.Filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", client.Filter) + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) } preparer := autorest.CreatePreparer( diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/databaseaccountregion.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/databaseaccountregion.go index c5c3fb230d21..221bdc7cfbaa 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/databaseaccountregion.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/databaseaccountregion.go @@ -31,19 +31,22 @@ type DatabaseAccountRegionClient struct { } // NewDatabaseAccountRegionClient creates an instance of the DatabaseAccountRegionClient client. -func NewDatabaseAccountRegionClient(subscriptionID string, filter string, filter1 string, databaseRid string, collectionRid string, region string) DatabaseAccountRegionClient { - return NewDatabaseAccountRegionClientWithBaseURI(DefaultBaseURI, subscriptionID, filter, filter1, databaseRid, collectionRid, region) +func NewDatabaseAccountRegionClient(subscriptionID string) DatabaseAccountRegionClient { + return NewDatabaseAccountRegionClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewDatabaseAccountRegionClientWithBaseURI creates an instance of the DatabaseAccountRegionClient client. -func NewDatabaseAccountRegionClientWithBaseURI(baseURI string, subscriptionID string, filter string, filter1 string, databaseRid string, collectionRid string, region string) DatabaseAccountRegionClient { - return DatabaseAccountRegionClient{NewWithBaseURI(baseURI, subscriptionID, filter, filter1, databaseRid, collectionRid, region)} +func NewDatabaseAccountRegionClientWithBaseURI(baseURI string, subscriptionID string) DatabaseAccountRegionClient { + return DatabaseAccountRegionClient{NewWithBaseURI(baseURI, subscriptionID)} } // ListMetrics retrieves the metrics determined by the given filter for the given database account and region. // -// resourceGroupName is name of an Azure resource group. accountName is cosmos DB database account name. -func (client DatabaseAccountRegionClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string) (result MetricListResult, err error) { +// resourceGroupName is name of an Azure resource group. accountName is cosmos DB database account name. region is +// cosmos DB region, with spaces between words and each word capitalized. filter is an OData filter expression that +// describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, +// can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. +func (client DatabaseAccountRegionClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, region string, filter string) (result MetricListResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, @@ -52,10 +55,10 @@ func (client DatabaseAccountRegionClient) ListMetrics(ctx context.Context, resou {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "documentdb.DatabaseAccountRegionClient", "ListMetrics") + return result, validation.NewError("documentdb.DatabaseAccountRegionClient", "ListMetrics", err.Error()) } - req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName) + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, region, filter) if err != nil { err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountRegionClient", "ListMetrics", nil, "Failure preparing request") return @@ -77,17 +80,17 @@ func (client DatabaseAccountRegionClient) ListMetrics(ctx context.Context, resou } // ListMetricsPreparer prepares the ListMetrics request. -func (client DatabaseAccountRegionClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { +func (client DatabaseAccountRegionClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, region string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), - "region": autorest.Encode("path", client.Region), + "region": autorest.Encode("path", region), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2015-04-08" queryParameters := map[string]interface{}{ - "$filter": autorest.Encode("query", client.Filter), + "$filter": autorest.Encode("query", filter), "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/databaseaccounts.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/databaseaccounts.go index 6117a1205ac6..be57c56cb6c2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/databaseaccounts.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/databaseaccounts.go @@ -31,13 +31,13 @@ type DatabaseAccountsClient struct { } // NewDatabaseAccountsClient creates an instance of the DatabaseAccountsClient client. -func NewDatabaseAccountsClient(subscriptionID string, filter string, filter1 string, databaseRid string, collectionRid string, region string) DatabaseAccountsClient { - return NewDatabaseAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID, filter, filter1, databaseRid, collectionRid, region) +func NewDatabaseAccountsClient(subscriptionID string) DatabaseAccountsClient { + return NewDatabaseAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewDatabaseAccountsClientWithBaseURI creates an instance of the DatabaseAccountsClient client. -func NewDatabaseAccountsClientWithBaseURI(baseURI string, subscriptionID string, filter string, filter1 string, databaseRid string, collectionRid string, region string) DatabaseAccountsClient { - return DatabaseAccountsClient{NewWithBaseURI(baseURI, subscriptionID, filter, filter1, databaseRid, collectionRid, region)} +func NewDatabaseAccountsClientWithBaseURI(baseURI string, subscriptionID string) DatabaseAccountsClient { + return DatabaseAccountsClient{NewWithBaseURI(baseURI, subscriptionID)} } // CheckNameExists checks that the Azure Cosmos DB account name already exists. A valid account name may contain only @@ -49,7 +49,7 @@ func (client DatabaseAccountsClient) CheckNameExists(ctx context.Context, accoun {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "documentdb.DatabaseAccountsClient", "CheckNameExists") + return result, validation.NewError("documentdb.DatabaseAccountsClient", "CheckNameExists", err.Error()) } req, err := client.CheckNameExistsPreparer(ctx, accountName) @@ -139,7 +139,7 @@ func (client DatabaseAccountsClient) CreateOrUpdate(ctx context.Context, resourc {Target: "createUpdateParameters.DatabaseAccountCreateUpdateProperties.Locations", Name: validation.Null, Rule: true, Chain: nil}, {Target: "createUpdateParameters.DatabaseAccountCreateUpdateProperties.DatabaseAccountOfferType", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "documentdb.DatabaseAccountsClient", "CreateOrUpdate") + return result, validation.NewError("documentdb.DatabaseAccountsClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, accountName, createUpdateParameters) @@ -220,7 +220,7 @@ func (client DatabaseAccountsClient) Delete(ctx context.Context, resourceGroupNa {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "documentdb.DatabaseAccountsClient", "Delete") + return result, validation.NewError("documentdb.DatabaseAccountsClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, accountName) @@ -300,8 +300,10 @@ func (client DatabaseAccountsClient) FailoverPriorityChange(ctx context.Context, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, - {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "documentdb.DatabaseAccountsClient", "FailoverPriorityChange") + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: failoverParameters, + Constraints: []validation.Constraint{{Target: "failoverParameters.FailoverPolicies", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.DatabaseAccountsClient", "FailoverPriorityChange", err.Error()) } req, err := client.FailoverPriorityChangePreparer(ctx, resourceGroupName, accountName, failoverParameters) @@ -381,7 +383,7 @@ func (client DatabaseAccountsClient) Get(ctx context.Context, resourceGroupName {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "documentdb.DatabaseAccountsClient", "Get") + return result, validation.NewError("documentdb.DatabaseAccountsClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, accountName) @@ -517,7 +519,7 @@ func (client DatabaseAccountsClient) ListByResourceGroup(ctx context.Context, re 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.NewErrorWithValidationError(err, "documentdb.DatabaseAccountsClient", "ListByResourceGroup") + return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListByResourceGroup", err.Error()) } req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) @@ -593,7 +595,7 @@ func (client DatabaseAccountsClient) ListConnectionStrings(ctx context.Context, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "documentdb.DatabaseAccountsClient", "ListConnectionStrings") + return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListConnectionStrings", err.Error()) } req, err := client.ListConnectionStringsPreparer(ctx, resourceGroupName, accountName) @@ -670,7 +672,7 @@ func (client DatabaseAccountsClient) ListKeys(ctx context.Context, resourceGroup {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "documentdb.DatabaseAccountsClient", "ListKeys") + return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListKeys", err.Error()) } req, err := client.ListKeysPreparer(ctx, resourceGroupName, accountName) @@ -747,7 +749,7 @@ func (client DatabaseAccountsClient) ListMetricDefinitions(ctx context.Context, {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "documentdb.DatabaseAccountsClient", "ListMetricDefinitions") + return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListMetricDefinitions", err.Error()) } req, err := client.ListMetricDefinitionsPreparer(ctx, resourceGroupName, accountName) @@ -814,8 +816,11 @@ func (client DatabaseAccountsClient) ListMetricDefinitionsResponder(resp *http.R // ListMetrics retrieves the metrics determined by the given filter for the given database account. // -// resourceGroupName is name of an Azure resource group. accountName is cosmos DB database account name. -func (client DatabaseAccountsClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string) (result MetricListResult, err error) { +// resourceGroupName is name of an Azure resource group. accountName is cosmos DB database account name. filter is +// an OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are +// name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The +// supported operator is eq. +func (client DatabaseAccountsClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, filter string) (result MetricListResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, @@ -824,10 +829,10 @@ func (client DatabaseAccountsClient) ListMetrics(ctx context.Context, resourceGr {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "documentdb.DatabaseAccountsClient", "ListMetrics") + return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListMetrics", err.Error()) } - req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName) + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, filter) if err != nil { err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListMetrics", nil, "Failure preparing request") return @@ -849,7 +854,7 @@ func (client DatabaseAccountsClient) ListMetrics(ctx context.Context, resourceGr } // ListMetricsPreparer prepares the ListMetrics request. -func (client DatabaseAccountsClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { +func (client DatabaseAccountsClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -858,7 +863,7 @@ func (client DatabaseAccountsClient) ListMetricsPreparer(ctx context.Context, re const APIVersion = "2015-04-08" queryParameters := map[string]interface{}{ - "$filter": autorest.Encode("query", client.Filter), + "$filter": autorest.Encode("query", filter), "api-version": APIVersion, } @@ -902,7 +907,7 @@ func (client DatabaseAccountsClient) ListReadOnlyKeys(ctx context.Context, resou {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "documentdb.DatabaseAccountsClient", "ListReadOnlyKeys") + return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListReadOnlyKeys", err.Error()) } req, err := client.ListReadOnlyKeysPreparer(ctx, resourceGroupName, accountName) @@ -969,8 +974,10 @@ func (client DatabaseAccountsClient) ListReadOnlyKeysResponder(resp *http.Respon // ListUsages retrieves the usages (most recent data) for the given database account. // -// resourceGroupName is name of an Azure resource group. accountName is cosmos DB database account name. -func (client DatabaseAccountsClient) ListUsages(ctx context.Context, resourceGroupName string, accountName string) (result UsagesResult, err error) { +// resourceGroupName is name of an Azure resource group. accountName is cosmos DB database account name. filter is +// an OData filter expression that describes a subset of usages to return. The supported parameter is name.value +// (name of the metric, can have an or of multiple names). +func (client DatabaseAccountsClient) ListUsages(ctx context.Context, resourceGroupName string, accountName string, filter string) (result UsagesResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, @@ -979,10 +986,10 @@ func (client DatabaseAccountsClient) ListUsages(ctx context.Context, resourceGro {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "documentdb.DatabaseAccountsClient", "ListUsages") + return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListUsages", err.Error()) } - req, err := client.ListUsagesPreparer(ctx, resourceGroupName, accountName) + req, err := client.ListUsagesPreparer(ctx, resourceGroupName, accountName, filter) if err != nil { err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "ListUsages", nil, "Failure preparing request") return @@ -1004,7 +1011,7 @@ func (client DatabaseAccountsClient) ListUsages(ctx context.Context, resourceGro } // ListUsagesPreparer prepares the ListUsages request. -func (client DatabaseAccountsClient) ListUsagesPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { +func (client DatabaseAccountsClient) ListUsagesPreparer(ctx context.Context, resourceGroupName string, accountName string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -1015,8 +1022,8 @@ func (client DatabaseAccountsClient) ListUsagesPreparer(ctx context.Context, res queryParameters := map[string]interface{}{ "api-version": APIVersion, } - if len(client.Filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", client.Filter) + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) } preparer := autorest.CreatePreparer( @@ -1060,7 +1067,7 @@ func (client DatabaseAccountsClient) Patch(ctx context.Context, resourceGroupNam {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "documentdb.DatabaseAccountsClient", "Patch") + return result, validation.NewError("documentdb.DatabaseAccountsClient", "Patch", err.Error()) } req, err := client.PatchPreparer(ctx, resourceGroupName, accountName, updateParameters) @@ -1142,7 +1149,7 @@ func (client DatabaseAccountsClient) RegenerateKey(ctx context.Context, resource {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "documentdb.DatabaseAccountsClient", "RegenerateKey") + return result, validation.NewError("documentdb.DatabaseAccountsClient", "RegenerateKey", err.Error()) } req, err := client.RegenerateKeyPreparer(ctx, resourceGroupName, accountName, keyToRegenerate) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/models.go index a51d20af6263..2f1175929bee 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/models.go @@ -114,6 +114,12 @@ const ( Seconds UnitType = "Seconds" ) +// Capability cosmos DB capability object +type Capability struct { + // Name - Name of the Cosmos DB capability + Name *string `json:"name,omitempty"` +} + // ConsistencyPolicy the consistency policy for the Cosmos DB database account. type ConsistencyPolicy struct { // DefaultConsistencyLevel - The default consistency level and configuration settings of the Cosmos DB account. Possible values include: 'Eventual', 'Session', 'BoundedStaleness', 'Strong', 'ConsistentPrefix' @@ -127,6 +133,9 @@ type ConsistencyPolicy struct { // DatabaseAccount an Azure Cosmos DB database account. type DatabaseAccount struct { autorest.Response `json:"-"` + // Kind - Indicates the type of database account. This can only be set at database account creation. Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse' + Kind DatabaseAccountKind `json:"kind,omitempty"` + *DatabaseAccountProperties `json:"properties,omitempty"` // ID - The unique resource identifier of the database account. ID *string `json:"id,omitempty"` // Name - The name of the database account. @@ -134,90 +143,108 @@ type DatabaseAccount struct { // Type - The type of Azure resource. Type *string `json:"type,omitempty"` // Location - The location of the resource group to which the resource belongs. - Location *string `json:"location,omitempty"` - Tags *map[string]*string `json:"tags,omitempty"` - // Kind - Indicates the type of database account. This can only be set at database account creation. Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse' - Kind DatabaseAccountKind `json:"kind,omitempty"` - *DatabaseAccountProperties `json:"properties,omitempty"` + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for DatabaseAccount struct. -func (da *DatabaseAccount) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for DatabaseAccount. +func (da DatabaseAccount) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["kind"] = da.Kind + if da.DatabaseAccountProperties != nil { + objectMap["properties"] = da.DatabaseAccountProperties } - var v *json.RawMessage - - v = m["kind"] - if v != nil { - var kind DatabaseAccountKind - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - da.Kind = kind + if da.ID != nil { + objectMap["id"] = da.ID } - - v = m["properties"] - if v != nil { - var properties DatabaseAccountProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - da.DatabaseAccountProperties = &properties + if da.Name != nil { + objectMap["name"] = da.Name } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - da.ID = &ID + if da.Type != nil { + objectMap["type"] = da.Type } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - da.Name = &name + if da.Location != nil { + objectMap["location"] = da.Location } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - da.Type = &typeVar + if da.Tags != nil { + objectMap["tags"] = da.Tags } + return json.Marshal(objectMap) +} - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - da.Location = &location +// UnmarshalJSON is the custom unmarshaler for DatabaseAccount struct. +func (da *DatabaseAccount) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err + for k, v := range m { + switch k { + case "kind": + if v != nil { + var kind DatabaseAccountKind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + da.Kind = kind + } + case "properties": + if v != nil { + var databaseAccountProperties DatabaseAccountProperties + err = json.Unmarshal(*v, &databaseAccountProperties) + if err != nil { + return err + } + da.DatabaseAccountProperties = &databaseAccountProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + da.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + da.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + da.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + da.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + da.Tags = tags + } } - da.Tags = &tags } return nil @@ -233,6 +260,9 @@ type DatabaseAccountConnectionString struct { // DatabaseAccountCreateUpdateParameters parameters to create and update Cosmos DB database accounts. type DatabaseAccountCreateUpdateParameters struct { + // Kind - Indicates the type of database account. This can only be set at database account creation. Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse' + Kind DatabaseAccountKind `json:"kind,omitempty"` + *DatabaseAccountCreateUpdateProperties `json:"properties,omitempty"` // ID - The unique resource identifier of the database account. ID *string `json:"id,omitempty"` // Name - The name of the database account. @@ -240,90 +270,108 @@ type DatabaseAccountCreateUpdateParameters struct { // Type - The type of Azure resource. Type *string `json:"type,omitempty"` // Location - The location of the resource group to which the resource belongs. - Location *string `json:"location,omitempty"` - Tags *map[string]*string `json:"tags,omitempty"` - // Kind - Indicates the type of database account. This can only be set at database account creation. Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse' - Kind DatabaseAccountKind `json:"kind,omitempty"` - *DatabaseAccountCreateUpdateProperties `json:"properties,omitempty"` + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for DatabaseAccountCreateUpdateParameters struct. -func (dacup *DatabaseAccountCreateUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for DatabaseAccountCreateUpdateParameters. +func (dacup DatabaseAccountCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["kind"] = dacup.Kind + if dacup.DatabaseAccountCreateUpdateProperties != nil { + objectMap["properties"] = dacup.DatabaseAccountCreateUpdateProperties } - var v *json.RawMessage - - v = m["kind"] - if v != nil { - var kind DatabaseAccountKind - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - dacup.Kind = kind + if dacup.ID != nil { + objectMap["id"] = dacup.ID } - - v = m["properties"] - if v != nil { - var properties DatabaseAccountCreateUpdateProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - dacup.DatabaseAccountCreateUpdateProperties = &properties + if dacup.Name != nil { + objectMap["name"] = dacup.Name } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - dacup.ID = &ID + if dacup.Type != nil { + objectMap["type"] = dacup.Type } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - dacup.Name = &name + if dacup.Location != nil { + objectMap["location"] = dacup.Location } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - dacup.Type = &typeVar + if dacup.Tags != nil { + objectMap["tags"] = dacup.Tags } + return json.Marshal(objectMap) +} - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - dacup.Location = &location +// UnmarshalJSON is the custom unmarshaler for DatabaseAccountCreateUpdateParameters struct. +func (dacup *DatabaseAccountCreateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err + for k, v := range m { + switch k { + case "kind": + if v != nil { + var kind DatabaseAccountKind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + dacup.Kind = kind + } + case "properties": + if v != nil { + var databaseAccountCreateUpdateProperties DatabaseAccountCreateUpdateProperties + err = json.Unmarshal(*v, &databaseAccountCreateUpdateProperties) + if err != nil { + return err + } + dacup.DatabaseAccountCreateUpdateProperties = &databaseAccountCreateUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dacup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dacup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dacup.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dacup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dacup.Tags = tags + } } - dacup.Tags = &tags } return nil @@ -340,6 +388,8 @@ type DatabaseAccountCreateUpdateProperties struct { IPRangeFilter *string `json:"ipRangeFilter,omitempty"` // EnableAutomaticFailover - Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account. EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"` + // Capabilities - List of Cosmos DB capabilities for the account + Capabilities *[]Capability `json:"capabilities,omitempty"` } // DatabaseAccountListConnectionStringsResult the connection strings for the given database account. @@ -366,36 +416,36 @@ func (dalkr *DatabaseAccountListKeysResult) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["primaryMasterKey"] - if v != nil { - var primaryMasterKey string - err = json.Unmarshal(*m["primaryMasterKey"], &primaryMasterKey) - if err != nil { - return err + for k, v := range m { + switch k { + case "primaryMasterKey": + if v != nil { + var primaryMasterKey string + err = json.Unmarshal(*v, &primaryMasterKey) + if err != nil { + return err + } + dalkr.PrimaryMasterKey = &primaryMasterKey + } + case "secondaryMasterKey": + if v != nil { + var secondaryMasterKey string + err = json.Unmarshal(*v, &secondaryMasterKey) + if err != nil { + return err + } + dalkr.SecondaryMasterKey = &secondaryMasterKey + } + case "properties": + if v != nil { + var databaseAccountListReadOnlyKeysResult DatabaseAccountListReadOnlyKeysResult + err = json.Unmarshal(*v, &databaseAccountListReadOnlyKeysResult) + if err != nil { + return err + } + dalkr.DatabaseAccountListReadOnlyKeysResult = &databaseAccountListReadOnlyKeysResult + } } - dalkr.PrimaryMasterKey = &primaryMasterKey - } - - v = m["secondaryMasterKey"] - if v != nil { - var secondaryMasterKey string - err = json.Unmarshal(*m["secondaryMasterKey"], &secondaryMasterKey) - if err != nil { - return err - } - dalkr.SecondaryMasterKey = &secondaryMasterKey - } - - v = m["properties"] - if v != nil { - var properties DatabaseAccountListReadOnlyKeysResult - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - dalkr.DatabaseAccountListReadOnlyKeysResult = &properties } return nil @@ -412,7 +462,59 @@ type DatabaseAccountListReadOnlyKeysResult struct { // DatabaseAccountPatchParameters parameters for patching Azure Cosmos DB database account properties. type DatabaseAccountPatchParameters struct { - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` + *DatabaseAccountPatchProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for DatabaseAccountPatchParameters. +func (dapp DatabaseAccountPatchParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dapp.Tags != nil { + objectMap["tags"] = dapp.Tags + } + if dapp.DatabaseAccountPatchProperties != nil { + objectMap["properties"] = dapp.DatabaseAccountPatchProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DatabaseAccountPatchParameters struct. +func (dapp *DatabaseAccountPatchParameters) 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 + } + dapp.Tags = tags + } + case "properties": + if v != nil { + var databaseAccountPatchProperties DatabaseAccountPatchProperties + err = json.Unmarshal(*v, &databaseAccountPatchProperties) + if err != nil { + return err + } + dapp.DatabaseAccountPatchProperties = &databaseAccountPatchProperties + } + } + } + + return nil +} + +// DatabaseAccountPatchProperties properties to update Azure Cosmos DB database accounts. +type DatabaseAccountPatchProperties struct { + // Capabilities - List of Cosmos DB capabilities for the account + Capabilities *[]Capability `json:"capabilities,omitempty"` } // DatabaseAccountProperties properties for the database account. @@ -428,6 +530,8 @@ type DatabaseAccountProperties struct { EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"` // ConsistencyPolicy - The consistency policy for the Cosmos DB database account. ConsistencyPolicy *ConsistencyPolicy `json:"consistencyPolicy,omitempty"` + // Capabilities - List of Cosmos DB capabilities for the account + Capabilities *[]Capability `json:"capabilities,omitempty"` // WriteLocations - An array that contains the write location for the Cosmos DB account. WriteLocations *[]Location `json:"writeLocations,omitempty"` // ReadLocations - An array that contains of the read locations enabled for the Cosmos DB account. @@ -455,26 +559,44 @@ func (future DatabaseAccountsCreateOrUpdateFuture) Result(client DatabaseAccount var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return da, autorest.NewError("documentdb.DatabaseAccountsCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return da, azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { da, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } da, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } -// DatabaseAccountsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// DatabaseAccountsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type DatabaseAccountsDeleteFuture struct { azure.Future req *http.Request @@ -486,22 +608,39 @@ func (future DatabaseAccountsDeleteFuture) Result(client DatabaseAccountsClient) var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("documentdb.DatabaseAccountsDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -518,33 +657,52 @@ func (future DatabaseAccountsFailoverPriorityChangeFuture) Result(client Databas var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsFailoverPriorityChangeFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("documentdb.DatabaseAccountsFailoverPriorityChangeFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsFailoverPriorityChangeFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.FailoverPriorityChangeResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsFailoverPriorityChangeFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsFailoverPriorityChangeFuture", "Result", resp, "Failure sending request") return } ar, err = client.FailoverPriorityChangeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsFailoverPriorityChangeFuture", "Result", resp, "Failure responding to request") + } return } -// DatabaseAccountsListResult the List operation response, that contains the database accounts and their properties. +// DatabaseAccountsListResult the List operation response, that contains the database accounts and their +// properties. type DatabaseAccountsListResult struct { autorest.Response `json:"-"` // Value - List of database account and their properties. Value *[]DatabaseAccount `json:"value,omitempty"` } -// DatabaseAccountsPatchFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// DatabaseAccountsPatchFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type DatabaseAccountsPatchFuture struct { azure.Future req *http.Request @@ -556,22 +714,39 @@ func (future DatabaseAccountsPatchFuture) Result(client DatabaseAccountsClient) var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsPatchFuture", "Result", future.Response(), "Polling failure") return } if !done { - return da, autorest.NewError("documentdb.DatabaseAccountsPatchFuture", "Result", "asynchronous operation has not completed") + return da, azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsPatchFuture") } if future.PollingMethod() == azure.PollingLocation { da, err = client.PatchResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsPatchFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsPatchFuture", "Result", resp, "Failure sending request") return } da, err = client.PatchResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsPatchFuture", "Result", resp, "Failure responding to request") + } return } @@ -588,22 +763,39 @@ func (future DatabaseAccountsRegenerateKeyFuture) Result(client DatabaseAccounts var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsRegenerateKeyFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("documentdb.DatabaseAccountsRegenerateKeyFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsRegenerateKeyFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.RegenerateKeyResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsRegenerateKeyFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsRegenerateKeyFuture", "Result", resp, "Failure sending request") return } ar, err = client.RegenerateKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsRegenerateKeyFuture", "Result", resp, "Failure responding to request") + } return } @@ -732,8 +924,8 @@ type OperationDisplay struct { Description *string `json:"Description,omitempty"` } -// OperationListResult result of the request to list Resource Provider operations. It contains a list of operations and -// a URL link to get the next set of results. +// OperationListResult result of the request to list Resource Provider operations. It contains a list of operations +// and a URL link to get the next set of results. type OperationListResult struct { autorest.Response `json:"-"` // Value - List of operations supported by the Resource Provider. @@ -835,6 +1027,111 @@ func (page OperationListResultPage) Values() []Operation { return *page.olr.Value } +// PartitionMetric the metric values for a single partition. +type PartitionMetric struct { + // PartitionID - The parition id (GUID identifier) of the metric values. + PartitionID *string `json:"partitionId,omitempty"` + // PartitionKeyRangeID - The partition key range id (integer identifier) of the metric values. + PartitionKeyRangeID *string `json:"partitionKeyRangeId,omitempty"` + // StartTime - The start time for the metric (ISO-8601 format). + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time for the metric (ISO-8601 format). + EndTime *date.Time `json:"endTime,omitempty"` + // TimeGrain - The time grain to be used to summarize the metric values. + TimeGrain *string `json:"timeGrain,omitempty"` + // Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' + Unit UnitType `json:"unit,omitempty"` + // Name - The name information for the metric. + Name *MetricName `json:"name,omitempty"` + // MetricValues - The metric values for the specified time window and timestep. + MetricValues *[]MetricValue `json:"metricValues,omitempty"` +} + +// PartitionMetricListResult the response to a list partition metrics request. +type PartitionMetricListResult struct { + autorest.Response `json:"-"` + // Value - The list of partition-level metrics for the account. + Value *[]PartitionMetric `json:"value,omitempty"` +} + +// PartitionUsage the partition level usage data for a usage request. +type PartitionUsage struct { + // PartitionID - The parition id (GUID identifier) of the usages. + PartitionID *string `json:"partitionId,omitempty"` + // PartitionKeyRangeID - The partition key range id (integer identifier) of the usages. + PartitionKeyRangeID *string `json:"partitionKeyRangeId,omitempty"` + // Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' + Unit UnitType `json:"unit,omitempty"` + // Name - The name information for the metric. + Name *MetricName `json:"name,omitempty"` + // QuotaPeriod - The quota period used to summarize the usage values. + QuotaPeriod *string `json:"quotaPeriod,omitempty"` + // Limit - Maximum value for this metric + Limit *int32 `json:"limit,omitempty"` + // CurrentValue - Current value for this metric + CurrentValue *int32 `json:"currentValue,omitempty"` +} + +// PartitionUsagesResult the response to a list partition level usage request. +type PartitionUsagesResult struct { + autorest.Response `json:"-"` + // Value - The list of partition-level usages for the database. A usage is a point in time metric + Value *[]PartitionUsage `json:"value,omitempty"` +} + +// PercentileMetric percentile Metric data +type PercentileMetric struct { + // StartTime - The start time for the metric (ISO-8601 format). + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time for the metric (ISO-8601 format). + EndTime *date.Time `json:"endTime,omitempty"` + // TimeGrain - The time grain to be used to summarize the metric values. + TimeGrain *string `json:"timeGrain,omitempty"` + // Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' + Unit UnitType `json:"unit,omitempty"` + // Name - The name information for the metric. + Name *MetricName `json:"name,omitempty"` + // MetricValues - The percentile metric values for the specified time window and timestep. + MetricValues *[]PercentileMetricValue `json:"metricValues,omitempty"` +} + +// PercentileMetricListResult the response to a list percentile metrics request. +type PercentileMetricListResult struct { + autorest.Response `json:"-"` + // Value - The list of percentile metrics for the account. + Value *[]PercentileMetric `json:"value,omitempty"` +} + +// PercentileMetricValue represents percentile metrics values. +type PercentileMetricValue struct { + // P10 - The 10th percentile value for the metric. + P10 *float64 `json:"P10,omitempty"` + // P25 - The 25th percentile value for the metric. + P25 *float64 `json:"P25,omitempty"` + // P50 - The 50th percentile value for the metric. + P50 *float64 `json:"P50,omitempty"` + // P75 - The 75th percentile value for the metric. + P75 *float64 `json:"P75,omitempty"` + // P90 - The 90th percentile value for the metric. + P90 *float64 `json:"P90,omitempty"` + // P95 - The 95th percentile value for the metric. + P95 *float64 `json:"P95,omitempty"` + // P99 - The 99th percentile value for the metric. + P99 *float64 `json:"P99,omitempty"` + // Count - The number of values for the metric. + Count *float64 `json:"_count,omitempty"` + // Average - The average value of the metric. + Average *float64 `json:"average,omitempty"` + // Maximum - The max value of the metric. + Maximum *float64 `json:"maximum,omitempty"` + // Minimum - The min value of the metric. + Minimum *float64 `json:"minimum,omitempty"` + // Timestamp - The metric timestamp (ISO-8601 format). + Timestamp *date.Time `json:"timestamp,omitempty"` + // Total - The total value of the metric. + Total *float64 `json:"total,omitempty"` +} + // Resource a database account resource. type Resource struct { // ID - The unique resource identifier of the database account. @@ -844,8 +1141,29 @@ type Resource struct { // Type - The type of Azure resource. Type *string `json:"type,omitempty"` // Location - The location of the resource group to which the resource belongs. - Location *string `json:"location,omitempty"` - Tags *map[string]*string `json:"tags,omitempty"` + Location *string `json:"location,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.ID != nil { + objectMap["id"] = r.ID + } + if r.Name != nil { + objectMap["name"] = r.Name + } + if r.Type != nil { + objectMap["type"] = r.Type + } + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) } // Usage the usage data for a usage request. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/operations.go index af3cd181aa1f..776dd6f90907 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/operations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/operations.go @@ -30,13 +30,13 @@ type OperationsClient struct { } // NewOperationsClient creates an instance of the OperationsClient client. -func NewOperationsClient(subscriptionID string, filter string, filter1 string, databaseRid string, collectionRid string, region string) OperationsClient { - return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID, filter, filter1, databaseRid, collectionRid, region) +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewOperationsClientWithBaseURI creates an instance of the OperationsClient client. -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string, filter string, filter1 string, databaseRid string, collectionRid string, region string) OperationsClient { - return OperationsClient{NewWithBaseURI(baseURI, subscriptionID, filter, filter1, databaseRid, collectionRid, region)} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} } // List lists all of the available Cosmos DB Resource Provider operations. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/partitionkeyrangeid.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/partitionkeyrangeid.go new file mode 100644 index 000000000000..1de1a9805665 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/partitionkeyrangeid.go @@ -0,0 +1,126 @@ +package documentdb + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" + "net/http" +) + +// PartitionKeyRangeIDClient is the azure Cosmos DB Database Service Resource Provider REST API +type PartitionKeyRangeIDClient struct { + BaseClient +} + +// NewPartitionKeyRangeIDClient creates an instance of the PartitionKeyRangeIDClient client. +func NewPartitionKeyRangeIDClient(subscriptionID string) PartitionKeyRangeIDClient { + return NewPartitionKeyRangeIDClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPartitionKeyRangeIDClientWithBaseURI creates an instance of the PartitionKeyRangeIDClient client. +func NewPartitionKeyRangeIDClientWithBaseURI(baseURI string, subscriptionID string) PartitionKeyRangeIDClient { + return PartitionKeyRangeIDClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListMetrics retrieves the metrics determined by the given filter for the given partition key range id. +// +// resourceGroupName is name of an Azure resource group. accountName is cosmos DB database account name. +// databaseRid is cosmos DB database rid. collectionRid is cosmos DB collection rid. partitionKeyRangeID is +// partition Key Range Id for which to get data. filter is an OData filter expression that describes a subset of +// metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of +// multiple names), startTime, endTime, and timeGrain. The supported operator is eq. +func (client PartitionKeyRangeIDClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, partitionKeyRangeID string, filter string) (result PartitionMetricListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {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: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.PartitionKeyRangeIDClient", "ListMetrics", err.Error()) + } + + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, databaseRid, collectionRid, partitionKeyRangeID, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PartitionKeyRangeIDClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.PartitionKeyRangeIDClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PartitionKeyRangeIDClient", "ListMetrics", resp, "Failure responding to request") + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client PartitionKeyRangeIDClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, databaseRid string, collectionRid string, partitionKeyRangeID string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionRid": autorest.Encode("path", collectionRid), + "databaseRid": autorest.Encode("path", databaseRid), + "partitionKeyRangeId": autorest.Encode("path", partitionKeyRangeID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-04-08" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client PartitionKeyRangeIDClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client PartitionKeyRangeIDClient) ListMetricsResponder(resp *http.Response) (result PartitionMetricListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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/cosmos-db/mgmt/2015-04-08/documentdb/partitionkeyrangeidregion.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/partitionkeyrangeidregion.go new file mode 100644 index 000000000000..c3067ba51c17 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/partitionkeyrangeidregion.go @@ -0,0 +1,128 @@ +package documentdb + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" + "net/http" +) + +// PartitionKeyRangeIDRegionClient is the azure Cosmos DB Database Service Resource Provider REST API +type PartitionKeyRangeIDRegionClient struct { + BaseClient +} + +// NewPartitionKeyRangeIDRegionClient creates an instance of the PartitionKeyRangeIDRegionClient client. +func NewPartitionKeyRangeIDRegionClient(subscriptionID string) PartitionKeyRangeIDRegionClient { + return NewPartitionKeyRangeIDRegionClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPartitionKeyRangeIDRegionClientWithBaseURI creates an instance of the PartitionKeyRangeIDRegionClient client. +func NewPartitionKeyRangeIDRegionClientWithBaseURI(baseURI string, subscriptionID string) PartitionKeyRangeIDRegionClient { + return PartitionKeyRangeIDRegionClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListMetrics retrieves the metrics determined by the given filter for the given partition key range id and region. +// +// resourceGroupName is name of an Azure resource group. accountName is cosmos DB database account name. region is +// cosmos DB region, with spaces between words and each word capitalized. databaseRid is cosmos DB database rid. +// collectionRid is cosmos DB collection rid. partitionKeyRangeID is partition Key Range Id for which to get data. +// filter is an OData filter expression that describes a subset of metrics to return. The parameters that can be +// filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and +// timeGrain. The supported operator is eq. +func (client PartitionKeyRangeIDRegionClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, region string, databaseRid string, collectionRid string, partitionKeyRangeID string, filter string) (result PartitionMetricListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {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: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.PartitionKeyRangeIDRegionClient", "ListMetrics", err.Error()) + } + + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, region, databaseRid, collectionRid, partitionKeyRangeID, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PartitionKeyRangeIDRegionClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.PartitionKeyRangeIDRegionClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PartitionKeyRangeIDRegionClient", "ListMetrics", resp, "Failure responding to request") + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client PartitionKeyRangeIDRegionClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, region string, databaseRid string, collectionRid string, partitionKeyRangeID string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "collectionRid": autorest.Encode("path", collectionRid), + "databaseRid": autorest.Encode("path", databaseRid), + "partitionKeyRangeId": autorest.Encode("path", partitionKeyRangeID), + "region": autorest.Encode("path", region), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-04-08" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client PartitionKeyRangeIDRegionClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client PartitionKeyRangeIDRegionClient) ListMetricsResponder(resp *http.Response) (result PartitionMetricListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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/cosmos-db/mgmt/2015-04-08/documentdb/percentile.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/percentile.go new file mode 100644 index 000000000000..07ddaa7c7a3b --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/percentile.go @@ -0,0 +1,123 @@ +package documentdb + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" + "net/http" +) + +// PercentileClient is the azure Cosmos DB Database Service Resource Provider REST API +type PercentileClient struct { + BaseClient +} + +// NewPercentileClient creates an instance of the PercentileClient client. +func NewPercentileClient(subscriptionID string) PercentileClient { + return NewPercentileClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPercentileClientWithBaseURI creates an instance of the PercentileClient client. +func NewPercentileClientWithBaseURI(baseURI string, subscriptionID string) PercentileClient { + return PercentileClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListMetrics retrieves the metrics determined by the given filter for the given database account. This url is only +// for PBS and Replication Latency data +// +// resourceGroupName is name of an Azure resource group. accountName is cosmos DB database account name. filter is +// an OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are +// name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The +// supported operator is eq. +func (client PercentileClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, filter string) (result PercentileMetricListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {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: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.PercentileClient", "ListMetrics", err.Error()) + } + + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PercentileClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.PercentileClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PercentileClient", "ListMetrics", resp, "Failure responding to request") + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client PercentileClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, filter 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 = "2015-04-08" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/percentile/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client PercentileClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client PercentileClient) ListMetricsResponder(resp *http.Response) (result PercentileMetricListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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/cosmos-db/mgmt/2015-04-08/documentdb/percentilesourcetarget.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/percentilesourcetarget.go new file mode 100644 index 000000000000..f913350181f6 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/percentilesourcetarget.go @@ -0,0 +1,127 @@ +package documentdb + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" + "net/http" +) + +// PercentileSourceTargetClient is the azure Cosmos DB Database Service Resource Provider REST API +type PercentileSourceTargetClient struct { + BaseClient +} + +// NewPercentileSourceTargetClient creates an instance of the PercentileSourceTargetClient client. +func NewPercentileSourceTargetClient(subscriptionID string) PercentileSourceTargetClient { + return NewPercentileSourceTargetClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPercentileSourceTargetClientWithBaseURI creates an instance of the PercentileSourceTargetClient client. +func NewPercentileSourceTargetClientWithBaseURI(baseURI string, subscriptionID string) PercentileSourceTargetClient { + return PercentileSourceTargetClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListMetrics retrieves the metrics determined by the given filter for the given account, source and target region. +// This url is only for PBS and Replication Latency data +// +// resourceGroupName is name of an Azure resource group. accountName is cosmos DB database account name. +// sourceRegion is source region from which data is written. Cosmos DB region, with spaces between words and each +// word capitalized. targetRegion is target region to which data is written. Cosmos DB region, with spaces between +// words and each word capitalized. filter is an OData filter expression that describes a subset of metrics to +// return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple +// names), startTime, endTime, and timeGrain. The supported operator is eq. +func (client PercentileSourceTargetClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, sourceRegion string, targetRegion string, filter string) (result PercentileMetricListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {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: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.PercentileSourceTargetClient", "ListMetrics", err.Error()) + } + + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, sourceRegion, targetRegion, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PercentileSourceTargetClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.PercentileSourceTargetClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PercentileSourceTargetClient", "ListMetrics", resp, "Failure responding to request") + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client PercentileSourceTargetClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, sourceRegion string, targetRegion string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceRegion": autorest.Encode("path", sourceRegion), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "targetRegion": autorest.Encode("path", targetRegion), + } + + const APIVersion = "2015-04-08" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sourceRegion/{sourceRegion}/targetRegion/{targetRegion}/percentile/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client PercentileSourceTargetClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client PercentileSourceTargetClient) ListMetricsResponder(resp *http.Response) (result PercentileMetricListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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/cosmos-db/mgmt/2015-04-08/documentdb/percentiletarget.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/percentiletarget.go new file mode 100644 index 000000000000..1357b5dcd2ea --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/percentiletarget.go @@ -0,0 +1,125 @@ +package documentdb + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" + "net/http" +) + +// PercentileTargetClient is the azure Cosmos DB Database Service Resource Provider REST API +type PercentileTargetClient struct { + BaseClient +} + +// NewPercentileTargetClient creates an instance of the PercentileTargetClient client. +func NewPercentileTargetClient(subscriptionID string) PercentileTargetClient { + return NewPercentileTargetClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPercentileTargetClientWithBaseURI creates an instance of the PercentileTargetClient client. +func NewPercentileTargetClientWithBaseURI(baseURI string, subscriptionID string) PercentileTargetClient { + return PercentileTargetClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListMetrics retrieves the metrics determined by the given filter for the given account target region. This url is +// only for PBS and Replication Latency data +// +// resourceGroupName is name of an Azure resource group. accountName is cosmos DB database account name. +// targetRegion is target region to which data is written. Cosmos DB region, with spaces between words and each +// word capitalized. filter is an OData filter expression that describes a subset of metrics to return. The +// parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), +// startTime, endTime, and timeGrain. The supported operator is eq. +func (client PercentileTargetClient) ListMetrics(ctx context.Context, resourceGroupName string, accountName string, targetRegion string, filter string) (result PercentileMetricListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {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: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("documentdb.PercentileTargetClient", "ListMetrics", err.Error()) + } + + req, err := client.ListMetricsPreparer(ctx, resourceGroupName, accountName, targetRegion, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PercentileTargetClient", "ListMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "documentdb.PercentileTargetClient", "ListMetrics", resp, "Failure sending request") + return + } + + result, err = client.ListMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "documentdb.PercentileTargetClient", "ListMetrics", resp, "Failure responding to request") + } + + return +} + +// ListMetricsPreparer prepares the ListMetrics request. +func (client PercentileTargetClient) ListMetricsPreparer(ctx context.Context, resourceGroupName string, accountName string, targetRegion string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "targetRegion": autorest.Encode("path", targetRegion), + } + + const APIVersion = "2015-04-08" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/targetRegion/{targetRegion}/percentile/metrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetricsSender sends the ListMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client PercentileTargetClient) ListMetricsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetricsResponder handles the response to the ListMetrics request. The method always +// closes the http.Response Body. +func (client PercentileTargetClient) ListMetricsResponder(resp *http.Response) (result PercentileMetricListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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/cosmos-db/mgmt/2015-04-08/documentdb/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/version.go index 77008c4bcbfc..6fd89db64306 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/version.go @@ -1,5 +1,7 @@ package documentdb +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package documentdb // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta services" + return "Azure-SDK-For-Go/" + version.Number + " documentdb/2015-04-08" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2017-09-15-preview/eventgrid/eventsubscriptions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2017-09-15-preview/eventgrid/eventsubscriptions.go index 40aa40d4296d..9b6bb85dedaa 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2017-09-15-preview/eventgrid/eventsubscriptions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2017-09-15-preview/eventgrid/eventsubscriptions.go @@ -49,9 +49,9 @@ func NewEventSubscriptionsClientWithBaseURI(baseURI string, subscriptionID strin // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' // for a resource, and // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' -// for an EventGrid topic. eventSubscriptionName is name of the event subscription to be created. Event subscription -// names must be between 3 and 64 characters in length and use alphanumeric letters only. eventSubscriptionInfo is -// event subscription properties containing the destination and filter information +// for an EventGrid topic. eventSubscriptionName is name of the event subscription to be created. Event +// subscription names must be between 3 and 64 characters in length and use alphanumeric letters only. +// eventSubscriptionInfo is event subscription properties containing the destination and filter information func (client EventSubscriptionsClient) Create(ctx context.Context, scope string, eventSubscriptionName string, eventSubscriptionInfo EventSubscription) (result EventSubscriptionsCreateFuture, err error) { req, err := client.CreatePreparer(ctx, scope, eventSubscriptionName, eventSubscriptionInfo) if err != nil { @@ -120,8 +120,8 @@ func (client EventSubscriptionsClient) CreateResponder(resp *http.Response) (res // Delete delete an existing event subscription // -// scope is the scope of the event subscription. The scope can be a subscription, or a resource group, or a top level -// resource belonging to a resource provider namespace, or an EventGrid topic. For example, use +// scope is the scope of the event subscription. The scope can be a subscription, or a resource group, or a top +// level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use // '/subscriptions/{subscriptionId}/' for a subscription, // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' @@ -193,8 +193,8 @@ func (client EventSubscriptionsClient) DeleteResponder(resp *http.Response) (res // Get get properties of an event subscription // -// scope is the scope of the event subscription. The scope can be a subscription, or a resource group, or a top level -// resource belonging to a resource provider namespace, or an EventGrid topic. For example, use +// scope is the scope of the event subscription. The scope can be a subscription, or a resource group, or a top +// level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use // '/subscriptions/{subscriptionId}/' for a subscription, // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' @@ -265,8 +265,8 @@ func (client EventSubscriptionsClient) GetResponder(resp *http.Response) (result // GetFullURL get the full endpoint URL for an event subscription // -// scope is the scope of the event subscription. The scope can be a subscription, or a resource group, or a top level -// resource belonging to a resource provider namespace, or an EventGrid topic. For example, use +// scope is the scope of the event subscription. The scope can be a subscription, or a resource group, or a top +// level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use // '/subscriptions/{subscriptionId}/' for a subscription, // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' @@ -337,8 +337,9 @@ func (client EventSubscriptionsClient) GetFullURLResponder(resp *http.Response) // ListByResource list all event subscriptions that have been created for a specific topic // -// resourceGroupName is the name of the resource group within the user's subscription. providerNamespace is namespace -// of the provider of the topic resourceTypeName is name of the resource type resourceName is name of the resource +// resourceGroupName is the name of the resource group within the user's subscription. providerNamespace is +// namespace of the provider of the topic resourceTypeName is name of the resource type resourceName is name of the +// resource func (client EventSubscriptionsClient) ListByResource(ctx context.Context, resourceGroupName string, providerNamespace string, resourceTypeName string, resourceName string) (result EventSubscriptionsListResult, err error) { req, err := client.ListByResourcePreparer(ctx, resourceGroupName, providerNamespace, resourceTypeName, resourceName) if err != nil { @@ -668,7 +669,8 @@ func (client EventSubscriptionsClient) ListGlobalBySubscriptionForTopicTypeRespo // ListRegionalByResourceGroup list all event subscriptions from the given location under a specific Azure subscription // and resource group // -// resourceGroupName is the name of the resource group within the user's subscription. location is name of the location +// resourceGroupName is the name of the resource group within the user's subscription. location is name of the +// location func (client EventSubscriptionsClient) ListRegionalByResourceGroup(ctx context.Context, resourceGroupName string, location string) (result EventSubscriptionsListResult, err error) { req, err := client.ListRegionalByResourceGroupPreparer(ctx, resourceGroupName, location) if err != nil { @@ -735,8 +737,8 @@ func (client EventSubscriptionsClient) ListRegionalByResourceGroupResponder(resp // ListRegionalByResourceGroupForTopicType list all event subscriptions from the given location under a specific Azure // subscription and resource group and topic type // -// resourceGroupName is the name of the resource group within the user's subscription. location is name of the location -// topicTypeName is name of the topic type +// resourceGroupName is the name of the resource group within the user's subscription. location is name of the +// location topicTypeName is name of the topic type func (client EventSubscriptionsClient) ListRegionalByResourceGroupForTopicType(ctx context.Context, resourceGroupName string, location string, topicTypeName string) (result EventSubscriptionsListResult, err error) { req, err := client.ListRegionalByResourceGroupForTopicTypePreparer(ctx, resourceGroupName, location, topicTypeName) if err != nil { @@ -935,8 +937,8 @@ func (client EventSubscriptionsClient) ListRegionalBySubscriptionForTopicTypeRes // Update asynchronously updates an existing event subscription. // -// scope is the scope of existing event subscription. The scope can be a subscription, or a resource group, or a top -// level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use +// scope is the scope of existing event subscription. The scope can be a subscription, or a resource group, or a +// top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use // '/subscriptions/{subscriptionId}/' for a subscription, // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2017-09-15-preview/eventgrid/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2017-09-15-preview/eventgrid/models.go index 16bb258da9b9..84b469da07a5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2017-09-15-preview/eventgrid/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2017-09-15-preview/eventgrid/models.go @@ -114,21 +114,21 @@ const ( // EventHubEventSubscriptionDestination information about the event hub destination for an event subscription type EventHubEventSubscriptionDestination struct { - // EndpointType - Possible values include: 'EndpointTypeEventSubscriptionDestination', 'EndpointTypeWebHook', 'EndpointTypeEventHub' - EndpointType EndpointType `json:"endpointType,omitempty"` // EventHubEventSubscriptionDestinationProperties - Event Hub Properties of the event subscription destination *EventHubEventSubscriptionDestinationProperties `json:"properties,omitempty"` + // EndpointType - Possible values include: 'EndpointTypeEventSubscriptionDestination', 'EndpointTypeWebHook', 'EndpointTypeEventHub' + EndpointType EndpointType `json:"endpointType,omitempty"` } // MarshalJSON is the custom marshaler for EventHubEventSubscriptionDestination. func (ehesd EventHubEventSubscriptionDestination) MarshalJSON() ([]byte, error) { ehesd.EndpointType = EndpointTypeEventHub - type Alias EventHubEventSubscriptionDestination - return json.Marshal(&struct { - Alias - }{ - Alias: (Alias)(ehesd), - }) + objectMap := make(map[string]interface{}) + if ehesd.EventHubEventSubscriptionDestinationProperties != nil { + objectMap["properties"] = ehesd.EventHubEventSubscriptionDestinationProperties + } + objectMap["endpointType"] = ehesd.EndpointType + return json.Marshal(objectMap) } // AsWebHookEventSubscriptionDestination is the BasicEventSubscriptionDestination implementation for EventHubEventSubscriptionDestination. @@ -158,26 +158,27 @@ func (ehesd *EventHubEventSubscriptionDestination) UnmarshalJSON(body []byte) er if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties EventHubEventSubscriptionDestinationProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var eventHubEventSubscriptionDestinationProperties EventHubEventSubscriptionDestinationProperties + err = json.Unmarshal(*v, &eventHubEventSubscriptionDestinationProperties) + if err != nil { + return err + } + ehesd.EventHubEventSubscriptionDestinationProperties = &eventHubEventSubscriptionDestinationProperties + } + case "endpointType": + if v != nil { + var endpointType EndpointType + err = json.Unmarshal(*v, &endpointType) + if err != nil { + return err + } + ehesd.EndpointType = endpointType + } } - ehesd.EventHubEventSubscriptionDestinationProperties = &properties - } - - v = m["endpointType"] - if v != nil { - var endpointType EndpointType - err = json.Unmarshal(*m["endpointType"], &endpointType) - if err != nil { - return err - } - ehesd.EndpointType = endpointType } return nil @@ -192,14 +193,14 @@ type EventHubEventSubscriptionDestinationProperties struct { // EventSubscription event Subscription type EventSubscription struct { autorest.Response `json:"-"` + // EventSubscriptionProperties - Properties of the event subscription + *EventSubscriptionProperties `json:"properties,omitempty"` // ID - Fully qualified identifier of the resource ID *string `json:"id,omitempty"` // Name - Name of the resource Name *string `json:"name,omitempty"` // Type - Type of the resource Type *string `json:"type,omitempty"` - // EventSubscriptionProperties - Properties of the event subscription - *EventSubscriptionProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for EventSubscription struct. @@ -209,46 +210,45 @@ func (es *EventSubscription) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties EventSubscriptionProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var eventSubscriptionProperties EventSubscriptionProperties + err = json.Unmarshal(*v, &eventSubscriptionProperties) + if err != nil { + return err + } + es.EventSubscriptionProperties = &eventSubscriptionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + es.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + es.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + es.Type = &typeVar + } } - es.EventSubscriptionProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - es.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - es.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - es.Type = &typeVar } return nil @@ -311,12 +311,9 @@ func unmarshalBasicEventSubscriptionDestinationArray(body []byte) ([]BasicEventS // MarshalJSON is the custom marshaler for EventSubscriptionDestination. func (esd EventSubscriptionDestination) MarshalJSON() ([]byte, error) { esd.EndpointType = EndpointTypeEventSubscriptionDestination - type Alias EventSubscriptionDestination - return json.Marshal(&struct { - Alias - }{ - Alias: (Alias)(esd), - }) + objectMap := make(map[string]interface{}) + objectMap["endpointType"] = esd.EndpointType + return json.Marshal(objectMap) } // AsWebHookEventSubscriptionDestination is the BasicEventSubscriptionDestination implementation for EventSubscriptionDestination. @@ -384,61 +381,60 @@ func (esp *EventSubscriptionProperties) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["topic"] - if v != nil { - var topic string - err = json.Unmarshal(*m["topic"], &topic) - if err != nil { - return err - } - esp.Topic = &topic - } - - v = m["provisioningState"] - if v != nil { - var provisioningState EventSubscriptionProvisioningState - err = json.Unmarshal(*m["provisioningState"], &provisioningState) - if err != nil { - return err - } - esp.ProvisioningState = provisioningState - } - - v = m["destination"] - if v != nil { - destination, err := unmarshalBasicEventSubscriptionDestination(*m["destination"]) - if err != nil { - return err + for k, v := range m { + switch k { + case "topic": + if v != nil { + var topic string + err = json.Unmarshal(*v, &topic) + if err != nil { + return err + } + esp.Topic = &topic + } + case "provisioningState": + if v != nil { + var provisioningState EventSubscriptionProvisioningState + err = json.Unmarshal(*v, &provisioningState) + if err != nil { + return err + } + esp.ProvisioningState = provisioningState + } + case "destination": + if v != nil { + destination, err := unmarshalBasicEventSubscriptionDestination(*v) + if err != nil { + return err + } + esp.Destination = destination + } + case "filter": + if v != nil { + var filter EventSubscriptionFilter + err = json.Unmarshal(*v, &filter) + if err != nil { + return err + } + esp.Filter = &filter + } + case "labels": + if v != nil { + var labels []string + err = json.Unmarshal(*v, &labels) + if err != nil { + return err + } + esp.Labels = &labels + } } - esp.Destination = destination - } - - v = m["filter"] - if v != nil { - var filter EventSubscriptionFilter - err = json.Unmarshal(*m["filter"], &filter) - if err != nil { - return err - } - esp.Filter = &filter - } - - v = m["labels"] - if v != nil { - var labels []string - err = json.Unmarshal(*m["labels"], &labels) - if err != nil { - return err - } - esp.Labels = &labels } return nil } -// EventSubscriptionsCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// EventSubscriptionsCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type EventSubscriptionsCreateFuture struct { azure.Future req *http.Request @@ -450,26 +446,44 @@ func (future EventSubscriptionsCreateFuture) Result(client EventSubscriptionsCli var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsCreateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return es, autorest.NewError("eventgrid.EventSubscriptionsCreateFuture", "Result", "asynchronous operation has not completed") + return es, azure.NewAsyncOpIncompleteError("eventgrid.EventSubscriptionsCreateFuture") } if future.PollingMethod() == azure.PollingLocation { es, err = client.CreateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsCreateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsCreateFuture", "Result", resp, "Failure sending request") return } es, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsCreateFuture", "Result", resp, "Failure responding to request") + } return } -// EventSubscriptionsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// EventSubscriptionsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type EventSubscriptionsDeleteFuture struct { azure.Future req *http.Request @@ -481,22 +495,39 @@ func (future EventSubscriptionsDeleteFuture) Result(client EventSubscriptionsCli var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("eventgrid.EventSubscriptionsDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("eventgrid.EventSubscriptionsDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -507,7 +538,8 @@ type EventSubscriptionsListResult struct { Value *[]EventSubscription `json:"value,omitempty"` } -// EventSubscriptionsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// EventSubscriptionsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type EventSubscriptionsUpdateFuture struct { azure.Future req *http.Request @@ -519,22 +551,39 @@ func (future EventSubscriptionsUpdateFuture) Result(client EventSubscriptionsCli var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return es, autorest.NewError("eventgrid.EventSubscriptionsUpdateFuture", "Result", "asynchronous operation has not completed") + return es, azure.NewAsyncOpIncompleteError("eventgrid.EventSubscriptionsUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { es, err = client.UpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsUpdateFuture", "Result", resp, "Failure sending request") return } es, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.EventSubscriptionsUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -555,35 +604,35 @@ func (esup *EventSubscriptionUpdateParameters) UnmarshalJSON(body []byte) error if err != nil { return err } - var v *json.RawMessage - - v = m["destination"] - if v != nil { - destination, err := unmarshalBasicEventSubscriptionDestination(*m["destination"]) - if err != nil { - return err - } - esup.Destination = destination - } - - v = m["filter"] - if v != nil { - var filter EventSubscriptionFilter - err = json.Unmarshal(*m["filter"], &filter) - if err != nil { - return err - } - esup.Filter = &filter - } - - v = m["labels"] - if v != nil { - var labels []string - err = json.Unmarshal(*m["labels"], &labels) - if err != nil { - return err + for k, v := range m { + switch k { + case "destination": + if v != nil { + destination, err := unmarshalBasicEventSubscriptionDestination(*v) + if err != nil { + return err + } + esup.Destination = destination + } + case "filter": + if v != nil { + var filter EventSubscriptionFilter + err = json.Unmarshal(*v, &filter) + if err != nil { + return err + } + esup.Filter = &filter + } + case "labels": + if v != nil { + var labels []string + err = json.Unmarshal(*v, &labels) + if err != nil { + return err + } + esup.Labels = &labels + } } - esup.Labels = &labels } return nil @@ -591,14 +640,14 @@ func (esup *EventSubscriptionUpdateParameters) UnmarshalJSON(body []byte) error // EventType event Type for a subject under a topic type EventType struct { + // EventTypeProperties - Properties of the event type. + *EventTypeProperties `json:"properties,omitempty"` // ID - Fully qualified identifier of the resource ID *string `json:"id,omitempty"` // Name - Name of the resource Name *string `json:"name,omitempty"` // Type - Type of the resource Type *string `json:"type,omitempty"` - // EventTypeProperties - Properties of the event type. - *EventTypeProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for EventType struct. @@ -608,46 +657,45 @@ func (et *EventType) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties EventTypeProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - et.EventTypeProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var eventTypeProperties EventTypeProperties + err = json.Unmarshal(*v, &eventTypeProperties) + if err != nil { + return err + } + et.EventTypeProperties = &eventTypeProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + et.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + et.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + et.Type = &typeVar + } } - et.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - et.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - et.Type = &typeVar } return nil @@ -679,7 +727,7 @@ type Operation struct { // Origin - Origin of the operation. Possible values include: 'User', 'System', 'UserAndSystem' Origin OperationOrigin `json:"origin,omitempty"` // Properties - Properties of the operation - Properties *map[string]interface{} `json:"properties,omitempty"` + Properties interface{} `json:"properties,omitempty"` } // OperationInfo information about an operation @@ -714,87 +762,108 @@ type Resource struct { // Topic eventGrid Topic type Topic struct { autorest.Response `json:"-"` + // TopicProperties - Properties of the topic + *TopicProperties `json:"properties,omitempty"` + // Location - Location of the resource + Location *string `json:"location,omitempty"` + // Tags - Tags of the resource + Tags map[string]*string `json:"tags"` // ID - Fully qualified identifier of the resource ID *string `json:"id,omitempty"` // Name - Name of the resource Name *string `json:"name,omitempty"` // Type - Type of the resource Type *string `json:"type,omitempty"` - // Location - Location of the resource - Location *string `json:"location,omitempty"` - // Tags - Tags of the resource - Tags *map[string]*string `json:"tags,omitempty"` - // TopicProperties - Properties of the topic - *TopicProperties `json:"properties,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for Topic struct. -func (t *Topic) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for Topic. +func (t Topic) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if t.TopicProperties != nil { + objectMap["properties"] = t.TopicProperties } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties TopicProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - t.TopicProperties = &properties + if t.Location != nil { + objectMap["location"] = t.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - t.Location = &location + if t.Tags != nil { + objectMap["tags"] = t.Tags } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - t.Tags = &tags + if t.ID != nil { + objectMap["id"] = t.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - t.ID = &ID + if t.Name != nil { + objectMap["name"] = t.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - t.Name = &name + if t.Type != nil { + objectMap["type"] = t.Type } + return json.Marshal(objectMap) +} - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for Topic struct. +func (t *Topic) 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 "properties": + if v != nil { + var topicProperties TopicProperties + err = json.Unmarshal(*v, &topicProperties) + if err != nil { + return err + } + t.TopicProperties = &topicProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + t.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + t.Tags = tags + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + t.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + t.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + t.Type = &typeVar + } } - t.Type = &typeVar } return nil @@ -826,22 +895,39 @@ func (future TopicsCreateOrUpdateFuture) Result(client TopicsClient) (t Topic, e var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return t, autorest.NewError("eventgrid.TopicsCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return t, azure.NewAsyncOpIncompleteError("eventgrid.TopicsCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { t, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicsCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } t, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -857,22 +943,39 @@ func (future TopicsDeleteFuture) Result(client TopicsClient) (ar autorest.Respon var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicsDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("eventgrid.TopicsDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("eventgrid.TopicsDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicsDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicsDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicsDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -904,36 +1007,53 @@ func (future TopicsUpdateFuture) Result(client TopicsClient) (t Topic, err error var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicsUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return t, autorest.NewError("eventgrid.TopicsUpdateFuture", "Result", "asynchronous operation has not completed") + return t, azure.NewAsyncOpIncompleteError("eventgrid.TopicsUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { t, err = client.UpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicsUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicsUpdateFuture", "Result", resp, "Failure sending request") return } t, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventgrid.TopicsUpdateFuture", "Result", resp, "Failure responding to request") + } return } // TopicTypeInfo properties of a topic type info. type TopicTypeInfo struct { autorest.Response `json:"-"` + // TopicTypeProperties - Properties of the topic type info + *TopicTypeProperties `json:"properties,omitempty"` // ID - Fully qualified identifier of the resource ID *string `json:"id,omitempty"` // Name - Name of the resource Name *string `json:"name,omitempty"` // Type - Type of the resource Type *string `json:"type,omitempty"` - // TopicTypeProperties - Properties of the topic type info - *TopicTypeProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for TopicTypeInfo struct. @@ -943,46 +1063,45 @@ func (tti *TopicTypeInfo) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties TopicTypeProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var topicTypeProperties TopicTypeProperties + err = json.Unmarshal(*v, &topicTypeProperties) + if err != nil { + return err + } + tti.TopicTypeProperties = &topicTypeProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + tti.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + tti.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + tti.Type = &typeVar + } } - tti.TopicTypeProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - tti.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - tti.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - tti.Type = &typeVar } return nil @@ -1014,40 +1133,70 @@ type TopicTypesListResult struct { // TopicUpdateParameters properties of the Topic update type TopicUpdateParameters struct { // Tags - Tags of the resource - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for TopicUpdateParameters. +func (tup TopicUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tup.Tags != nil { + objectMap["tags"] = tup.Tags + } + return json.Marshal(objectMap) } // TrackedResource definition of a Tracked Resource type TrackedResource struct { + // Location - Location of the resource + Location *string `json:"location,omitempty"` + // Tags - Tags of the resource + Tags map[string]*string `json:"tags"` // ID - Fully qualified identifier of the resource ID *string `json:"id,omitempty"` // Name - Name of the resource Name *string `json:"name,omitempty"` // Type - Type of the resource Type *string `json:"type,omitempty"` - // Location - Location of the resource - Location *string `json:"location,omitempty"` - // Tags - Tags of the resource - Tags *map[string]*string `json:"tags,omitempty"` +} + +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Location != nil { + objectMap["location"] = tr.Location + } + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.ID != nil { + objectMap["id"] = tr.ID + } + if tr.Name != nil { + objectMap["name"] = tr.Name + } + if tr.Type != nil { + objectMap["type"] = tr.Type + } + return json.Marshal(objectMap) } // WebHookEventSubscriptionDestination information about the webhook destination for an event subscription type WebHookEventSubscriptionDestination struct { - // EndpointType - Possible values include: 'EndpointTypeEventSubscriptionDestination', 'EndpointTypeWebHook', 'EndpointTypeEventHub' - EndpointType EndpointType `json:"endpointType,omitempty"` // WebHookEventSubscriptionDestinationProperties - WebHook Properties of the event subscription destination *WebHookEventSubscriptionDestinationProperties `json:"properties,omitempty"` + // EndpointType - Possible values include: 'EndpointTypeEventSubscriptionDestination', 'EndpointTypeWebHook', 'EndpointTypeEventHub' + EndpointType EndpointType `json:"endpointType,omitempty"` } // MarshalJSON is the custom marshaler for WebHookEventSubscriptionDestination. func (whesd WebHookEventSubscriptionDestination) MarshalJSON() ([]byte, error) { whesd.EndpointType = EndpointTypeWebHook - type Alias WebHookEventSubscriptionDestination - return json.Marshal(&struct { - Alias - }{ - Alias: (Alias)(whesd), - }) + objectMap := make(map[string]interface{}) + if whesd.WebHookEventSubscriptionDestinationProperties != nil { + objectMap["properties"] = whesd.WebHookEventSubscriptionDestinationProperties + } + objectMap["endpointType"] = whesd.EndpointType + return json.Marshal(objectMap) } // AsWebHookEventSubscriptionDestination is the BasicEventSubscriptionDestination implementation for WebHookEventSubscriptionDestination. @@ -1077,26 +1226,27 @@ func (whesd *WebHookEventSubscriptionDestination) UnmarshalJSON(body []byte) err if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties WebHookEventSubscriptionDestinationProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - whesd.WebHookEventSubscriptionDestinationProperties = &properties - } - - v = m["endpointType"] - if v != nil { - var endpointType EndpointType - err = json.Unmarshal(*m["endpointType"], &endpointType) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var webHookEventSubscriptionDestinationProperties WebHookEventSubscriptionDestinationProperties + err = json.Unmarshal(*v, &webHookEventSubscriptionDestinationProperties) + if err != nil { + return err + } + whesd.WebHookEventSubscriptionDestinationProperties = &webHookEventSubscriptionDestinationProperties + } + case "endpointType": + if v != nil { + var endpointType EndpointType + err = json.Unmarshal(*v, &endpointType) + if err != nil { + return err + } + whesd.EndpointType = endpointType + } } - whesd.EndpointType = endpointType } return nil diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2017-09-15-preview/eventgrid/topics.go b/vendor/github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2017-09-15-preview/eventgrid/topics.go index 8403e55da086..9ba4e8888873 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2017-09-15-preview/eventgrid/topics.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2017-09-15-preview/eventgrid/topics.go @@ -42,8 +42,8 @@ func NewTopicsClientWithBaseURI(baseURI string, subscriptionID string) TopicsCli // CreateOrUpdate asynchronously creates a new topic with the specified parameters. // -// resourceGroupName is the name of the resource group within the user's subscription. topicName is name of the topic -// topicInfo is topic information +// resourceGroupName is the name of the resource group within the user's subscription. topicName is name of the +// topic topicInfo is topic information func (client TopicsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, topicName string, topicInfo Topic) (result TopicsCreateOrUpdateFuture, err error) { req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, topicName, topicInfo) if err != nil { @@ -113,7 +113,8 @@ func (client TopicsClient) CreateOrUpdateResponder(resp *http.Response) (result // Delete delete existing topic // -// resourceGroupName is the name of the resource group within the user's subscription. topicName is name of the topic +// resourceGroupName is the name of the resource group within the user's subscription. topicName is name of the +// topic func (client TopicsClient) Delete(ctx context.Context, resourceGroupName string, topicName string) (result TopicsDeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, topicName) if err != nil { @@ -180,7 +181,8 @@ func (client TopicsClient) DeleteResponder(resp *http.Response) (result autorest // Get get properties of a topic // -// resourceGroupName is the name of the resource group within the user's subscription. topicName is name of the topic +// resourceGroupName is the name of the resource group within the user's subscription. topicName is name of the +// topic func (client TopicsClient) Get(ctx context.Context, resourceGroupName string, topicName string) (result Topic, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, topicName) if err != nil { @@ -373,8 +375,9 @@ func (client TopicsClient) ListBySubscriptionResponder(resp *http.Response) (res // ListEventTypes list event types for a topic // -// resourceGroupName is the name of the resource group within the user's subscription. providerNamespace is namespace -// of the provider of the topic resourceTypeName is name of the topic type resourceName is name of the topic +// resourceGroupName is the name of the resource group within the user's subscription. providerNamespace is +// namespace of the provider of the topic resourceTypeName is name of the topic type resourceName is name of the +// topic func (client TopicsClient) ListEventTypes(ctx context.Context, resourceGroupName string, providerNamespace string, resourceTypeName string, resourceName string) (result EventTypesListResult, err error) { req, err := client.ListEventTypesPreparer(ctx, resourceGroupName, providerNamespace, resourceTypeName, resourceName) if err != nil { @@ -442,7 +445,8 @@ func (client TopicsClient) ListEventTypesResponder(resp *http.Response) (result // ListSharedAccessKeys list the two keys used to publish to a topic // -// resourceGroupName is the name of the resource group within the user's subscription. topicName is name of the topic +// resourceGroupName is the name of the resource group within the user's subscription. topicName is name of the +// topic func (client TopicsClient) ListSharedAccessKeys(ctx context.Context, resourceGroupName string, topicName string) (result TopicSharedAccessKeys, err error) { req, err := client.ListSharedAccessKeysPreparer(ctx, resourceGroupName, topicName) if err != nil { @@ -508,13 +512,13 @@ func (client TopicsClient) ListSharedAccessKeysResponder(resp *http.Response) (r // RegenerateKey regenerate a shared access key for a topic // -// resourceGroupName is the name of the resource group within the user's subscription. topicName is name of the topic -// regenerateKeyRequest is request body to regenerate key +// resourceGroupName is the name of the resource group within the user's subscription. topicName is name of the +// topic regenerateKeyRequest is request body to regenerate key func (client TopicsClient) RegenerateKey(ctx context.Context, resourceGroupName string, topicName string, regenerateKeyRequest TopicRegenerateKeyRequest) (result TopicSharedAccessKeys, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: regenerateKeyRequest, Constraints: []validation.Constraint{{Target: "regenerateKeyRequest.KeyName", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventgrid.TopicsClient", "RegenerateKey") + return result, validation.NewError("eventgrid.TopicsClient", "RegenerateKey", err.Error()) } req, err := client.RegenerateKeyPreparer(ctx, resourceGroupName, topicName, regenerateKeyRequest) @@ -583,8 +587,8 @@ func (client TopicsClient) RegenerateKeyResponder(resp *http.Response) (result T // Update asynchronously updates a topic with the specified parameters. // -// resourceGroupName is the name of the resource group within the user's subscription. topicName is name of the topic -// topicUpdateParameters is topic update information +// resourceGroupName is the name of the resource group within the user's subscription. topicName is name of the +// topic topicUpdateParameters is topic update information func (client TopicsClient) Update(ctx context.Context, resourceGroupName string, topicName string, topicUpdateParameters TopicUpdateParameters) (result TopicsUpdateFuture, err error) { req, err := client.UpdatePreparer(ctx, resourceGroupName, topicName, topicUpdateParameters) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2017-09-15-preview/eventgrid/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2017-09-15-preview/eventgrid/version.go index e9668181d8ff..4696946ef8b3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2017-09-15-preview/eventgrid/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2017-09-15-preview/eventgrid/version.go @@ -1,5 +1,7 @@ package eventgrid +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package eventgrid // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta services" + return "Azure-SDK-For-Go/" + version.Number + " eventgrid/2017-09-15-preview" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/consumergroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/consumergroups.go index 31ef92524f27..5d83a89866f3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/consumergroups.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/consumergroups.go @@ -42,9 +42,9 @@ func NewConsumerGroupsClientWithBaseURI(baseURI string, subscriptionID string) C // CreateOrUpdate creates or updates an Event Hubs consumer group as a nested resource within a Namespace. // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name -// eventHubName is the Event Hub name consumerGroupName is the consumer group name parameters is parameters supplied to -// create or update a consumer group resource. +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name eventHubName is the Event Hub name consumerGroupName is the consumer group name parameters is parameters +// supplied to create or update a consumer group resource. func (client ConsumerGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, eventHubName string, consumerGroupName string, parameters ConsumerGroup) (result ConsumerGroup, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -58,7 +58,7 @@ func (client ConsumerGroupsClient) CreateOrUpdate(ctx context.Context, resourceG {TargetValue: consumerGroupName, Constraints: []validation.Constraint{{Target: "consumerGroupName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "consumerGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.ConsumerGroupsClient", "CreateOrUpdate") + return result, validation.NewError("eventhub.ConsumerGroupsClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, namespaceName, eventHubName, consumerGroupName, parameters) @@ -129,8 +129,8 @@ func (client ConsumerGroupsClient) CreateOrUpdateResponder(resp *http.Response) // Delete deletes a consumer group from the specified Event Hub and resource group. // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name -// eventHubName is the Event Hub name consumerGroupName is the consumer group name +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name eventHubName is the Event Hub name consumerGroupName is the consumer group name func (client ConsumerGroupsClient) Delete(ctx context.Context, resourceGroupName string, namespaceName string, eventHubName string, consumerGroupName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -144,7 +144,7 @@ func (client ConsumerGroupsClient) Delete(ctx context.Context, resourceGroupName {TargetValue: consumerGroupName, Constraints: []validation.Constraint{{Target: "consumerGroupName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "consumerGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.ConsumerGroupsClient", "Delete") + return result, validation.NewError("eventhub.ConsumerGroupsClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, namespaceName, eventHubName, consumerGroupName) @@ -212,8 +212,8 @@ func (client ConsumerGroupsClient) DeleteResponder(resp *http.Response) (result // Get gets a description for the specified consumer group. // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name -// eventHubName is the Event Hub name consumerGroupName is the consumer group name +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name eventHubName is the Event Hub name consumerGroupName is the consumer group name func (client ConsumerGroupsClient) Get(ctx context.Context, resourceGroupName string, namespaceName string, eventHubName string, consumerGroupName string) (result ConsumerGroup, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -227,7 +227,7 @@ func (client ConsumerGroupsClient) Get(ctx context.Context, resourceGroupName st {TargetValue: consumerGroupName, Constraints: []validation.Constraint{{Target: "consumerGroupName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "consumerGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.ConsumerGroupsClient", "Get") + return result, validation.NewError("eventhub.ConsumerGroupsClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, namespaceName, eventHubName, consumerGroupName) @@ -297,8 +297,8 @@ func (client ConsumerGroupsClient) GetResponder(resp *http.Response) (result Con // ListByEventHub gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in // the Namespace. // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name -// eventHubName is the Event Hub name +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name eventHubName is the Event Hub name func (client ConsumerGroupsClient) ListByEventHub(ctx context.Context, resourceGroupName string, namespaceName string, eventHubName string) (result ConsumerGroupListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -309,7 +309,7 @@ func (client ConsumerGroupsClient) ListByEventHub(ctx context.Context, resourceG {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: eventHubName, Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.ConsumerGroupsClient", "ListByEventHub") + return result, validation.NewError("eventhub.ConsumerGroupsClient", "ListByEventHub", err.Error()) } result.fn = client.listByEventHubNextResults diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/disasterrecoveryconfigs.go b/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/disasterrecoveryconfigs.go index c2c6b9efb49d..9b0892cf4823 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/disasterrecoveryconfigs.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/disasterrecoveryconfigs.go @@ -43,8 +43,8 @@ func NewDisasterRecoveryConfigsClientWithBaseURI(baseURI string, subscriptionID // BreakPairing this operation disables the Disaster Recovery and stops replicating changes from primary to secondary // namespaces // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name -// alias is the Disaster Recovery configuration name +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name alias is the Disaster Recovery configuration name func (client DisasterRecoveryConfigsClient) BreakPairing(ctx context.Context, resourceGroupName string, namespaceName string, alias string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -56,7 +56,7 @@ func (client DisasterRecoveryConfigsClient) BreakPairing(ctx context.Context, re {TargetValue: alias, Constraints: []validation.Constraint{{Target: "alias", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "alias", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.DisasterRecoveryConfigsClient", "BreakPairing") + return result, validation.NewError("eventhub.DisasterRecoveryConfigsClient", "BreakPairing", err.Error()) } req, err := client.BreakPairingPreparer(ctx, resourceGroupName, namespaceName, alias) @@ -123,8 +123,8 @@ func (client DisasterRecoveryConfigsClient) BreakPairingResponder(resp *http.Res // CheckNameAvailability check the give Namespace name availability. // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name -// parameters is parameters to check availability of the given Alias name +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name parameters is parameters to check availability of the given Alias name func (client DisasterRecoveryConfigsClient) CheckNameAvailability(ctx context.Context, resourceGroupName string, namespaceName string, parameters CheckNameAvailabilityParameter) (result CheckNameAvailabilityResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -135,7 +135,7 @@ func (client DisasterRecoveryConfigsClient) CheckNameAvailability(ctx context.Co {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.DisasterRecoveryConfigsClient", "CheckNameAvailability") + return result, validation.NewError("eventhub.DisasterRecoveryConfigsClient", "CheckNameAvailability", err.Error()) } req, err := client.CheckNameAvailabilityPreparer(ctx, resourceGroupName, namespaceName, parameters) @@ -204,9 +204,9 @@ func (client DisasterRecoveryConfigsClient) CheckNameAvailabilityResponder(resp // CreateOrUpdate creates or updates a new Alias(Disaster Recovery configuration) // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name -// alias is the Disaster Recovery configuration name parameters is parameters required to create an Alias(Disaster -// Recovery configuration) +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name alias is the Disaster Recovery configuration name parameters is parameters required to create an +// Alias(Disaster Recovery configuration) func (client DisasterRecoveryConfigsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, alias string, parameters ArmDisasterRecovery) (result ArmDisasterRecovery, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -218,7 +218,7 @@ func (client DisasterRecoveryConfigsClient) CreateOrUpdate(ctx context.Context, {TargetValue: alias, Constraints: []validation.Constraint{{Target: "alias", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "alias", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.DisasterRecoveryConfigsClient", "CreateOrUpdate") + return result, validation.NewError("eventhub.DisasterRecoveryConfigsClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, namespaceName, alias, parameters) @@ -288,8 +288,8 @@ func (client DisasterRecoveryConfigsClient) CreateOrUpdateResponder(resp *http.R // Delete deletes an Alias(Disaster Recovery configuration) // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name -// alias is the Disaster Recovery configuration name +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name alias is the Disaster Recovery configuration name func (client DisasterRecoveryConfigsClient) Delete(ctx context.Context, resourceGroupName string, namespaceName string, alias string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -301,7 +301,7 @@ func (client DisasterRecoveryConfigsClient) Delete(ctx context.Context, resource {TargetValue: alias, Constraints: []validation.Constraint{{Target: "alias", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "alias", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.DisasterRecoveryConfigsClient", "Delete") + return result, validation.NewError("eventhub.DisasterRecoveryConfigsClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, namespaceName, alias) @@ -368,8 +368,8 @@ func (client DisasterRecoveryConfigsClient) DeleteResponder(resp *http.Response) // FailOver envokes GEO DR failover and reconfigure the alias to point to the secondary namespace // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name -// alias is the Disaster Recovery configuration name +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name alias is the Disaster Recovery configuration name func (client DisasterRecoveryConfigsClient) FailOver(ctx context.Context, resourceGroupName string, namespaceName string, alias string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -381,7 +381,7 @@ func (client DisasterRecoveryConfigsClient) FailOver(ctx context.Context, resour {TargetValue: alias, Constraints: []validation.Constraint{{Target: "alias", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "alias", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.DisasterRecoveryConfigsClient", "FailOver") + return result, validation.NewError("eventhub.DisasterRecoveryConfigsClient", "FailOver", err.Error()) } req, err := client.FailOverPreparer(ctx, resourceGroupName, namespaceName, alias) @@ -448,8 +448,8 @@ func (client DisasterRecoveryConfigsClient) FailOverResponder(resp *http.Respons // Get retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name -// alias is the Disaster Recovery configuration name +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name alias is the Disaster Recovery configuration name func (client DisasterRecoveryConfigsClient) Get(ctx context.Context, resourceGroupName string, namespaceName string, alias string) (result ArmDisasterRecovery, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -461,7 +461,7 @@ func (client DisasterRecoveryConfigsClient) Get(ctx context.Context, resourceGro {TargetValue: alias, Constraints: []validation.Constraint{{Target: "alias", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "alias", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.DisasterRecoveryConfigsClient", "Get") + return result, validation.NewError("eventhub.DisasterRecoveryConfigsClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, namespaceName, alias) @@ -529,8 +529,8 @@ func (client DisasterRecoveryConfigsClient) GetResponder(resp *http.Response) (r // GetAuthorizationRule gets an AuthorizationRule for a Namespace by rule name. // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name -// alias is the Disaster Recovery configuration name authorizationRuleName is the authorization rule name. +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name alias is the Disaster Recovery configuration name authorizationRuleName is the authorization rule name. func (client DisasterRecoveryConfigsClient) GetAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, alias string, authorizationRuleName string) (result AuthorizationRule, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -544,7 +544,7 @@ func (client DisasterRecoveryConfigsClient) GetAuthorizationRule(ctx context.Con {Target: "alias", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: authorizationRuleName, Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.DisasterRecoveryConfigsClient", "GetAuthorizationRule") + return result, validation.NewError("eventhub.DisasterRecoveryConfigsClient", "GetAuthorizationRule", err.Error()) } req, err := client.GetAuthorizationRulePreparer(ctx, resourceGroupName, namespaceName, alias, authorizationRuleName) @@ -613,7 +613,8 @@ func (client DisasterRecoveryConfigsClient) GetAuthorizationRuleResponder(resp * // List gets all Alias(Disaster Recovery configurations) // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name func (client DisasterRecoveryConfigsClient) List(ctx context.Context, resourceGroupName string, namespaceName string) (result ArmDisasterRecoveryListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -622,7 +623,7 @@ func (client DisasterRecoveryConfigsClient) List(ctx context.Context, resourceGr {TargetValue: namespaceName, Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.DisasterRecoveryConfigsClient", "List") + return result, validation.NewError("eventhub.DisasterRecoveryConfigsClient", "List", err.Error()) } result.fn = client.listNextResults @@ -717,8 +718,8 @@ func (client DisasterRecoveryConfigsClient) ListComplete(ctx context.Context, re // ListAuthorizationRules gets a list of authorization rules for a Namespace. // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name -// alias is the Disaster Recovery configuration name +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name alias is the Disaster Recovery configuration name func (client DisasterRecoveryConfigsClient) ListAuthorizationRules(ctx context.Context, resourceGroupName string, namespaceName string, alias string) (result AuthorizationRuleListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -730,7 +731,7 @@ func (client DisasterRecoveryConfigsClient) ListAuthorizationRules(ctx context.C {TargetValue: alias, Constraints: []validation.Constraint{{Target: "alias", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "alias", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.DisasterRecoveryConfigsClient", "ListAuthorizationRules") + return result, validation.NewError("eventhub.DisasterRecoveryConfigsClient", "ListAuthorizationRules", err.Error()) } result.fn = client.listAuthorizationRulesNextResults @@ -826,8 +827,8 @@ func (client DisasterRecoveryConfigsClient) ListAuthorizationRulesComplete(ctx c // ListKeys gets the primary and secondary connection strings for the Namespace. // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name -// alias is the Disaster Recovery configuration name authorizationRuleName is the authorization rule name. +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name alias is the Disaster Recovery configuration name authorizationRuleName is the authorization rule name. func (client DisasterRecoveryConfigsClient) ListKeys(ctx context.Context, resourceGroupName string, namespaceName string, alias string, authorizationRuleName string) (result AccessKeys, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -841,7 +842,7 @@ func (client DisasterRecoveryConfigsClient) ListKeys(ctx context.Context, resour {Target: "alias", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: authorizationRuleName, Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.DisasterRecoveryConfigsClient", "ListKeys") + return result, validation.NewError("eventhub.DisasterRecoveryConfigsClient", "ListKeys", err.Error()) } req, err := client.ListKeysPreparer(ctx, resourceGroupName, namespaceName, alias, authorizationRuleName) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/eventhubs.go b/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/eventhubs.go index 76ab71241044..c0be9878f441 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/eventhubs.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/eventhubs.go @@ -42,8 +42,8 @@ func NewEventHubsClientWithBaseURI(baseURI string, subscriptionID string) EventH // CreateOrUpdate creates or updates a new Event Hub as a nested resource within a Namespace. // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name -// eventHubName is the Event Hub name parameters is parameters supplied to create an Event Hub resource. +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name eventHubName is the Event Hub name parameters is parameters supplied to create an Event Hub resource. func (client EventHubsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, eventHubName string, parameters Model) (result Model, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -71,7 +71,7 @@ func (client EventHubsClient) CreateOrUpdate(ctx context.Context, resourceGroupN }}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.EventHubsClient", "CreateOrUpdate") + return result, validation.NewError("eventhub.EventHubsClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, namespaceName, eventHubName, parameters) @@ -141,9 +141,9 @@ func (client EventHubsClient) CreateOrUpdateResponder(resp *http.Response) (resu // CreateOrUpdateAuthorizationRule creates or updates an AuthorizationRule for the specified Event Hub. // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name -// eventHubName is the Event Hub name authorizationRuleName is the authorization rule name. parameters is the shared -// access AuthorizationRule. +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name eventHubName is the Event Hub name authorizationRuleName is the authorization rule name. parameters is the +// shared access AuthorizationRule. func (client EventHubsClient) CreateOrUpdateAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, eventHubName string, authorizationRuleName string, parameters AuthorizationRule) (result AuthorizationRule, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -159,7 +159,7 @@ func (client EventHubsClient) CreateOrUpdateAuthorizationRule(ctx context.Contex {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.AuthorizationRuleProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.AuthorizationRuleProperties.Rights", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.EventHubsClient", "CreateOrUpdateAuthorizationRule") + return result, validation.NewError("eventhub.EventHubsClient", "CreateOrUpdateAuthorizationRule", err.Error()) } req, err := client.CreateOrUpdateAuthorizationRulePreparer(ctx, resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters) @@ -230,8 +230,8 @@ func (client EventHubsClient) CreateOrUpdateAuthorizationRuleResponder(resp *htt // Delete deletes an Event Hub from the specified Namespace and resource group. // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name -// eventHubName is the Event Hub name +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name eventHubName is the Event Hub name func (client EventHubsClient) Delete(ctx context.Context, resourceGroupName string, namespaceName string, eventHubName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -242,7 +242,7 @@ func (client EventHubsClient) Delete(ctx context.Context, resourceGroupName stri {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: eventHubName, Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.EventHubsClient", "Delete") + return result, validation.NewError("eventhub.EventHubsClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, namespaceName, eventHubName) @@ -309,8 +309,8 @@ func (client EventHubsClient) DeleteResponder(resp *http.Response) (result autor // DeleteAuthorizationRule deletes an Event Hub AuthorizationRule. // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name -// eventHubName is the Event Hub name authorizationRuleName is the authorization rule name. +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name eventHubName is the Event Hub name authorizationRuleName is the authorization rule name. func (client EventHubsClient) DeleteAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, eventHubName string, authorizationRuleName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -323,7 +323,7 @@ func (client EventHubsClient) DeleteAuthorizationRule(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: authorizationRuleName, Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.EventHubsClient", "DeleteAuthorizationRule") + return result, validation.NewError("eventhub.EventHubsClient", "DeleteAuthorizationRule", err.Error()) } req, err := client.DeleteAuthorizationRulePreparer(ctx, resourceGroupName, namespaceName, eventHubName, authorizationRuleName) @@ -391,8 +391,8 @@ func (client EventHubsClient) DeleteAuthorizationRuleResponder(resp *http.Respon // Get gets an Event Hubs description for the specified Event Hub. // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name -// eventHubName is the Event Hub name +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name eventHubName is the Event Hub name func (client EventHubsClient) Get(ctx context.Context, resourceGroupName string, namespaceName string, eventHubName string) (result Model, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -403,7 +403,7 @@ func (client EventHubsClient) Get(ctx context.Context, resourceGroupName string, {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: eventHubName, Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.EventHubsClient", "Get") + return result, validation.NewError("eventhub.EventHubsClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, namespaceName, eventHubName) @@ -471,8 +471,8 @@ func (client EventHubsClient) GetResponder(resp *http.Response) (result Model, e // GetAuthorizationRule gets an AuthorizationRule for an Event Hub by rule name. // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name -// eventHubName is the Event Hub name authorizationRuleName is the authorization rule name. +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name eventHubName is the Event Hub name authorizationRuleName is the authorization rule name. func (client EventHubsClient) GetAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, eventHubName string, authorizationRuleName string) (result AuthorizationRule, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -485,7 +485,7 @@ func (client EventHubsClient) GetAuthorizationRule(ctx context.Context, resource Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: authorizationRuleName, Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.EventHubsClient", "GetAuthorizationRule") + return result, validation.NewError("eventhub.EventHubsClient", "GetAuthorizationRule", err.Error()) } req, err := client.GetAuthorizationRulePreparer(ctx, resourceGroupName, namespaceName, eventHubName, authorizationRuleName) @@ -554,8 +554,8 @@ func (client EventHubsClient) GetAuthorizationRuleResponder(resp *http.Response) // ListAuthorizationRules gets the authorization rules for an Event Hub. // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name -// eventHubName is the Event Hub name +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name eventHubName is the Event Hub name func (client EventHubsClient) ListAuthorizationRules(ctx context.Context, resourceGroupName string, namespaceName string, eventHubName string) (result AuthorizationRuleListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -566,7 +566,7 @@ func (client EventHubsClient) ListAuthorizationRules(ctx context.Context, resour {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: eventHubName, Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.EventHubsClient", "ListAuthorizationRules") + return result, validation.NewError("eventhub.EventHubsClient", "ListAuthorizationRules", err.Error()) } result.fn = client.listAuthorizationRulesNextResults @@ -662,7 +662,8 @@ func (client EventHubsClient) ListAuthorizationRulesComplete(ctx context.Context // ListByNamespace gets all the Event Hubs in a Namespace. // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name func (client EventHubsClient) ListByNamespace(ctx context.Context, resourceGroupName string, namespaceName string) (result ListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -671,7 +672,7 @@ func (client EventHubsClient) ListByNamespace(ctx context.Context, resourceGroup {TargetValue: namespaceName, Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.EventHubsClient", "ListByNamespace") + return result, validation.NewError("eventhub.EventHubsClient", "ListByNamespace", err.Error()) } result.fn = client.listByNamespaceNextResults @@ -766,8 +767,8 @@ func (client EventHubsClient) ListByNamespaceComplete(ctx context.Context, resou // ListKeys gets the ACS and SAS connection strings for the Event Hub. // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name -// eventHubName is the Event Hub name authorizationRuleName is the authorization rule name. +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name eventHubName is the Event Hub name authorizationRuleName is the authorization rule name. func (client EventHubsClient) ListKeys(ctx context.Context, resourceGroupName string, namespaceName string, eventHubName string, authorizationRuleName string) (result AccessKeys, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -780,7 +781,7 @@ func (client EventHubsClient) ListKeys(ctx context.Context, resourceGroupName st Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: authorizationRuleName, Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.EventHubsClient", "ListKeys") + return result, validation.NewError("eventhub.EventHubsClient", "ListKeys", err.Error()) } req, err := client.ListKeysPreparer(ctx, resourceGroupName, namespaceName, eventHubName, authorizationRuleName) @@ -849,9 +850,9 @@ func (client EventHubsClient) ListKeysResponder(resp *http.Response) (result Acc // RegenerateKeys regenerates the ACS and SAS connection strings for the Event Hub. // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name -// eventHubName is the Event Hub name authorizationRuleName is the authorization rule name. parameters is parameters -// supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name eventHubName is the Event Hub name authorizationRuleName is the authorization rule name. parameters is +// parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). func (client EventHubsClient) RegenerateKeys(ctx context.Context, resourceGroupName string, namespaceName string, eventHubName string, authorizationRuleName string, parameters RegenerateAccessKeyParameters) (result AccessKeys, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -864,7 +865,7 @@ func (client EventHubsClient) RegenerateKeys(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "eventHubName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: authorizationRuleName, Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.EventHubsClient", "RegenerateKeys") + return result, validation.NewError("eventhub.EventHubsClient", "RegenerateKeys", err.Error()) } req, err := client.RegenerateKeysPreparer(ctx, resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/models.go index 912e79d8085e..94d56ed9e47d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/models.go @@ -166,14 +166,14 @@ type AccessKeys struct { // ArmDisasterRecovery single item in List or Get Alias(Disaster Recovery configuration) operation type ArmDisasterRecovery struct { autorest.Response `json:"-"` + // ArmDisasterRecoveryProperties - Properties required to the Create Or Update Alias(Disaster Recovery configurations) + *ArmDisasterRecoveryProperties `json:"properties,omitempty"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name Name *string `json:"name,omitempty"` // Type - Resource type Type *string `json:"type,omitempty"` - // ArmDisasterRecoveryProperties - Properties required to the Create Or Update Alias(Disaster Recovery configurations) - *ArmDisasterRecoveryProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ArmDisasterRecovery struct. @@ -183,46 +183,45 @@ func (adr *ArmDisasterRecovery) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ArmDisasterRecoveryProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - adr.ArmDisasterRecoveryProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var armDisasterRecoveryProperties ArmDisasterRecoveryProperties + err = json.Unmarshal(*v, &armDisasterRecoveryProperties) + if err != nil { + return err + } + adr.ArmDisasterRecoveryProperties = &armDisasterRecoveryProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + adr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + adr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + adr.Type = &typeVar + } } - adr.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - adr.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - adr.Type = &typeVar } return nil @@ -330,7 +329,8 @@ func (page ArmDisasterRecoveryListResultPage) Values() []ArmDisasterRecovery { return *page.adrlr.Value } -// ArmDisasterRecoveryProperties properties required to the Create Or Update Alias(Disaster Recovery configurations) +// ArmDisasterRecoveryProperties properties required to the Create Or Update Alias(Disaster Recovery +// configurations) type ArmDisasterRecoveryProperties struct { // ProvisioningState - Provisioning state of the Alias(Disaster Recovery configuration) - possible values 'Accepted' or 'Succeeded' or 'Failed'. Possible values include: 'Accepted', 'Succeeded', 'Failed' ProvisioningState ProvisioningStateDR `json:"provisioningState,omitempty"` @@ -345,14 +345,14 @@ type ArmDisasterRecoveryProperties struct { // AuthorizationRule single item in a List or Get AuthorizationRule operation type AuthorizationRule struct { autorest.Response `json:"-"` + // AuthorizationRuleProperties - Properties supplied to create or update AuthorizationRule + *AuthorizationRuleProperties `json:"properties,omitempty"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name Name *string `json:"name,omitempty"` // Type - Resource type Type *string `json:"type,omitempty"` - // AuthorizationRuleProperties - Properties supplied to create or update AuthorizationRule - *AuthorizationRuleProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for AuthorizationRule struct. @@ -362,46 +362,45 @@ func (ar *AuthorizationRule) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties AuthorizationRuleProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - ar.AuthorizationRuleProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var authorizationRuleProperties AuthorizationRuleProperties + err = json.Unmarshal(*v, &authorizationRuleProperties) + if err != nil { + return err + } + ar.AuthorizationRuleProperties = &authorizationRuleProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ar.Type = &typeVar + } } - ar.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - ar.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - ar.Type = &typeVar } return nil @@ -519,7 +518,7 @@ type AuthorizationRuleProperties struct { type CaptureDescription struct { // Enabled - A value that indicates whether capture description is enabled. Enabled *bool `json:"enabled,omitempty"` - // Encoding - Enumerates the possible values for the encoding format of capture description. Possible values include: 'Avro', 'AvroDeflate' + // Encoding - Enumerates the possible values for the encoding format of capture description. Note: 'AvroDeflate' will be deprecated in New API Version. Possible values include: 'Avro', 'AvroDeflate' Encoding EncodingCaptureDescription `json:"encoding,omitempty"` // IntervalInSeconds - The time window allows you to set the frequency with which the capture to Azure Blobs will happen, value should between 60 to 900 seconds IntervalInSeconds *int32 `json:"intervalInSeconds,omitempty"` @@ -549,14 +548,14 @@ type CheckNameAvailabilityResult struct { // ConsumerGroup single item in List or Get Consumer group operation type ConsumerGroup struct { autorest.Response `json:"-"` + // ConsumerGroupProperties - Single item in List or Get Consumer group operation + *ConsumerGroupProperties `json:"properties,omitempty"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name Name *string `json:"name,omitempty"` // Type - Resource type Type *string `json:"type,omitempty"` - // ConsumerGroupProperties - Single item in List or Get Consumer group operation - *ConsumerGroupProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ConsumerGroup struct. @@ -566,46 +565,45 @@ func (cg *ConsumerGroup) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ConsumerGroupProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - cg.ConsumerGroupProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var consumerGroupProperties ConsumerGroupProperties + err = json.Unmarshal(*v, &consumerGroupProperties) + if err != nil { + return err + } + cg.ConsumerGroupProperties = &consumerGroupProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cg.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cg.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cg.Type = &typeVar + } } - cg.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - cg.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - cg.Type = &typeVar } return nil @@ -738,33 +736,34 @@ func (d *Destination) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - d.Name = &name - } - - v = m["properties"] - if v != nil { - var properties DestinationProperties - err = json.Unmarshal(*m["properties"], &properties) - 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 + } + d.Name = &name + } + case "properties": + if v != nil { + var destinationProperties DestinationProperties + err = json.Unmarshal(*v, &destinationProperties) + if err != nil { + return err + } + d.DestinationProperties = &destinationProperties + } } - d.DestinationProperties = &properties } return nil } -// DestinationProperties properties describing the storage account, blob container and acrchive anme format for capture -// destination +// DestinationProperties properties describing the storage account, blob container and acrchive anme format for +// capture destination type DestinationProperties struct { // StorageAccountResourceID - Resource id of the storage account to be used to create the blobs StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"` @@ -777,99 +776,122 @@ type DestinationProperties struct { // EHNamespace single Namespace item in List or Get Operation type EHNamespace struct { autorest.Response `json:"-"` + // Sku - Properties of sku resource + Sku *Sku `json:"sku,omitempty"` + // EHNamespaceProperties - Namespace properties supplied for create namespace operation. + *EHNamespaceProperties `json:"properties,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name Name *string `json:"name,omitempty"` // Type - Resource type Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - // Sku - Properties of sku resource - Sku *Sku `json:"sku,omitempty"` - // EHNamespaceProperties - Namespace properties supplied for create namespace operation. - *EHNamespaceProperties `json:"properties,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for EHNamespace struct. -func (en *EHNamespace) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for EHNamespace. +func (en EHNamespace) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if en.Sku != nil { + objectMap["sku"] = en.Sku } - var v *json.RawMessage - - v = m["sku"] - if v != nil { - var sku Sku - err = json.Unmarshal(*m["sku"], &sku) - if err != nil { - return err - } - en.Sku = &sku + if en.EHNamespaceProperties != nil { + objectMap["properties"] = en.EHNamespaceProperties } - - v = m["properties"] - if v != nil { - var properties EHNamespaceProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - en.EHNamespaceProperties = &properties + if en.Location != nil { + objectMap["location"] = en.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - en.Location = &location + if en.Tags != nil { + objectMap["tags"] = en.Tags } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - en.Tags = &tags + if en.ID != nil { + objectMap["id"] = en.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - en.ID = &ID + if en.Name != nil { + objectMap["name"] = en.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - en.Name = &name + if en.Type != nil { + objectMap["type"] = en.Type } + return json.Marshal(objectMap) +} - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for EHNamespace struct. +func (en *EHNamespace) 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 "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + en.Sku = &sku + } + case "properties": + if v != nil { + var eHNamespaceProperties EHNamespaceProperties + err = json.Unmarshal(*v, &eHNamespaceProperties) + if err != nil { + return err + } + en.EHNamespaceProperties = &eHNamespaceProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + en.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + en.Tags = tags + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + en.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + en.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + en.Type = &typeVar + } } - en.Type = &typeVar } return nil @@ -995,8 +1017,8 @@ type EHNamespaceProperties struct { MaximumThroughputUnits *int32 `json:"maximumThroughputUnits,omitempty"` } -// ErrorResponse error reponse indicates EventHub service is not able to process the incoming request. The reason is -// provided in the error message. +// ErrorResponse error reponse indicates EventHub service is not able to process the incoming request. The reason +// is provided in the error message. type ErrorResponse struct { // Code - Error code. Code *string `json:"code,omitempty"` @@ -1109,14 +1131,14 @@ func (page ListResultPage) Values() []Model { // Model single item in List or Get Event Hub operation type Model struct { autorest.Response `json:"-"` + // Properties - Properties supplied to the Create Or Update Event Hub operation. + *Properties `json:"properties,omitempty"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name Name *string `json:"name,omitempty"` // Type - Resource type Type *string `json:"type,omitempty"` - // Properties - Properties supplied to the Create Or Update Event Hub operation. - *Properties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for Model struct. @@ -1126,52 +1148,52 @@ func (mVar *Model) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties Properties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - mVar.Properties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - mVar.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var properties Properties + err = json.Unmarshal(*v, &properties) + if err != nil { + return err + } + mVar.Properties = &properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mVar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mVar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mVar.Type = &typeVar + } } - mVar.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - mVar.Type = &typeVar } return nil } -// NamespacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// NamespacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type NamespacesCreateOrUpdateFuture struct { azure.Future req *http.Request @@ -1183,22 +1205,39 @@ func (future NamespacesCreateOrUpdateFuture) Result(client NamespacesClient) (en var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return en, autorest.NewError("eventhub.NamespacesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return en, azure.NewAsyncOpIncompleteError("eventhub.NamespacesCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { en, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } en, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -1214,22 +1253,39 @@ func (future NamespacesDeleteFuture) Result(client NamespacesClient) (ar autores var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("eventhub.NamespacesDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("eventhub.NamespacesDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.NamespacesDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -1251,8 +1307,8 @@ type OperationDisplay struct { Operation *string `json:"operation,omitempty"` } -// OperationListResult result of the request to list Event Hub operations. It contains a list of operations and a URL -// link to get the next set of results. +// OperationListResult result of the request to list Event Hub operations. It contains a list of operations and a +// URL link to get the next set of results. type OperationListResult struct { autorest.Response `json:"-"` // Value - List of Event Hub operations supported by the Microsoft.EventHub resource provider. @@ -1372,8 +1428,8 @@ type Properties struct { CaptureDescription *CaptureDescription `json:"captureDescription,omitempty"` } -// RegenerateAccessKeyParameters parameters supplied to the Regenerate Authorization Rule operation, specifies which -// key neeeds to be reset. +// RegenerateAccessKeyParameters parameters supplied to the Regenerate Authorization Rule operation, specifies +// which key neeeds to be reset. type RegenerateAccessKeyParameters struct { // KeyType - The access key to regenerate. Possible values include: 'PrimaryKey', 'SecondaryKey' KeyType KeyType `json:"keyType,omitempty"` @@ -1403,14 +1459,35 @@ type Sku struct { // TrackedResource definition of Resource type TrackedResource struct { + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name Name *string `json:"name,omitempty"` // Type - Resource type Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` +} + +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Location != nil { + objectMap["location"] = tr.Location + } + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.ID != nil { + objectMap["id"] = tr.ID + } + if tr.Name != nil { + objectMap["name"] = tr.Name + } + if tr.Type != nil { + objectMap["type"] = tr.Type + } + return json.Marshal(objectMap) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/namespaces.go b/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/namespaces.go index 7f2394047390..362757581df2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/namespaces.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/namespaces.go @@ -47,7 +47,7 @@ func (client NamespacesClient) CheckNameAvailability(ctx context.Context, parame if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.NamespacesClient", "CheckNameAvailability") + return result, validation.NewError("eventhub.NamespacesClient", "CheckNameAvailability", err.Error()) } req, err := client.CheckNameAvailabilityPreparer(ctx, parameters) @@ -115,8 +115,8 @@ func (client NamespacesClient) CheckNameAvailabilityResponder(resp *http.Respons // CreateOrUpdate creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This // operation is idempotent. // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name -// parameters is parameters for creating a namespace resource. +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name parameters is parameters for creating a namespace resource. func (client NamespacesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, parameters EHNamespace) (result NamespacesCreateOrUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -138,7 +138,7 @@ func (client NamespacesClient) CreateOrUpdate(ctx context.Context, resourceGroup {Target: "parameters.EHNamespaceProperties.MaximumThroughputUnits", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.NamespacesClient", "CreateOrUpdate") + return result, validation.NewError("eventhub.NamespacesClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, namespaceName, parameters) @@ -209,8 +209,8 @@ func (client NamespacesClient) CreateOrUpdateResponder(resp *http.Response) (res // CreateOrUpdateAuthorizationRule creates or updates an AuthorizationRule for a Namespace. // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name -// authorizationRuleName is the authorization rule name. parameters is the shared access AuthorizationRule. +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name authorizationRuleName is the authorization rule name. parameters is the shared access AuthorizationRule. func (client NamespacesClient) CreateOrUpdateAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, parameters AuthorizationRule) (result AuthorizationRule, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -224,7 +224,7 @@ func (client NamespacesClient) CreateOrUpdateAuthorizationRule(ctx context.Conte {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.AuthorizationRuleProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.AuthorizationRuleProperties.Rights", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.NamespacesClient", "CreateOrUpdateAuthorizationRule") + return result, validation.NewError("eventhub.NamespacesClient", "CreateOrUpdateAuthorizationRule", err.Error()) } req, err := client.CreateOrUpdateAuthorizationRulePreparer(ctx, resourceGroupName, namespaceName, authorizationRuleName, parameters) @@ -294,7 +294,8 @@ func (client NamespacesClient) CreateOrUpdateAuthorizationRuleResponder(resp *ht // Delete deletes an existing namespace. This operation also removes all associated resources under the namespace. // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name func (client NamespacesClient) Delete(ctx context.Context, resourceGroupName string, namespaceName string) (result NamespacesDeleteFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -303,7 +304,7 @@ func (client NamespacesClient) Delete(ctx context.Context, resourceGroupName str {TargetValue: namespaceName, Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.NamespacesClient", "Delete") + return result, validation.NewError("eventhub.NamespacesClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, namespaceName) @@ -371,8 +372,8 @@ func (client NamespacesClient) DeleteResponder(resp *http.Response) (result auto // DeleteAuthorizationRule deletes an AuthorizationRule for a Namespace. // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name -// authorizationRuleName is the authorization rule name. +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name authorizationRuleName is the authorization rule name. func (client NamespacesClient) DeleteAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -383,7 +384,7 @@ func (client NamespacesClient) DeleteAuthorizationRule(ctx context.Context, reso {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: authorizationRuleName, Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.NamespacesClient", "DeleteAuthorizationRule") + return result, validation.NewError("eventhub.NamespacesClient", "DeleteAuthorizationRule", err.Error()) } req, err := client.DeleteAuthorizationRulePreparer(ctx, resourceGroupName, namespaceName, authorizationRuleName) @@ -450,7 +451,8 @@ func (client NamespacesClient) DeleteAuthorizationRuleResponder(resp *http.Respo // Get gets the description of the specified namespace. // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name func (client NamespacesClient) Get(ctx context.Context, resourceGroupName string, namespaceName string) (result EHNamespace, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -459,7 +461,7 @@ func (client NamespacesClient) Get(ctx context.Context, resourceGroupName string {TargetValue: namespaceName, Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.NamespacesClient", "Get") + return result, validation.NewError("eventhub.NamespacesClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, namespaceName) @@ -526,8 +528,8 @@ func (client NamespacesClient) GetResponder(resp *http.Response) (result EHNames // GetAuthorizationRule gets an AuthorizationRule for a Namespace by rule name. // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name -// authorizationRuleName is the authorization rule name. +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name authorizationRuleName is the authorization rule name. func (client NamespacesClient) GetAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string) (result AuthorizationRule, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -538,7 +540,7 @@ func (client NamespacesClient) GetAuthorizationRule(ctx context.Context, resourc {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: authorizationRuleName, Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.NamespacesClient", "GetAuthorizationRule") + return result, validation.NewError("eventhub.NamespacesClient", "GetAuthorizationRule", err.Error()) } req, err := client.GetAuthorizationRulePreparer(ctx, resourceGroupName, namespaceName, authorizationRuleName) @@ -696,7 +698,8 @@ func (client NamespacesClient) ListComplete(ctx context.Context) (result EHNames // ListAuthorizationRules gets a list of authorization rules for a Namespace. // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name func (client NamespacesClient) ListAuthorizationRules(ctx context.Context, resourceGroupName string, namespaceName string) (result AuthorizationRuleListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -705,7 +708,7 @@ func (client NamespacesClient) ListAuthorizationRules(ctx context.Context, resou {TargetValue: namespaceName, Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.NamespacesClient", "ListAuthorizationRules") + return result, validation.NewError("eventhub.NamespacesClient", "ListAuthorizationRules", err.Error()) } result.fn = client.listAuthorizationRulesNextResults @@ -806,7 +809,7 @@ func (client NamespacesClient) ListByResourceGroup(ctx context.Context, resource {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.NamespacesClient", "ListByResourceGroup") + return result, validation.NewError("eventhub.NamespacesClient", "ListByResourceGroup", err.Error()) } result.fn = client.listByResourceGroupNextResults @@ -900,8 +903,8 @@ func (client NamespacesClient) ListByResourceGroupComplete(ctx context.Context, // ListKeys gets the primary and secondary connection strings for the Namespace. // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name -// authorizationRuleName is the authorization rule name. +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name authorizationRuleName is the authorization rule name. func (client NamespacesClient) ListKeys(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string) (result AccessKeys, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -912,7 +915,7 @@ func (client NamespacesClient) ListKeys(ctx context.Context, resourceGroupName s {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: authorizationRuleName, Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.NamespacesClient", "ListKeys") + return result, validation.NewError("eventhub.NamespacesClient", "ListKeys", err.Error()) } req, err := client.ListKeysPreparer(ctx, resourceGroupName, namespaceName, authorizationRuleName) @@ -980,9 +983,9 @@ func (client NamespacesClient) ListKeysResponder(resp *http.Response) (result Ac // RegenerateKeys regenerates the primary or secondary connection strings for the specified Namespace. // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name -// authorizationRuleName is the authorization rule name. parameters is parameters required to regenerate the connection -// string. +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name authorizationRuleName is the authorization rule name. parameters is parameters required to regenerate the +// connection string. func (client NamespacesClient) RegenerateKeys(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, parameters RegenerateAccessKeyParameters) (result AccessKeys, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -993,7 +996,7 @@ func (client NamespacesClient) RegenerateKeys(ctx context.Context, resourceGroup {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: authorizationRuleName, Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.NamespacesClient", "RegenerateKeys") + return result, validation.NewError("eventhub.NamespacesClient", "RegenerateKeys", err.Error()) } req, err := client.RegenerateKeysPreparer(ctx, resourceGroupName, namespaceName, authorizationRuleName, parameters) @@ -1064,8 +1067,8 @@ func (client NamespacesClient) RegenerateKeysResponder(resp *http.Response) (res // Update creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation // is idempotent. // -// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace name -// parameters is parameters for updating a namespace resource. +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name parameters is parameters for updating a namespace resource. func (client NamespacesClient) Update(ctx context.Context, resourceGroupName string, namespaceName string, parameters EHNamespace) (result EHNamespace, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -1074,7 +1077,7 @@ func (client NamespacesClient) Update(ctx context.Context, resourceGroupName str {TargetValue: namespaceName, Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "eventhub.NamespacesClient", "Update") + return result, validation.NewError("eventhub.NamespacesClient", "Update", err.Error()) } req, err := client.UpdatePreparer(ctx, resourceGroupName, namespaceName, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/version.go index 06d59d82db35..11d960128b5b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/version.go @@ -1,5 +1,7 @@ package eventhub +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package eventhub // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta services" + return "Azure-SDK-For-Go/" + version.Number + " eventhub/2017-04-01" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/applications.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/applications.go index 8c25193ac34d..c42ab2f1b304 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/applications.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/applications.go @@ -50,7 +50,7 @@ func (client ApplicationsClient) AddOwner(ctx context.Context, applicationObject if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "graphrbac.ApplicationsClient", "AddOwner") + return result, validation.NewError("graphrbac.ApplicationsClient", "AddOwner", err.Error()) } req, err := client.AddOwnerPreparer(ctx, applicationObjectID, parameters) @@ -124,7 +124,7 @@ func (client ApplicationsClient) Create(ctx context.Context, parameters Applicat Constraints: []validation.Constraint{{Target: "parameters.AvailableToOtherTenants", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.DisplayName", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.IdentifierUris", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "graphrbac.ApplicationsClient", "Create") + return result, validation.NewError("graphrbac.ApplicationsClient", "Create", err.Error()) } req, err := client.CreatePreparer(ctx, parameters) @@ -725,8 +725,8 @@ func (client ApplicationsClient) PatchResponder(resp *http.Response) (result aut // UpdateKeyCredentials update the keyCredentials associated with an application. // -// applicationObjectID is application object ID. parameters is parameters to update the keyCredentials of an existing -// application. +// applicationObjectID is application object ID. parameters is parameters to update the keyCredentials of an +// existing application. func (client ApplicationsClient) UpdateKeyCredentials(ctx context.Context, applicationObjectID string, parameters KeyCredentialsUpdateParameters) (result autorest.Response, err error) { req, err := client.UpdateKeyCredentialsPreparer(ctx, applicationObjectID, parameters) if err != nil { @@ -792,8 +792,8 @@ func (client ApplicationsClient) UpdateKeyCredentialsResponder(resp *http.Respon // UpdatePasswordCredentials update passwordCredentials associated with an application. // -// applicationObjectID is application object ID. parameters is parameters to update passwordCredentials of an existing -// application. +// applicationObjectID is application object ID. parameters is parameters to update passwordCredentials of an +// existing application. func (client ApplicationsClient) UpdatePasswordCredentials(ctx context.Context, applicationObjectID string, parameters PasswordCredentialsUpdateParameters) (result autorest.Response, err error) { req, err := client.UpdatePasswordCredentialsPreparer(ctx, applicationObjectID, parameters) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/groups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/groups.go index 5202df34dbc5..a61065b9fec8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/groups.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/groups.go @@ -43,14 +43,14 @@ func NewGroupsClientWithBaseURI(baseURI string, tenantID string) GroupsClient { // AddMember add a member to a group. // -// groupObjectID is the object ID of the group to which to add the member. parameters is the URL of the member object, -// such as +// groupObjectID is the object ID of the group to which to add the member. parameters is the URL of the member +// object, such as // https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd. func (client GroupsClient) AddMember(ctx context.Context, groupObjectID string, parameters GroupAddMemberParameters) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "graphrbac.GroupsClient", "AddMember") + return result, validation.NewError("graphrbac.GroupsClient", "AddMember", err.Error()) } req, err := client.AddMemberPreparer(ctx, groupObjectID, parameters) @@ -125,7 +125,7 @@ func (client GroupsClient) Create(ctx context.Context, parameters GroupCreatePar {Target: "parameters.MailEnabled", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.MailNickname", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.SecurityEnabled", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "graphrbac.GroupsClient", "Create") + return result, validation.NewError("graphrbac.GroupsClient", "Create", err.Error()) } req, err := client.CreatePreparer(ctx, parameters) @@ -463,12 +463,13 @@ func (client GroupsClient) GetGroupMembersNextResponder(resp *http.Response) (re // GetMemberGroups gets a collection of object IDs of groups of which the specified group is a member. // -// objectID is the object ID of the group for which to get group membership. parameters is group filtering parameters. +// objectID is the object ID of the group for which to get group membership. parameters is group filtering +// parameters. func (client GroupsClient) GetMemberGroups(ctx context.Context, objectID string, parameters GroupGetMemberGroupsParameters) (result GroupGetMemberGroupsResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.SecurityEnabledOnly", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "graphrbac.GroupsClient", "GetMemberGroups") + return result, validation.NewError("graphrbac.GroupsClient", "GetMemberGroups", err.Error()) } req, err := client.GetMemberGroupsPreparer(ctx, objectID, parameters) @@ -543,7 +544,7 @@ func (client GroupsClient) IsMemberOf(ctx context.Context, parameters CheckGroup {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.GroupID", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.MemberID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "graphrbac.GroupsClient", "IsMemberOf") + return result, validation.NewError("graphrbac.GroupsClient", "IsMemberOf", err.Error()) } req, err := client.IsMemberOfPreparer(ctx, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/models.go index c127063cefad..4825f9fcc666 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/models.go @@ -19,7 +19,6 @@ package graphrbac import ( "encoding/json" - "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/date" ) @@ -54,7 +53,7 @@ const ( type AADObject struct { autorest.Response `json:"-"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties *map[string]*map[string]interface{} `json:",omitempty"` + AdditionalProperties map[string]interface{} `json:""` // ObjectID - The ID of the object. ObjectID *string `json:"objectId,omitempty"` // ObjectType - The type of AAD object. @@ -93,34 +92,112 @@ type AADObject struct { Homepage *string `json:"homepage,omitempty"` } +// MarshalJSON is the custom marshaler for AADObject. +func (ao AADObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ao.ObjectID != nil { + objectMap["objectId"] = ao.ObjectID + } + if ao.ObjectType != nil { + objectMap["objectType"] = ao.ObjectType + } + if ao.DisplayName != nil { + objectMap["displayName"] = ao.DisplayName + } + if ao.UserPrincipalName != nil { + objectMap["userPrincipalName"] = ao.UserPrincipalName + } + if ao.Mail != nil { + objectMap["mail"] = ao.Mail + } + if ao.MailEnabled != nil { + objectMap["mailEnabled"] = ao.MailEnabled + } + if ao.MailNickname != nil { + objectMap["mailNickname"] = ao.MailNickname + } + if ao.SecurityEnabled != nil { + objectMap["securityEnabled"] = ao.SecurityEnabled + } + if ao.SignInName != nil { + objectMap["signInName"] = ao.SignInName + } + if ao.ServicePrincipalNames != nil { + objectMap["servicePrincipalNames"] = ao.ServicePrincipalNames + } + if ao.UserType != nil { + objectMap["userType"] = ao.UserType + } + if ao.UsageLocation != nil { + objectMap["usageLocation"] = ao.UsageLocation + } + if ao.AppID != nil { + objectMap["appId"] = ao.AppID + } + if ao.AppPermissions != nil { + objectMap["appPermissions"] = ao.AppPermissions + } + if ao.AvailableToOtherTenants != nil { + objectMap["availableToOtherTenants"] = ao.AvailableToOtherTenants + } + if ao.IdentifierUris != nil { + objectMap["identifierUris"] = ao.IdentifierUris + } + if ao.ReplyUrls != nil { + objectMap["replyUrls"] = ao.ReplyUrls + } + if ao.Homepage != nil { + objectMap["homepage"] = ao.Homepage + } + for k, v := range ao.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + // ADGroup active Directory group information. type ADGroup struct { autorest.Response `json:"-"` - // ObjectID - The object ID. - ObjectID *string `json:"objectId,omitempty"` - // DeletionTimestamp - The time at which the directory object was deleted. - DeletionTimestamp *date.Time `json:"deletionTimestamp,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeDirectoryObject', 'ObjectTypeApplication', 'ObjectTypeGroup', 'ObjectTypeServicePrincipal', 'ObjectTypeUser' - ObjectType ObjectType `json:"objectType,omitempty"` - // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties *map[string]*map[string]interface{} `json:",omitempty"` // DisplayName - The display name of the group. DisplayName *string `json:"displayName,omitempty"` // SecurityEnabled - Whether the group is security-enable. SecurityEnabled *bool `json:"securityEnabled,omitempty"` // Mail - The primary email address of the group. Mail *string `json:"mail,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ObjectID - The object ID. + ObjectID *string `json:"objectId,omitempty"` + // DeletionTimestamp - The time at which the directory object was deleted. + DeletionTimestamp *date.Time `json:"deletionTimestamp,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeDirectoryObject', 'ObjectTypeApplication', 'ObjectTypeGroup', 'ObjectTypeServicePrincipal', 'ObjectTypeUser' + ObjectType ObjectType `json:"objectType,omitempty"` } // MarshalJSON is the custom marshaler for ADGroup. func (ag ADGroup) MarshalJSON() ([]byte, error) { ag.ObjectType = ObjectTypeGroup - type Alias ADGroup - return json.Marshal(&struct { - Alias - }{ - Alias: (Alias)(ag), - }) + objectMap := make(map[string]interface{}) + if ag.DisplayName != nil { + objectMap["displayName"] = ag.DisplayName + } + if ag.SecurityEnabled != nil { + objectMap["securityEnabled"] = ag.SecurityEnabled + } + if ag.Mail != nil { + objectMap["mail"] = ag.Mail + } + if ag.ObjectID != nil { + objectMap["objectId"] = ag.ObjectID + } + if ag.DeletionTimestamp != nil { + objectMap["deletionTimestamp"] = ag.DeletionTimestamp + } + objectMap["objectType"] = ag.ObjectType + for k, v := range ag.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) } // AsApplication is the BasicDirectoryObject implementation for ADGroup. @@ -156,14 +233,6 @@ func (ag ADGroup) AsBasicDirectoryObject() (BasicDirectoryObject, bool) { // Application active Directory application information. type Application struct { autorest.Response `json:"-"` - // ObjectID - The object ID. - ObjectID *string `json:"objectId,omitempty"` - // DeletionTimestamp - The time at which the directory object was deleted. - DeletionTimestamp *date.Time `json:"deletionTimestamp,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeDirectoryObject', 'ObjectTypeApplication', 'ObjectTypeGroup', 'ObjectTypeServicePrincipal', 'ObjectTypeUser' - ObjectType ObjectType `json:"objectType,omitempty"` - // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties *map[string]*map[string]interface{} `json:",omitempty"` // AppID - The application ID. AppID *string `json:"appId,omitempty"` // AppPermissions - The application permissions. @@ -180,17 +249,55 @@ type Application struct { Homepage *string `json:"homepage,omitempty"` // Oauth2AllowImplicitFlow - Whether to allow implicit grant flow for OAuth2 Oauth2AllowImplicitFlow *bool `json:"oauth2AllowImplicitFlow,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ObjectID - The object ID. + ObjectID *string `json:"objectId,omitempty"` + // DeletionTimestamp - The time at which the directory object was deleted. + DeletionTimestamp *date.Time `json:"deletionTimestamp,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeDirectoryObject', 'ObjectTypeApplication', 'ObjectTypeGroup', 'ObjectTypeServicePrincipal', 'ObjectTypeUser' + ObjectType ObjectType `json:"objectType,omitempty"` } // MarshalJSON is the custom marshaler for Application. func (a Application) MarshalJSON() ([]byte, error) { a.ObjectType = ObjectTypeApplication - type Alias Application - return json.Marshal(&struct { - Alias - }{ - Alias: (Alias)(a), - }) + objectMap := make(map[string]interface{}) + if a.AppID != nil { + objectMap["appId"] = a.AppID + } + if a.AppPermissions != nil { + objectMap["appPermissions"] = a.AppPermissions + } + if a.AvailableToOtherTenants != nil { + objectMap["availableToOtherTenants"] = a.AvailableToOtherTenants + } + if a.DisplayName != nil { + objectMap["displayName"] = a.DisplayName + } + if a.IdentifierUris != nil { + objectMap["identifierUris"] = a.IdentifierUris + } + if a.ReplyUrls != nil { + objectMap["replyUrls"] = a.ReplyUrls + } + if a.Homepage != nil { + objectMap["homepage"] = a.Homepage + } + if a.Oauth2AllowImplicitFlow != nil { + objectMap["oauth2AllowImplicitFlow"] = a.Oauth2AllowImplicitFlow + } + if a.ObjectID != nil { + objectMap["objectId"] = a.ObjectID + } + if a.DeletionTimestamp != nil { + objectMap["deletionTimestamp"] = a.DeletionTimestamp + } + objectMap["objectType"] = a.ObjectType + for k, v := range a.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) } // AsApplication is the BasicDirectoryObject implementation for Application. @@ -226,15 +333,27 @@ func (a Application) AsBasicDirectoryObject() (BasicDirectoryObject, bool) { // ApplicationAddOwnerParameters request parameters for adding a owner to an application. type ApplicationAddOwnerParameters struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties *map[string]*map[string]interface{} `json:",omitempty"` + AdditionalProperties map[string]interface{} `json:""` // URL - A owner object URL, such as "https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd", where "0b1f9851-1bf0-433f-aec3-cb9272f093dc" is the tenantId and "f260bbc4-c254-447b-94cf-293b5ec434dd" is the objectId of the owner (user, application, servicePrincipal, group) to be added. URL *string `json:"url,omitempty"` } +// MarshalJSON is the custom marshaler for ApplicationAddOwnerParameters. +func (aaop ApplicationAddOwnerParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aaop.URL != nil { + objectMap["url"] = aaop.URL + } + for k, v := range aaop.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + // ApplicationCreateParameters request parameters for creating a new application. type ApplicationCreateParameters struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties *map[string]*map[string]interface{} `json:",omitempty"` + AdditionalProperties map[string]interface{} `json:""` // AvailableToOtherTenants - Whether the application is available to other tenants. AvailableToOtherTenants *bool `json:"availableToOtherTenants,omitempty"` // DisplayName - The display name of the application. @@ -255,6 +374,42 @@ type ApplicationCreateParameters struct { RequiredResourceAccess *[]RequiredResourceAccess `json:"requiredResourceAccess,omitempty"` } +// MarshalJSON is the custom marshaler for ApplicationCreateParameters. +func (acp ApplicationCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if acp.AvailableToOtherTenants != nil { + objectMap["availableToOtherTenants"] = acp.AvailableToOtherTenants + } + if acp.DisplayName != nil { + objectMap["displayName"] = acp.DisplayName + } + if acp.Homepage != nil { + objectMap["homepage"] = acp.Homepage + } + if acp.IdentifierUris != nil { + objectMap["identifierUris"] = acp.IdentifierUris + } + if acp.ReplyUrls != nil { + objectMap["replyUrls"] = acp.ReplyUrls + } + if acp.KeyCredentials != nil { + objectMap["keyCredentials"] = acp.KeyCredentials + } + if acp.PasswordCredentials != nil { + objectMap["passwordCredentials"] = acp.PasswordCredentials + } + if acp.Oauth2AllowImplicitFlow != nil { + objectMap["oauth2AllowImplicitFlow"] = acp.Oauth2AllowImplicitFlow + } + if acp.RequiredResourceAccess != nil { + objectMap["requiredResourceAccess"] = acp.RequiredResourceAccess + } + for k, v := range acp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + // ApplicationListResult application list operation result. type ApplicationListResult struct { autorest.Response `json:"-"` @@ -348,7 +503,7 @@ func (page ApplicationListResultPage) Values() []Application { // ApplicationUpdateParameters request parameters for updating an existing application. type ApplicationUpdateParameters struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties *map[string]*map[string]interface{} `json:",omitempty"` + AdditionalProperties map[string]interface{} `json:""` // AvailableToOtherTenants - Whether the application is available to other tenants AvailableToOtherTenants *bool `json:"availableToOtherTenants,omitempty"` // DisplayName - The display name of the application. @@ -369,25 +524,88 @@ type ApplicationUpdateParameters struct { RequiredResourceAccess *[]RequiredResourceAccess `json:"requiredResourceAccess,omitempty"` } +// MarshalJSON is the custom marshaler for ApplicationUpdateParameters. +func (aup ApplicationUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aup.AvailableToOtherTenants != nil { + objectMap["availableToOtherTenants"] = aup.AvailableToOtherTenants + } + if aup.DisplayName != nil { + objectMap["displayName"] = aup.DisplayName + } + if aup.Homepage != nil { + objectMap["homepage"] = aup.Homepage + } + if aup.IdentifierUris != nil { + objectMap["identifierUris"] = aup.IdentifierUris + } + if aup.ReplyUrls != nil { + objectMap["replyUrls"] = aup.ReplyUrls + } + if aup.KeyCredentials != nil { + objectMap["keyCredentials"] = aup.KeyCredentials + } + if aup.PasswordCredentials != nil { + objectMap["passwordCredentials"] = aup.PasswordCredentials + } + if aup.Oauth2AllowImplicitFlow != nil { + objectMap["oauth2AllowImplicitFlow"] = aup.Oauth2AllowImplicitFlow + } + if aup.RequiredResourceAccess != nil { + objectMap["requiredResourceAccess"] = aup.RequiredResourceAccess + } + for k, v := range aup.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + // CheckGroupMembershipParameters request parameters for IsMemberOf API call. type CheckGroupMembershipParameters struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties *map[string]*map[string]interface{} `json:",omitempty"` + AdditionalProperties map[string]interface{} `json:""` // GroupID - The object ID of the group to check. GroupID *string `json:"groupId,omitempty"` // MemberID - The object ID of the contact, group, user, or service principal to check for membership in the specified group. MemberID *string `json:"memberId,omitempty"` } +// MarshalJSON is the custom marshaler for CheckGroupMembershipParameters. +func (cgmp CheckGroupMembershipParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cgmp.GroupID != nil { + objectMap["groupId"] = cgmp.GroupID + } + if cgmp.MemberID != nil { + objectMap["memberId"] = cgmp.MemberID + } + for k, v := range cgmp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + // CheckGroupMembershipResult server response for IsMemberOf API call type CheckGroupMembershipResult struct { autorest.Response `json:"-"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties *map[string]*map[string]interface{} `json:",omitempty"` + AdditionalProperties map[string]interface{} `json:""` // Value - True if the specified user, group, contact, or service principal has either direct or transitive membership in the specified group; otherwise, false. Value *bool `json:"value,omitempty"` } +// MarshalJSON is the custom marshaler for CheckGroupMembershipResult. +func (cgmr CheckGroupMembershipResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cgmr.Value != nil { + objectMap["value"] = cgmr.Value + } + for k, v := range cgmr.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + // BasicDirectoryObject represents an Azure Active Directory object. type BasicDirectoryObject interface { AsApplication() (*Application, bool) @@ -399,6 +617,8 @@ type BasicDirectoryObject interface { // DirectoryObject represents an Azure Active Directory object. type DirectoryObject struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` // ObjectID - The object ID. ObjectID *string `json:"objectId,omitempty"` // DeletionTimestamp - The time at which the directory object was deleted. @@ -459,12 +679,18 @@ func unmarshalBasicDirectoryObjectArray(body []byte) ([]BasicDirectoryObject, er // MarshalJSON is the custom marshaler for DirectoryObject. func (do DirectoryObject) MarshalJSON() ([]byte, error) { do.ObjectType = ObjectTypeDirectoryObject - type Alias DirectoryObject - return json.Marshal(&struct { - Alias - }{ - Alias: (Alias)(do), - }) + objectMap := make(map[string]interface{}) + if do.ObjectID != nil { + objectMap["objectId"] = do.ObjectID + } + if do.DeletionTimestamp != nil { + objectMap["deletionTimestamp"] = do.DeletionTimestamp + } + objectMap["objectType"] = do.ObjectType + for k, v := range do.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) } // AsApplication is the BasicDirectoryObject implementation for DirectoryObject. @@ -511,15 +737,17 @@ func (dolr *DirectoryObjectListResult) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["value"] - if v != nil { - value, err := unmarshalBasicDirectoryObjectArray(*m["value"]) - if err != nil { - return err + for k, v := range m { + switch k { + case "value": + if v != nil { + value, err := unmarshalBasicDirectoryObjectArray(*v) + if err != nil { + return err + } + dolr.Value = &value + } } - dolr.Value = &value } return nil @@ -529,7 +757,7 @@ func (dolr *DirectoryObjectListResult) UnmarshalJSON(body []byte) error { type Domain struct { autorest.Response `json:"-"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties *map[string]*map[string]interface{} `json:",omitempty"` + AdditionalProperties map[string]interface{} `json:""` // AuthenticationType - the type of the authentication into the domain. AuthenticationType *string `json:"authenticationType,omitempty"` // IsDefault - if this is the default domain in the tenant. @@ -540,6 +768,27 @@ type Domain struct { Name *string `json:"name,omitempty"` } +// MarshalJSON is the custom marshaler for Domain. +func (d Domain) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if d.AuthenticationType != nil { + objectMap["authenticationType"] = d.AuthenticationType + } + if d.IsDefault != nil { + objectMap["isDefault"] = d.IsDefault + } + if d.IsVerified != nil { + objectMap["isVerified"] = d.IsVerified + } + if d.Name != nil { + objectMap["name"] = d.Name + } + for k, v := range d.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + // DomainListResult server response for Get tenant domains API call. type DomainListResult struct { autorest.Response `json:"-"` @@ -556,7 +805,7 @@ type ErrorMessage struct { // GetObjectsParameters request parameters for the GetObjectsByObjectIds API. type GetObjectsParameters struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties *map[string]*map[string]interface{} `json:",omitempty"` + AdditionalProperties map[string]interface{} `json:""` // ObjectIds - The requested object IDs. ObjectIds *[]string `json:"objectIds,omitempty"` // Types - The requested object types. @@ -565,6 +814,24 @@ type GetObjectsParameters struct { IncludeDirectoryObjectReferences *bool `json:"includeDirectoryObjectReferences,omitempty"` } +// MarshalJSON is the custom marshaler for GetObjectsParameters. +func (gop GetObjectsParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gop.ObjectIds != nil { + objectMap["objectIds"] = gop.ObjectIds + } + if gop.Types != nil { + objectMap["types"] = gop.Types + } + if gop.IncludeDirectoryObjectReferences != nil { + objectMap["includeDirectoryObjectReferences"] = gop.IncludeDirectoryObjectReferences + } + for k, v := range gop.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + // GetObjectsResult the response to an Active Directory object inquiry API request. type GetObjectsResult struct { autorest.Response `json:"-"` @@ -668,16 +935,18 @@ func (ge *GraphError) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["odata.error"] - if v != nil { - var odataerror OdataError - err = json.Unmarshal(*m["odata.error"], &odataerror) - if err != nil { - return err + for k, v := range m { + switch k { + case "odata.error": + if v != nil { + var odataError OdataError + err = json.Unmarshal(*v, &odataError) + if err != nil { + return err + } + ge.OdataError = &odataError + } } - ge.OdataError = &odataerror } return nil @@ -686,15 +955,27 @@ func (ge *GraphError) UnmarshalJSON(body []byte) error { // GroupAddMemberParameters request parameters for adding a member to a group. type GroupAddMemberParameters struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties *map[string]*map[string]interface{} `json:",omitempty"` + AdditionalProperties map[string]interface{} `json:""` // URL - A member object URL, such as "https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd", where "0b1f9851-1bf0-433f-aec3-cb9272f093dc" is the tenantId and "f260bbc4-c254-447b-94cf-293b5ec434dd" is the objectId of the member (user, application, servicePrincipal, group) to be added. URL *string `json:"url,omitempty"` } +// MarshalJSON is the custom marshaler for GroupAddMemberParameters. +func (gamp GroupAddMemberParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gamp.URL != nil { + objectMap["url"] = gamp.URL + } + for k, v := range gamp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + // GroupCreateParameters request parameters for creating a new group. type GroupCreateParameters struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties *map[string]*map[string]interface{} `json:",omitempty"` + AdditionalProperties map[string]interface{} `json:""` // DisplayName - Group display name DisplayName *string `json:"displayName,omitempty"` // MailEnabled - Whether the group is mail-enabled. Must be false. This is because only pure security groups can be created using the Graph API. @@ -705,14 +986,47 @@ type GroupCreateParameters struct { SecurityEnabled *bool `json:"securityEnabled,omitempty"` } +// MarshalJSON is the custom marshaler for GroupCreateParameters. +func (gcp GroupCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gcp.DisplayName != nil { + objectMap["displayName"] = gcp.DisplayName + } + if gcp.MailEnabled != nil { + objectMap["mailEnabled"] = gcp.MailEnabled + } + if gcp.MailNickname != nil { + objectMap["mailNickname"] = gcp.MailNickname + } + if gcp.SecurityEnabled != nil { + objectMap["securityEnabled"] = gcp.SecurityEnabled + } + for k, v := range gcp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + // GroupGetMemberGroupsParameters request parameters for GetMemberGroups API call. type GroupGetMemberGroupsParameters struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties *map[string]*map[string]interface{} `json:",omitempty"` + AdditionalProperties map[string]interface{} `json:""` // SecurityEnabledOnly - If true, only membership in security-enabled groups should be checked. Otherwise, membership in all groups should be checked. SecurityEnabledOnly *bool `json:"securityEnabledOnly,omitempty"` } +// MarshalJSON is the custom marshaler for GroupGetMemberGroupsParameters. +func (ggmgp GroupGetMemberGroupsParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ggmgp.SecurityEnabledOnly != nil { + objectMap["securityEnabledOnly"] = ggmgp.SecurityEnabledOnly + } + for k, v := range ggmgp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + // GroupGetMemberGroupsResult server response for GetMemberGroups API call. type GroupGetMemberGroupsResult struct { autorest.Response `json:"-"` @@ -813,7 +1127,7 @@ func (page GroupListResultPage) Values() []ADGroup { // KeyCredential active Directory Key Credential information. type KeyCredential struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties *map[string]*map[string]interface{} `json:",omitempty"` + AdditionalProperties map[string]interface{} `json:""` // StartDate - Start date. StartDate *date.Time `json:"startDate,omitempty"` // EndDate - End date. @@ -828,6 +1142,33 @@ type KeyCredential struct { Type *string `json:"type,omitempty"` } +// MarshalJSON is the custom marshaler for KeyCredential. +func (kc KeyCredential) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if kc.StartDate != nil { + objectMap["startDate"] = kc.StartDate + } + if kc.EndDate != nil { + objectMap["endDate"] = kc.EndDate + } + if kc.Value != nil { + objectMap["value"] = kc.Value + } + if kc.KeyID != nil { + objectMap["keyId"] = kc.KeyID + } + if kc.Usage != nil { + objectMap["usage"] = kc.Usage + } + if kc.Type != nil { + objectMap["type"] = kc.Type + } + for k, v := range kc.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + // KeyCredentialListResult keyCredential list operation result. type KeyCredentialListResult struct { autorest.Response `json:"-"` @@ -856,26 +1197,27 @@ func (oe *OdataError) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["code"] - if v != nil { - var code string - err = json.Unmarshal(*m["code"], &code) - if err != nil { - return err + for k, v := range m { + switch k { + case "code": + if v != nil { + var code string + err = json.Unmarshal(*v, &code) + if err != nil { + return err + } + oe.Code = &code + } + case "message": + if v != nil { + var errorMessage ErrorMessage + err = json.Unmarshal(*v, &errorMessage) + if err != nil { + return err + } + oe.ErrorMessage = &errorMessage + } } - oe.Code = &code - } - - v = m["message"] - if v != nil { - var message ErrorMessage - err = json.Unmarshal(*m["message"], &message) - if err != nil { - return err - } - oe.ErrorMessage = &message } return nil @@ -884,7 +1226,7 @@ func (oe *OdataError) UnmarshalJSON(body []byte) error { // PasswordCredential active Directory Password Credential information. type PasswordCredential struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties *map[string]*map[string]interface{} `json:",omitempty"` + AdditionalProperties map[string]interface{} `json:""` // StartDate - Start date. StartDate *date.Time `json:"startDate,omitempty"` // EndDate - End date. @@ -895,6 +1237,27 @@ type PasswordCredential struct { Value *string `json:"value,omitempty"` } +// MarshalJSON is the custom marshaler for PasswordCredential. +func (pc PasswordCredential) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pc.StartDate != nil { + objectMap["startDate"] = pc.StartDate + } + if pc.EndDate != nil { + objectMap["endDate"] = pc.EndDate + } + if pc.KeyID != nil { + objectMap["keyId"] = pc.KeyID + } + if pc.Value != nil { + objectMap["value"] = pc.Value + } + for k, v := range pc.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + // PasswordCredentialListResult passwordCredential list operation result. type PasswordCredentialListResult struct { autorest.Response `json:"-"` @@ -911,65 +1274,125 @@ type PasswordCredentialsUpdateParameters struct { // PasswordProfile the password profile associated with a user. type PasswordProfile struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties *map[string]*map[string]interface{} `json:",omitempty"` + AdditionalProperties map[string]interface{} `json:""` // Password - Password Password *string `json:"password,omitempty"` // ForceChangePasswordNextLogin - Whether to force a password change on next login. ForceChangePasswordNextLogin *bool `json:"forceChangePasswordNextLogin,omitempty"` } -// RequiredResourceAccess specifies the set of OAuth 2.0 permission scopes and app roles under the specified resource -// that an application requires access to. The specified OAuth 2.0 permission scopes may be requested by client -// applications (through the requiredResourceAccess collection) when calling a resource application. The +// MarshalJSON is the custom marshaler for PasswordProfile. +func (pp PasswordProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pp.Password != nil { + objectMap["password"] = pp.Password + } + if pp.ForceChangePasswordNextLogin != nil { + objectMap["forceChangePasswordNextLogin"] = pp.ForceChangePasswordNextLogin + } + for k, v := range pp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// RequiredResourceAccess specifies the set of OAuth 2.0 permission scopes and app roles under the specified +// resource that an application requires access to. The specified OAuth 2.0 permission scopes may be requested by +// client applications (through the requiredResourceAccess collection) when calling a resource application. The // requiredResourceAccess property of the Application entity is a collection of ReqiredResourceAccess. type RequiredResourceAccess struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties *map[string]*map[string]interface{} `json:",omitempty"` + AdditionalProperties map[string]interface{} `json:""` // ResourceAccess - The list of OAuth2.0 permission scopes and app roles that the application requires from the specified resource. ResourceAccess *[]ResourceAccess `json:"resourceAccess,omitempty"` // ResourceAppID - The unique identifier for the resource that the application requires access to. This should be equal to the appId declared on the target resource application. ResourceAppID *string `json:"resourceAppId,omitempty"` } +// MarshalJSON is the custom marshaler for RequiredResourceAccess. +func (rra RequiredResourceAccess) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rra.ResourceAccess != nil { + objectMap["resourceAccess"] = rra.ResourceAccess + } + if rra.ResourceAppID != nil { + objectMap["resourceAppId"] = rra.ResourceAppID + } + for k, v := range rra.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + // ResourceAccess specifies an OAuth 2.0 permission scope or an app role that an application requires. The // resourceAccess property of the RequiredResourceAccess type is a collection of ResourceAccess. type ResourceAccess struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties *map[string]*map[string]interface{} `json:",omitempty"` + AdditionalProperties map[string]interface{} `json:""` // ID - The unique identifier for one of the OAuth2Permission or AppRole instances that the resource application exposes. ID *string `json:"id,omitempty"` // Type - Specifies whether the id property references an OAuth2Permission or an AppRole. Possible values are "scope" or "role". Type *string `json:"type,omitempty"` } +// MarshalJSON is the custom marshaler for ResourceAccess. +func (ra ResourceAccess) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ra.ID != nil { + objectMap["id"] = ra.ID + } + if ra.Type != nil { + objectMap["type"] = ra.Type + } + for k, v := range ra.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + // ServicePrincipal active Directory service principal information. type ServicePrincipal struct { autorest.Response `json:"-"` - // ObjectID - The object ID. - ObjectID *string `json:"objectId,omitempty"` - // DeletionTimestamp - The time at which the directory object was deleted. - DeletionTimestamp *date.Time `json:"deletionTimestamp,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeDirectoryObject', 'ObjectTypeApplication', 'ObjectTypeGroup', 'ObjectTypeServicePrincipal', 'ObjectTypeUser' - ObjectType ObjectType `json:"objectType,omitempty"` - // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties *map[string]*map[string]interface{} `json:",omitempty"` // DisplayName - The display name of the service principal. DisplayName *string `json:"displayName,omitempty"` // AppID - The application ID. AppID *string `json:"appId,omitempty"` // ServicePrincipalNames - A collection of service principal names. ServicePrincipalNames *[]string `json:"servicePrincipalNames,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ObjectID - The object ID. + ObjectID *string `json:"objectId,omitempty"` + // DeletionTimestamp - The time at which the directory object was deleted. + DeletionTimestamp *date.Time `json:"deletionTimestamp,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeDirectoryObject', 'ObjectTypeApplication', 'ObjectTypeGroup', 'ObjectTypeServicePrincipal', 'ObjectTypeUser' + ObjectType ObjectType `json:"objectType,omitempty"` } // MarshalJSON is the custom marshaler for ServicePrincipal. func (sp ServicePrincipal) MarshalJSON() ([]byte, error) { sp.ObjectType = ObjectTypeServicePrincipal - type Alias ServicePrincipal - return json.Marshal(&struct { - Alias - }{ - Alias: (Alias)(sp), - }) + objectMap := make(map[string]interface{}) + if sp.DisplayName != nil { + objectMap["displayName"] = sp.DisplayName + } + if sp.AppID != nil { + objectMap["appId"] = sp.AppID + } + if sp.ServicePrincipalNames != nil { + objectMap["servicePrincipalNames"] = sp.ServicePrincipalNames + } + if sp.ObjectID != nil { + objectMap["objectId"] = sp.ObjectID + } + if sp.DeletionTimestamp != nil { + objectMap["deletionTimestamp"] = sp.DeletionTimestamp + } + objectMap["objectType"] = sp.ObjectType + for k, v := range sp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) } // AsApplication is the BasicDirectoryObject implementation for ServicePrincipal. @@ -1005,7 +1428,7 @@ func (sp ServicePrincipal) AsBasicDirectoryObject() (BasicDirectoryObject, bool) // ServicePrincipalCreateParameters request parameters for creating a new service principal. type ServicePrincipalCreateParameters struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties *map[string]*map[string]interface{} `json:",omitempty"` + AdditionalProperties map[string]interface{} `json:""` // AppID - application Id AppID *string `json:"appId,omitempty"` // AccountEnabled - Whether the account is enabled @@ -1016,6 +1439,27 @@ type ServicePrincipalCreateParameters struct { PasswordCredentials *[]PasswordCredential `json:"passwordCredentials,omitempty"` } +// MarshalJSON is the custom marshaler for ServicePrincipalCreateParameters. +func (spcp ServicePrincipalCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if spcp.AppID != nil { + objectMap["appId"] = spcp.AppID + } + if spcp.AccountEnabled != nil { + objectMap["accountEnabled"] = spcp.AccountEnabled + } + if spcp.KeyCredentials != nil { + objectMap["keyCredentials"] = spcp.KeyCredentials + } + if spcp.PasswordCredentials != nil { + objectMap["passwordCredentials"] = spcp.PasswordCredentials + } + for k, v := range spcp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + // ServicePrincipalListResult server response for get tenant service principals API call. type ServicePrincipalListResult struct { autorest.Response `json:"-"` @@ -1110,24 +1554,31 @@ func (page ServicePrincipalListResultPage) Values() []ServicePrincipal { // tenant. type SignInName struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties *map[string]*map[string]interface{} `json:",omitempty"` + AdditionalProperties map[string]interface{} `json:""` // Type - A string value that can be used to classify user sign-in types in your directory, such as 'emailAddress' or 'userName'. Type *string `json:"type,omitempty"` // Value - The sign-in used by the local account. Must be unique across the company/tenant. For example, 'johnc@example.com'. Value *string `json:"value,omitempty"` } +// MarshalJSON is the custom marshaler for SignInName. +func (sin SignInName) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sin.Type != nil { + objectMap["type"] = sin.Type + } + if sin.Value != nil { + objectMap["value"] = sin.Value + } + for k, v := range sin.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + // User active Directory user information. type User struct { autorest.Response `json:"-"` - // ObjectID - The object ID. - ObjectID *string `json:"objectId,omitempty"` - // DeletionTimestamp - The time at which the directory object was deleted. - DeletionTimestamp *date.Time `json:"deletionTimestamp,omitempty"` - // ObjectType - Possible values include: 'ObjectTypeDirectoryObject', 'ObjectTypeApplication', 'ObjectTypeGroup', 'ObjectTypeServicePrincipal', 'ObjectTypeUser' - ObjectType ObjectType `json:"objectType,omitempty"` - // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties *map[string]*map[string]interface{} `json:",omitempty"` // ImmutableID - This must be specified if you are using a federated domain for the user's userPrincipalName (UPN) property when creating a new user account. It is used to associate an on-premises Active Directory user account with their Azure AD user object. ImmutableID *string `json:"immutableId,omitempty"` // UsageLocation - A two letter country code (ISO standard 3166). Required for users that will be assigned licenses due to legal requirement to check for availability of services in countries. Examples include: "US", "JP", and "GB". @@ -1150,17 +1601,62 @@ type User struct { Mail *string `json:"mail,omitempty"` // SignInNames - The sign-in names of the user. SignInNames *[]SignInName `json:"signInNames,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ObjectID - The object ID. + ObjectID *string `json:"objectId,omitempty"` + // DeletionTimestamp - The time at which the directory object was deleted. + DeletionTimestamp *date.Time `json:"deletionTimestamp,omitempty"` + // ObjectType - Possible values include: 'ObjectTypeDirectoryObject', 'ObjectTypeApplication', 'ObjectTypeGroup', 'ObjectTypeServicePrincipal', 'ObjectTypeUser' + ObjectType ObjectType `json:"objectType,omitempty"` } // MarshalJSON is the custom marshaler for User. func (u User) MarshalJSON() ([]byte, error) { u.ObjectType = ObjectTypeUser - type Alias User - return json.Marshal(&struct { - Alias - }{ - Alias: (Alias)(u), - }) + objectMap := make(map[string]interface{}) + if u.ImmutableID != nil { + objectMap["immutableId"] = u.ImmutableID + } + if u.UsageLocation != nil { + objectMap["usageLocation"] = u.UsageLocation + } + if u.GivenName != nil { + objectMap["givenName"] = u.GivenName + } + if u.Surname != nil { + objectMap["surname"] = u.Surname + } + objectMap["userType"] = u.UserType + if u.AccountEnabled != nil { + objectMap["accountEnabled"] = u.AccountEnabled + } + if u.DisplayName != nil { + objectMap["displayName"] = u.DisplayName + } + if u.UserPrincipalName != nil { + objectMap["userPrincipalName"] = u.UserPrincipalName + } + if u.MailNickname != nil { + objectMap["mailNickname"] = u.MailNickname + } + if u.Mail != nil { + objectMap["mail"] = u.Mail + } + if u.SignInNames != nil { + objectMap["signInNames"] = u.SignInNames + } + if u.ObjectID != nil { + objectMap["objectId"] = u.ObjectID + } + if u.DeletionTimestamp != nil { + objectMap["deletionTimestamp"] = u.DeletionTimestamp + } + objectMap["objectType"] = u.ObjectType + for k, v := range u.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) } // AsApplication is the BasicDirectoryObject implementation for User. @@ -1196,7 +1692,7 @@ func (u User) AsBasicDirectoryObject() (BasicDirectoryObject, bool) { // UserBase ... type UserBase struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties *map[string]*map[string]interface{} `json:",omitempty"` + AdditionalProperties map[string]interface{} `json:""` // ImmutableID - This must be specified if you are using a federated domain for the user's userPrincipalName (UPN) property when creating a new user account. It is used to associate an on-premises Active Directory user account with their Azure AD user object. ImmutableID *string `json:"immutableId,omitempty"` // UsageLocation - A two letter country code (ISO standard 3166). Required for users that will be assigned licenses due to legal requirement to check for availability of services in countries. Examples include: "US", "JP", and "GB". @@ -1209,20 +1705,30 @@ type UserBase struct { UserType UserType `json:"userType,omitempty"` } +// MarshalJSON is the custom marshaler for UserBase. +func (ub UserBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ub.ImmutableID != nil { + objectMap["immutableId"] = ub.ImmutableID + } + if ub.UsageLocation != nil { + objectMap["usageLocation"] = ub.UsageLocation + } + if ub.GivenName != nil { + objectMap["givenName"] = ub.GivenName + } + if ub.Surname != nil { + objectMap["surname"] = ub.Surname + } + objectMap["userType"] = ub.UserType + for k, v := range ub.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + // UserCreateParameters request parameters for creating a new work or school account user. type UserCreateParameters struct { - // ImmutableID - This must be specified if you are using a federated domain for the user's userPrincipalName (UPN) property when creating a new user account. It is used to associate an on-premises Active Directory user account with their Azure AD user object. - ImmutableID *string `json:"immutableId,omitempty"` - // UsageLocation - A two letter country code (ISO standard 3166). Required for users that will be assigned licenses due to legal requirement to check for availability of services in countries. Examples include: "US", "JP", and "GB". - UsageLocation *string `json:"usageLocation,omitempty"` - // GivenName - The given name for the user. - GivenName *string `json:"givenName,omitempty"` - // Surname - The user's surname (family name or last name). - Surname *string `json:"surname,omitempty"` - // UserType - A string value that can be used to classify user types in your directory, such as 'Member' and 'Guest'. Possible values include: 'Member', 'Guest' - UserType UserType `json:"userType,omitempty"` - // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties *map[string]*map[string]interface{} `json:",omitempty"` // AccountEnabled - Whether the account is enabled. AccountEnabled *bool `json:"accountEnabled,omitempty"` // DisplayName - The display name of the user. @@ -1235,16 +1741,80 @@ type UserCreateParameters struct { MailNickname *string `json:"mailNickname,omitempty"` // Mail - The primary email address of the user. Mail *string `json:"mail,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ImmutableID - This must be specified if you are using a federated domain for the user's userPrincipalName (UPN) property when creating a new user account. It is used to associate an on-premises Active Directory user account with their Azure AD user object. + ImmutableID *string `json:"immutableId,omitempty"` + // UsageLocation - A two letter country code (ISO standard 3166). Required for users that will be assigned licenses due to legal requirement to check for availability of services in countries. Examples include: "US", "JP", and "GB". + UsageLocation *string `json:"usageLocation,omitempty"` + // GivenName - The given name for the user. + GivenName *string `json:"givenName,omitempty"` + // Surname - The user's surname (family name or last name). + Surname *string `json:"surname,omitempty"` + // UserType - A string value that can be used to classify user types in your directory, such as 'Member' and 'Guest'. Possible values include: 'Member', 'Guest' + UserType UserType `json:"userType,omitempty"` +} + +// MarshalJSON is the custom marshaler for UserCreateParameters. +func (ucp UserCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ucp.AccountEnabled != nil { + objectMap["accountEnabled"] = ucp.AccountEnabled + } + if ucp.DisplayName != nil { + objectMap["displayName"] = ucp.DisplayName + } + if ucp.PasswordProfile != nil { + objectMap["passwordProfile"] = ucp.PasswordProfile + } + if ucp.UserPrincipalName != nil { + objectMap["userPrincipalName"] = ucp.UserPrincipalName + } + if ucp.MailNickname != nil { + objectMap["mailNickname"] = ucp.MailNickname + } + if ucp.Mail != nil { + objectMap["mail"] = ucp.Mail + } + if ucp.ImmutableID != nil { + objectMap["immutableId"] = ucp.ImmutableID + } + if ucp.UsageLocation != nil { + objectMap["usageLocation"] = ucp.UsageLocation + } + if ucp.GivenName != nil { + objectMap["givenName"] = ucp.GivenName + } + if ucp.Surname != nil { + objectMap["surname"] = ucp.Surname + } + objectMap["userType"] = ucp.UserType + for k, v := range ucp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) } // UserGetMemberGroupsParameters request parameters for GetMemberGroups API call. type UserGetMemberGroupsParameters struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties *map[string]*map[string]interface{} `json:",omitempty"` + AdditionalProperties map[string]interface{} `json:""` // SecurityEnabledOnly - If true, only membership in security-enabled groups should be checked. Otherwise, membership in all groups should be checked. SecurityEnabledOnly *bool `json:"securityEnabledOnly,omitempty"` } +// MarshalJSON is the custom marshaler for UserGetMemberGroupsParameters. +func (ugmgp UserGetMemberGroupsParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ugmgp.SecurityEnabledOnly != nil { + objectMap["securityEnabledOnly"] = ugmgp.SecurityEnabledOnly + } + for k, v := range ugmgp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + // UserGetMemberGroupsResult server response for GetMemberGroups API call. type UserGetMemberGroupsResult struct { autorest.Response `json:"-"` @@ -1344,18 +1914,6 @@ func (page UserListResultPage) Values() []User { // UserUpdateParameters request parameters for updating an existing work or school account user. type UserUpdateParameters struct { - // ImmutableID - This must be specified if you are using a federated domain for the user's userPrincipalName (UPN) property when creating a new user account. It is used to associate an on-premises Active Directory user account with their Azure AD user object. - ImmutableID *string `json:"immutableId,omitempty"` - // UsageLocation - A two letter country code (ISO standard 3166). Required for users that will be assigned licenses due to legal requirement to check for availability of services in countries. Examples include: "US", "JP", and "GB". - UsageLocation *string `json:"usageLocation,omitempty"` - // GivenName - The given name for the user. - GivenName *string `json:"givenName,omitempty"` - // Surname - The user's surname (family name or last name). - Surname *string `json:"surname,omitempty"` - // UserType - A string value that can be used to classify user types in your directory, such as 'Member' and 'Guest'. Possible values include: 'Member', 'Guest' - UserType UserType `json:"userType,omitempty"` - // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties *map[string]*map[string]interface{} `json:",omitempty"` // AccountEnabled - Whether the account is enabled. AccountEnabled *bool `json:"accountEnabled,omitempty"` // DisplayName - The display name of the user. @@ -1366,4 +1924,53 @@ type UserUpdateParameters struct { UserPrincipalName *string `json:"userPrincipalName,omitempty"` // MailNickname - The mail alias for the user. MailNickname *string `json:"mailNickname,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // ImmutableID - This must be specified if you are using a federated domain for the user's userPrincipalName (UPN) property when creating a new user account. It is used to associate an on-premises Active Directory user account with their Azure AD user object. + ImmutableID *string `json:"immutableId,omitempty"` + // UsageLocation - A two letter country code (ISO standard 3166). Required for users that will be assigned licenses due to legal requirement to check for availability of services in countries. Examples include: "US", "JP", and "GB". + UsageLocation *string `json:"usageLocation,omitempty"` + // GivenName - The given name for the user. + GivenName *string `json:"givenName,omitempty"` + // Surname - The user's surname (family name or last name). + Surname *string `json:"surname,omitempty"` + // UserType - A string value that can be used to classify user types in your directory, such as 'Member' and 'Guest'. Possible values include: 'Member', 'Guest' + UserType UserType `json:"userType,omitempty"` +} + +// MarshalJSON is the custom marshaler for UserUpdateParameters. +func (uup UserUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if uup.AccountEnabled != nil { + objectMap["accountEnabled"] = uup.AccountEnabled + } + if uup.DisplayName != nil { + objectMap["displayName"] = uup.DisplayName + } + if uup.PasswordProfile != nil { + objectMap["passwordProfile"] = uup.PasswordProfile + } + if uup.UserPrincipalName != nil { + objectMap["userPrincipalName"] = uup.UserPrincipalName + } + if uup.MailNickname != nil { + objectMap["mailNickname"] = uup.MailNickname + } + if uup.ImmutableID != nil { + objectMap["immutableId"] = uup.ImmutableID + } + if uup.UsageLocation != nil { + objectMap["usageLocation"] = uup.UsageLocation + } + if uup.GivenName != nil { + objectMap["givenName"] = uup.GivenName + } + if uup.Surname != nil { + objectMap["surname"] = uup.Surname + } + objectMap["userType"] = uup.UserType + for k, v := range uup.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/objects.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/objects.go index f0c34caf78cc..09b2c687067b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/objects.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/objects.go @@ -110,7 +110,7 @@ func (client ObjectsClient) GetObjectsByObjectIds(ctx context.Context, parameter if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.IncludeDirectoryObjectReferences", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "graphrbac.ObjectsClient", "GetObjectsByObjectIds") + return result, validation.NewError("graphrbac.ObjectsClient", "GetObjectsByObjectIds", err.Error()) } result.fn = func(lastResult GetObjectsResult) (GetObjectsResult, error) { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/serviceprincipals.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/serviceprincipals.go index 8a9e7c66faee..68d7f334a61a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/serviceprincipals.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/serviceprincipals.go @@ -49,7 +49,7 @@ func (client ServicePrincipalsClient) Create(ctx context.Context, parameters Ser {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.AppID", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.AccountEnabled", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "graphrbac.ServicePrincipalsClient", "Create") + return result, validation.NewError("graphrbac.ServicePrincipalsClient", "Create", err.Error()) } req, err := client.CreatePreparer(ctx, parameters) @@ -651,8 +651,8 @@ func (client ServicePrincipalsClient) UpdateKeyCredentialsResponder(resp *http.R // UpdatePasswordCredentials updates the passwordCredentials associated with a service principal. // -// objectID is the object ID of the service principal. parameters is parameters to update the passwordCredentials of an -// existing service principal. +// objectID is the object ID of the service principal. parameters is parameters to update the passwordCredentials +// of an existing service principal. func (client ServicePrincipalsClient) UpdatePasswordCredentials(ctx context.Context, objectID string, parameters PasswordCredentialsUpdateParameters) (result autorest.Response, err error) { req, err := client.UpdatePasswordCredentialsPreparer(ctx, objectID, parameters) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/users.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/users.go index ad1350f64c97..b3e17df6ad00 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/users.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/users.go @@ -53,7 +53,7 @@ func (client UsersClient) Create(ctx context.Context, parameters UserCreateParam Chain: []validation.Constraint{{Target: "parameters.PasswordProfile.Password", Name: validation.Null, Rule: true, Chain: nil}}}, {Target: "parameters.UserPrincipalName", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.MailNickname", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "graphrbac.UsersClient", "Create") + return result, validation.NewError("graphrbac.UsersClient", "Create", err.Error()) } req, err := client.CreatePreparer(ctx, parameters) @@ -249,12 +249,13 @@ func (client UsersClient) GetResponder(resp *http.Response) (result User, err er // GetMemberGroups gets a collection that contains the object IDs of the groups of which the user is a member. // -// objectID is the object ID of the user for which to get group membership. parameters is user filtering parameters. +// objectID is the object ID of the user for which to get group membership. parameters is user filtering +// parameters. func (client UsersClient) GetMemberGroups(ctx context.Context, objectID string, parameters UserGetMemberGroupsParameters) (result UserGetMemberGroupsResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.SecurityEnabledOnly", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "graphrbac.UsersClient", "GetMemberGroups") + return result, validation.NewError("graphrbac.UsersClient", "GetMemberGroups", err.Error()) } req, err := client.GetMemberGroupsPreparer(ctx, objectID, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/version.go index 3a511128c1db..b8397dc96ad8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/version.go @@ -1,5 +1,7 @@ package graphrbac +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package graphrbac // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta services" + return "Azure-SDK-For-Go/" + version.Number + " graphrbac/1.6" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2017-07-01/devices/certificates.go b/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2017-07-01/devices/certificates.go index 62b912c71e48..5067b3021d4a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2017-07-01/devices/certificates.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2017-07-01/devices/certificates.go @@ -42,14 +42,15 @@ func NewCertificatesClientWithBaseURI(baseURI string, subscriptionID string) Cer // CreateOrUpdate adds new or replaces existing certificate. // -// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the IoT -// hub. certificateName is the name of the certificate certificateDescription is the certificate body. ifMatch is eTag -// of the Certificate. Do not specify for creating a brand new certificate. Required to update an existing certificate. +// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the +// IoT hub. certificateName is the name of the certificate certificateDescription is the certificate body. ifMatch +// is eTag of the Certificate. Do not specify for creating a brand new certificate. Required to update an existing +// certificate. func (client CertificatesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, certificateName string, certificateDescription CertificateBodyDescription, ifMatch string) (result CertificateDescription, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: certificateName, Constraints: []validation.Constraint{{Target: "certificateName", Name: validation.Pattern, Rule: `^[A-Za-z0-9-._]{1,64}$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "devices.CertificatesClient", "CreateOrUpdate") + return result, validation.NewError("devices.CertificatesClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, certificateName, certificateDescription, ifMatch) @@ -123,13 +124,13 @@ func (client CertificatesClient) CreateOrUpdateResponder(resp *http.Response) (r // Delete deletes an existing X509 certificate or does nothing if it does not exist. // -// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the IoT -// hub. certificateName is the name of the certificate ifMatch is eTag of the Certificate. +// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the +// IoT hub. certificateName is the name of the certificate ifMatch is eTag of the Certificate. func (client CertificatesClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, certificateName string, ifMatch string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: certificateName, Constraints: []validation.Constraint{{Target: "certificateName", Name: validation.Pattern, Rule: `^[A-Za-z0-9-._]{1,64}$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "devices.CertificatesClient", "Delete") + return result, validation.NewError("devices.CertificatesClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, certificateName, ifMatch) @@ -198,13 +199,13 @@ func (client CertificatesClient) DeleteResponder(resp *http.Response) (result au // GenerateVerificationCode generates verification code for proof of possession flow. The verification code will be // used to generate a leaf certificate. // -// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the IoT -// hub. certificateName is the name of the certificate ifMatch is eTag of the Certificate. +// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the +// IoT hub. certificateName is the name of the certificate ifMatch is eTag of the Certificate. func (client CertificatesClient) GenerateVerificationCode(ctx context.Context, resourceGroupName string, resourceName string, certificateName string, ifMatch string) (result CertificateWithNonceDescription, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: certificateName, Constraints: []validation.Constraint{{Target: "certificateName", Name: validation.Pattern, Rule: `^[A-Za-z0-9-._]{1,64}$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "devices.CertificatesClient", "GenerateVerificationCode") + return result, validation.NewError("devices.CertificatesClient", "GenerateVerificationCode", err.Error()) } req, err := client.GenerateVerificationCodePreparer(ctx, resourceGroupName, resourceName, certificateName, ifMatch) @@ -273,13 +274,13 @@ func (client CertificatesClient) GenerateVerificationCodeResponder(resp *http.Re // Get returns the certificate. // -// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the IoT -// hub. certificateName is the name of the certificate +// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the +// IoT hub. certificateName is the name of the certificate func (client CertificatesClient) Get(ctx context.Context, resourceGroupName string, resourceName string, certificateName string) (result CertificateDescription, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: certificateName, Constraints: []validation.Constraint{{Target: "certificateName", Name: validation.Pattern, Rule: `^[A-Za-z0-9-._]{1,64}$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "devices.CertificatesClient", "Get") + return result, validation.NewError("devices.CertificatesClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, certificateName) @@ -347,8 +348,8 @@ func (client CertificatesClient) GetResponder(resp *http.Response) (result Certi // ListByIotHub returns the list of certificates. // -// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the IoT -// hub. +// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the +// IoT hub. func (client CertificatesClient) ListByIotHub(ctx context.Context, resourceGroupName string, resourceName string) (result CertificateListDescription, err error) { req, err := client.ListByIotHubPreparer(ctx, resourceGroupName, resourceName) if err != nil { @@ -415,14 +416,14 @@ func (client CertificatesClient) ListByIotHubResponder(resp *http.Response) (res // Verify verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre // uploaded certificate. // -// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the IoT -// hub. certificateName is the name of the certificate certificateVerificationBody is the name of the certificate -// ifMatch is eTag of the Certificate. +// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the +// IoT hub. certificateName is the name of the certificate certificateVerificationBody is the name of the +// certificate ifMatch is eTag of the Certificate. func (client CertificatesClient) Verify(ctx context.Context, resourceGroupName string, resourceName string, certificateName string, certificateVerificationBody CertificateVerificationDescription, ifMatch string) (result CertificateDescription, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: certificateName, Constraints: []validation.Constraint{{Target: "certificateName", Name: validation.Pattern, Rule: `^[A-Za-z0-9-._]{1,64}$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "devices.CertificatesClient", "Verify") + return result, validation.NewError("devices.CertificatesClient", "Verify", err.Error()) } req, err := client.VerifyPreparer(ctx, resourceGroupName, resourceName, certificateName, certificateVerificationBody, ifMatch) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2017-07-01/devices/iothubresource.go b/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2017-07-01/devices/iothubresource.go index 97d7e2996b09..300c05df7e92 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2017-07-01/devices/iothubresource.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2017-07-01/devices/iothubresource.go @@ -47,7 +47,7 @@ func (client IotHubResourceClient) CheckNameAvailability(ctx context.Context, op if err := validation.Validate([]validation.Validation{ {TargetValue: operationInputs, Constraints: []validation.Constraint{{Target: "operationInputs.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "devices.IotHubResourceClient", "CheckNameAvailability") + return result, validation.NewError("devices.IotHubResourceClient", "CheckNameAvailability", err.Error()) } req, err := client.CheckNameAvailabilityPreparer(ctx, operationInputs) @@ -114,9 +114,9 @@ func (client IotHubResourceClient) CheckNameAvailabilityResponder(resp *http.Res // CreateEventHubConsumerGroup add a consumer group to an Event Hub-compatible endpoint in an IoT hub. // -// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the IoT -// hub. eventHubEndpointName is the name of the Event Hub-compatible endpoint in the IoT hub. name is the name of the -// consumer group to add. +// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the +// IoT hub. eventHubEndpointName is the name of the Event Hub-compatible endpoint in the IoT hub. name is the name +// of the consumer group to add. func (client IotHubResourceClient) CreateEventHubConsumerGroup(ctx context.Context, resourceGroupName string, resourceName string, eventHubEndpointName string, name string) (result EventHubConsumerGroupInfo, err error) { req, err := client.CreateEventHubConsumerGroupPreparer(ctx, resourceGroupName, resourceName, eventHubEndpointName, name) if err != nil { @@ -186,9 +186,9 @@ func (client IotHubResourceClient) CreateEventHubConsumerGroupResponder(resp *ht // the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update // the IoT hub. // -// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the IoT -// hub. iotHubDescription is the IoT hub metadata and security metadata. ifMatch is eTag of the IoT Hub. Do not specify -// for creating a brand new IoT Hub. Required to update an existing IoT Hub. +// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the +// IoT hub. iotHubDescription is the IoT hub metadata and security metadata. ifMatch is eTag of the IoT Hub. Do not +// specify for creating a brand new IoT Hub. Required to update an existing IoT Hub. func (client IotHubResourceClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, iotHubDescription IotHubDescription, ifMatch string) (result IotHubResourceCreateOrUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: iotHubDescription, @@ -220,7 +220,7 @@ func (client IotHubResourceClient) CreateOrUpdate(ctx context.Context, resourceG }}, {Target: "iotHubDescription.Sku", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "iotHubDescription.Sku.Capacity", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "devices.IotHubResourceClient", "CreateOrUpdate") + return result, validation.NewError("devices.IotHubResourceClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, iotHubDescription, ifMatch) @@ -295,8 +295,8 @@ func (client IotHubResourceClient) CreateOrUpdateResponder(resp *http.Response) // Delete delete an IoT hub. // -// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the IoT -// hub. +// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the +// IoT hub. func (client IotHubResourceClient) Delete(ctx context.Context, resourceGroupName string, resourceName string) (result IotHubResourceDeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName) if err != nil { @@ -364,9 +364,9 @@ func (client IotHubResourceClient) DeleteResponder(resp *http.Response) (result // DeleteEventHubConsumerGroup delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. // -// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the IoT -// hub. eventHubEndpointName is the name of the Event Hub-compatible endpoint in the IoT hub. name is the name of the -// consumer group to delete. +// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the +// IoT hub. eventHubEndpointName is the name of the Event Hub-compatible endpoint in the IoT hub. name is the name +// of the consumer group to delete. func (client IotHubResourceClient) DeleteEventHubConsumerGroup(ctx context.Context, resourceGroupName string, resourceName string, eventHubEndpointName string, name string) (result autorest.Response, err error) { req, err := client.DeleteEventHubConsumerGroupPreparer(ctx, resourceGroupName, resourceName, eventHubEndpointName, name) if err != nil { @@ -435,14 +435,14 @@ func (client IotHubResourceClient) DeleteEventHubConsumerGroupResponder(resp *ht // For more information, see: // https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. // -// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the IoT -// hub. exportDevicesParameters is the parameters that specify the export devices operation. +// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the +// IoT hub. exportDevicesParameters is the parameters that specify the export devices operation. func (client IotHubResourceClient) ExportDevices(ctx context.Context, resourceGroupName string, resourceName string, exportDevicesParameters ExportDevicesRequest) (result JobResponse, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: exportDevicesParameters, Constraints: []validation.Constraint{{Target: "exportDevicesParameters.ExportBlobContainerURI", Name: validation.Null, Rule: true, Chain: nil}, {Target: "exportDevicesParameters.ExcludeKeys", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "devices.IotHubResourceClient", "ExportDevices") + return result, validation.NewError("devices.IotHubResourceClient", "ExportDevices", err.Error()) } req, err := client.ExportDevicesPreparer(ctx, resourceGroupName, resourceName, exportDevicesParameters) @@ -511,8 +511,8 @@ func (client IotHubResourceClient) ExportDevicesResponder(resp *http.Response) ( // Get get the non-security related metadata of an IoT hub. // -// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the IoT -// hub. +// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the +// IoT hub. func (client IotHubResourceClient) Get(ctx context.Context, resourceGroupName string, resourceName string) (result IotHubDescription, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, resourceName) if err != nil { @@ -578,9 +578,9 @@ func (client IotHubResourceClient) GetResponder(resp *http.Response) (result Iot // GetEventHubConsumerGroup get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. // -// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the IoT -// hub. eventHubEndpointName is the name of the Event Hub-compatible endpoint in the IoT hub. name is the name of the -// consumer group to retrieve. +// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the +// IoT hub. eventHubEndpointName is the name of the Event Hub-compatible endpoint in the IoT hub. name is the name +// of the consumer group to retrieve. func (client IotHubResourceClient) GetEventHubConsumerGroup(ctx context.Context, resourceGroupName string, resourceName string, eventHubEndpointName string, name string) (result EventHubConsumerGroupInfo, err error) { req, err := client.GetEventHubConsumerGroupPreparer(ctx, resourceGroupName, resourceName, eventHubEndpointName, name) if err != nil { @@ -649,8 +649,8 @@ func (client IotHubResourceClient) GetEventHubConsumerGroupResponder(resp *http. // GetJob get the details of a job from an IoT hub. For more information, see: // https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. // -// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the IoT -// hub. jobID is the job identifier. +// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the +// IoT hub. jobID is the job identifier. func (client IotHubResourceClient) GetJob(ctx context.Context, resourceGroupName string, resourceName string, jobID string) (result JobResponse, err error) { req, err := client.GetJobPreparer(ctx, resourceGroupName, resourceName, jobID) if err != nil { @@ -718,8 +718,8 @@ func (client IotHubResourceClient) GetJobResponder(resp *http.Response) (result // GetKeysForKeyName get a shared access policy by name from an IoT hub. For more information, see: // https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. // -// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the IoT -// hub. keyName is the name of the shared access policy. +// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the +// IoT hub. keyName is the name of the shared access policy. func (client IotHubResourceClient) GetKeysForKeyName(ctx context.Context, resourceGroupName string, resourceName string, keyName string) (result SharedAccessSignatureAuthorizationRule, err error) { req, err := client.GetKeysForKeyNamePreparer(ctx, resourceGroupName, resourceName, keyName) if err != nil { @@ -786,8 +786,8 @@ func (client IotHubResourceClient) GetKeysForKeyNameResponder(resp *http.Respons // GetQuotaMetrics get the quota metrics for an IoT hub. // -// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the IoT -// hub. +// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the +// IoT hub. func (client IotHubResourceClient) GetQuotaMetrics(ctx context.Context, resourceGroupName string, resourceName string) (result IotHubQuotaMetricInfoListResultPage, err error) { result.fn = client.getQuotaMetricsNextResults req, err := client.GetQuotaMetricsPreparer(ctx, resourceGroupName, resourceName) @@ -881,8 +881,8 @@ func (client IotHubResourceClient) GetQuotaMetricsComplete(ctx context.Context, // GetStats get the statistics from an IoT hub. // -// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the IoT -// hub. +// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the +// IoT hub. func (client IotHubResourceClient) GetStats(ctx context.Context, resourceGroupName string, resourceName string) (result RegistryStatistics, err error) { req, err := client.GetStatsPreparer(ctx, resourceGroupName, resourceName) if err != nil { @@ -948,8 +948,8 @@ func (client IotHubResourceClient) GetStatsResponder(resp *http.Response) (resul // GetValidSkus get the list of valid SKUs for an IoT hub. // -// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the IoT -// hub. +// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the +// IoT hub. func (client IotHubResourceClient) GetValidSkus(ctx context.Context, resourceGroupName string, resourceName string) (result IotHubSkuDescriptionListResultPage, err error) { result.fn = client.getValidSkusNextResults req, err := client.GetValidSkusPreparer(ctx, resourceGroupName, resourceName) @@ -1045,14 +1045,14 @@ func (client IotHubResourceClient) GetValidSkusComplete(ctx context.Context, res // information, see: // https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. // -// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the IoT -// hub. importDevicesParameters is the parameters that specify the import devices operation. +// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the +// IoT hub. importDevicesParameters is the parameters that specify the import devices operation. func (client IotHubResourceClient) ImportDevices(ctx context.Context, resourceGroupName string, resourceName string, importDevicesParameters ImportDevicesRequest) (result JobResponse, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: importDevicesParameters, Constraints: []validation.Constraint{{Target: "importDevicesParameters.InputBlobContainerURI", Name: validation.Null, Rule: true, Chain: nil}, {Target: "importDevicesParameters.OutputBlobContainerURI", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "devices.IotHubResourceClient", "ImportDevices") + return result, validation.NewError("devices.IotHubResourceClient", "ImportDevices", err.Error()) } req, err := client.ImportDevicesPreparer(ctx, resourceGroupName, resourceName, importDevicesParameters) @@ -1305,8 +1305,8 @@ func (client IotHubResourceClient) ListBySubscriptionComplete(ctx context.Contex // ListEventHubConsumerGroups get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in // an IoT hub. // -// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the IoT -// hub. eventHubEndpointName is the name of the Event Hub-compatible endpoint. +// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the +// IoT hub. eventHubEndpointName is the name of the Event Hub-compatible endpoint. func (client IotHubResourceClient) ListEventHubConsumerGroups(ctx context.Context, resourceGroupName string, resourceName string, eventHubEndpointName string) (result EventHubConsumerGroupsListResultPage, err error) { result.fn = client.listEventHubConsumerGroupsNextResults req, err := client.ListEventHubConsumerGroupsPreparer(ctx, resourceGroupName, resourceName, eventHubEndpointName) @@ -1402,8 +1402,8 @@ func (client IotHubResourceClient) ListEventHubConsumerGroupsComplete(ctx contex // ListJobs get a list of all the jobs in an IoT hub. For more information, see: // https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. // -// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the IoT -// hub. +// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the +// IoT hub. func (client IotHubResourceClient) ListJobs(ctx context.Context, resourceGroupName string, resourceName string) (result JobResponseListResultPage, err error) { result.fn = client.listJobsNextResults req, err := client.ListJobsPreparer(ctx, resourceGroupName, resourceName) @@ -1498,8 +1498,8 @@ func (client IotHubResourceClient) ListJobsComplete(ctx context.Context, resourc // ListKeys get the security metadata for an IoT hub. For more information, see: // https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. // -// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the IoT -// hub. +// resourceGroupName is the name of the resource group that contains the IoT hub. resourceName is the name of the +// IoT hub. func (client IotHubResourceClient) ListKeys(ctx context.Context, resourceGroupName string, resourceName string) (result SharedAccessSignatureAuthorizationRuleListResultPage, err error) { result.fn = client.listKeysNextResults req, err := client.ListKeysPreparer(ctx, resourceGroupName, resourceName) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2017-07-01/devices/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2017-07-01/devices/models.go index d3227b70497c..12be324f1a5b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2017-07-01/devices/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2017-07-01/devices/models.go @@ -18,6 +18,7 @@ package devices // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( + "encoding/json" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/date" @@ -242,8 +243,8 @@ type CertificateProperties struct { Updated *date.TimeRFC1123 `json:"updated,omitempty"` } -// CertificatePropertiesWithNonce the description of an X509 CA Certificate including the challenge nonce issued for -// the Proof-Of-Possession flow. +// CertificatePropertiesWithNonce the description of an X509 CA Certificate including the challenge nonce issued +// for the Proof-Of-Possession flow. type CertificatePropertiesWithNonce struct { // Subject - The certificate's subject name. Subject *string `json:"subject,omitempty"` @@ -306,15 +307,30 @@ type ErrorDetails struct { type EventHubConsumerGroupInfo struct { autorest.Response `json:"-"` // Tags - The tags. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` // ID - The Event Hub-compatible consumer group identifier. ID *string `json:"id,omitempty"` // Name - The Event Hub-compatible consumer group name. Name *string `json:"name,omitempty"` } -// EventHubConsumerGroupsListResult the JSON-serialized array of Event Hub-compatible consumer group names with a next -// link. +// MarshalJSON is the custom marshaler for EventHubConsumerGroupInfo. +func (ehcgi EventHubConsumerGroupInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ehcgi.Tags != nil { + objectMap["tags"] = ehcgi.Tags + } + if ehcgi.ID != nil { + objectMap["id"] = ehcgi.ID + } + if ehcgi.Name != nil { + objectMap["name"] = ehcgi.Name + } + return json.Marshal(objectMap) +} + +// EventHubConsumerGroupsListResult the JSON-serialized array of Event Hub-compatible consumer group names with a +// next link. type EventHubConsumerGroupsListResult struct { autorest.Response `json:"-"` // Value - The array of Event Hub-compatible consumer group names. @@ -438,8 +454,8 @@ type ExportDevicesRequest struct { ExcludeKeys *bool `json:"ExcludeKeys,omitempty"` } -// FallbackRouteProperties the properties of the fallback route. IoT Hub uses these properties when it routes messages -// to the fallback endpoint. +// FallbackRouteProperties the properties of the fallback route. IoT Hub uses these properties when it routes +// messages to the fallback endpoint. type FallbackRouteProperties struct { // Source - The source to which the routing rule is to be applied to. For example, DeviceMessages Source *string `json:"source,omitempty"` @@ -484,6 +500,14 @@ type IotHubCapacity struct { // IotHubDescription the description of the IoT hub. type IotHubDescription struct { autorest.Response `json:"-"` + // Subscriptionid - The subscription identifier. + Subscriptionid *string `json:"subscriptionid,omitempty"` + // Resourcegroup - The name of the resource group that contains the IoT hub. A resource group name uniquely identifies the resource group within the subscription. + Resourcegroup *string `json:"resourcegroup,omitempty"` + // Etag - The Etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal ETag convention. + Etag *string `json:"etag,omitempty"` + Properties *IotHubProperties `json:"properties,omitempty"` + Sku *IotHubSkuInfo `json:"sku,omitempty"` // ID - The resource identifier. ID *string `json:"id,omitempty"` // Name - The resource name. @@ -493,15 +517,43 @@ type IotHubDescription struct { // Location - The resource location. Location *string `json:"location,omitempty"` // Tags - The resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // Subscriptionid - The subscription identifier. - Subscriptionid *string `json:"subscriptionid,omitempty"` - // Resourcegroup - The name of the resource group that contains the IoT hub. A resource group name uniquely identifies the resource group within the subscription. - Resourcegroup *string `json:"resourcegroup,omitempty"` - // Etag - The Etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal ETag convention. - Etag *string `json:"etag,omitempty"` - Properties *IotHubProperties `json:"properties,omitempty"` - Sku *IotHubSkuInfo `json:"sku,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for IotHubDescription. +func (ihd IotHubDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ihd.Subscriptionid != nil { + objectMap["subscriptionid"] = ihd.Subscriptionid + } + if ihd.Resourcegroup != nil { + objectMap["resourcegroup"] = ihd.Resourcegroup + } + if ihd.Etag != nil { + objectMap["etag"] = ihd.Etag + } + if ihd.Properties != nil { + objectMap["properties"] = ihd.Properties + } + if ihd.Sku != nil { + objectMap["sku"] = ihd.Sku + } + if ihd.ID != nil { + objectMap["id"] = ihd.ID + } + if ihd.Name != nil { + objectMap["name"] = ihd.Name + } + if ihd.Type != nil { + objectMap["type"] = ihd.Type + } + if ihd.Location != nil { + objectMap["location"] = ihd.Location + } + if ihd.Tags != nil { + objectMap["tags"] = ihd.Tags + } + return json.Marshal(objectMap) } // IotHubDescriptionListResult the JSON-serialized array of IotHubDescription objects with a next link. @@ -628,12 +680,12 @@ type IotHubProperties struct { // HostName - The name of the host. HostName *string `json:"hostName,omitempty"` // EventHubEndpoints - The Event Hub-compatible endpoint properties. The possible keys to this dictionary are events and operationsMonitoringEvents. Both of these keys have to be present in the dictionary while making create or update calls for the IoT hub. - EventHubEndpoints *map[string]*EventHubProperties `json:"eventHubEndpoints,omitempty"` - Routing *RoutingProperties `json:"routing,omitempty"` + EventHubEndpoints map[string]*EventHubProperties `json:"eventHubEndpoints"` + Routing *RoutingProperties `json:"routing,omitempty"` // StorageEndpoints - The list of Azure Storage endpoints where you can upload files. Currently you can configure only one Azure Storage account and that MUST have its key as $default. Specifying more than one storage account causes an error to be thrown. Not specifying a value for this property when the enableFileUploadNotifications property is set to True, causes an error to be thrown. - StorageEndpoints *map[string]*StorageEndpointProperties `json:"storageEndpoints,omitempty"` + StorageEndpoints map[string]*StorageEndpointProperties `json:"storageEndpoints"` // MessagingEndpoints - The messaging endpoint properties for the file upload notification queue. - MessagingEndpoints *map[string]*MessagingEndpointProperties `json:"messagingEndpoints,omitempty"` + MessagingEndpoints map[string]*MessagingEndpointProperties `json:"messagingEndpoints"` // EnableFileUploadNotifications - If True, file upload notifications are enabled. EnableFileUploadNotifications *bool `json:"enableFileUploadNotifications,omitempty"` CloudToDevice *CloudToDeviceProperties `json:"cloudToDevice,omitempty"` @@ -644,6 +696,49 @@ type IotHubProperties struct { Features Capabilities `json:"features,omitempty"` } +// MarshalJSON is the custom marshaler for IotHubProperties. +func (ihp IotHubProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ihp.AuthorizationPolicies != nil { + objectMap["authorizationPolicies"] = ihp.AuthorizationPolicies + } + if ihp.IPFilterRules != nil { + objectMap["ipFilterRules"] = ihp.IPFilterRules + } + if ihp.ProvisioningState != nil { + objectMap["provisioningState"] = ihp.ProvisioningState + } + if ihp.HostName != nil { + objectMap["hostName"] = ihp.HostName + } + if ihp.EventHubEndpoints != nil { + objectMap["eventHubEndpoints"] = ihp.EventHubEndpoints + } + if ihp.Routing != nil { + objectMap["routing"] = ihp.Routing + } + if ihp.StorageEndpoints != nil { + objectMap["storageEndpoints"] = ihp.StorageEndpoints + } + if ihp.MessagingEndpoints != nil { + objectMap["messagingEndpoints"] = ihp.MessagingEndpoints + } + if ihp.EnableFileUploadNotifications != nil { + objectMap["enableFileUploadNotifications"] = ihp.EnableFileUploadNotifications + } + if ihp.CloudToDevice != nil { + objectMap["cloudToDevice"] = ihp.CloudToDevice + } + if ihp.Comments != nil { + objectMap["comments"] = ihp.Comments + } + if ihp.OperationsMonitoringProperties != nil { + objectMap["operationsMonitoringProperties"] = ihp.OperationsMonitoringProperties + } + objectMap["features"] = ihp.Features + return json.Marshal(objectMap) +} + // IotHubQuotaMetricInfo quota metrics properties. type IotHubQuotaMetricInfo struct { // Name - The name of the quota metric. @@ -769,22 +864,39 @@ func (future IotHubResourceCreateOrUpdateFuture) Result(client IotHubResourceCli var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ihd, autorest.NewError("devices.IotHubResourceCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return ihd, azure.NewAsyncOpIncompleteError("devices.IotHubResourceCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { ihd, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } ihd, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -800,22 +912,39 @@ func (future IotHubResourceDeleteFuture) Result(client IotHubResourceClient) (so var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return so, autorest.NewError("devices.IotHubResourceDeleteFuture", "Result", "asynchronous operation has not completed") + return so, azure.NewAsyncOpIncompleteError("devices.IotHubResourceDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { so, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceDeleteFuture", "Result", resp, "Failure sending request") return } so, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -1210,10 +1339,19 @@ func (page OperationListResultPage) Values() []Operation { } // OperationsMonitoringProperties the operations monitoring properties for the IoT hub. The possible keys to the -// dictionary are Connections, DeviceTelemetry, C2DCommands, DeviceIdentityOperations, FileUploadOperations, Routes, -// D2CTwinOperations, C2DTwinOperations, TwinQueries, JobsOperations, DirectMethods. +// dictionary are Connections, DeviceTelemetry, C2DCommands, DeviceIdentityOperations, FileUploadOperations, +// Routes, D2CTwinOperations, C2DTwinOperations, TwinQueries, JobsOperations, DirectMethods. type OperationsMonitoringProperties struct { - Events *map[string]*OperationMonitoringLevel `json:"events,omitempty"` + Events map[string]*OperationMonitoringLevel `json:"events"` +} + +// MarshalJSON is the custom marshaler for OperationsMonitoringProperties. +func (omp OperationsMonitoringProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if omp.Events != nil { + objectMap["events"] = omp.Events + } + return json.Marshal(objectMap) } // RegistryStatistics identity registry statistics. @@ -1238,7 +1376,28 @@ type Resource struct { // Location - The resource location. Location *string `json:"location,omitempty"` // Tags - The resource tags. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.ID != nil { + objectMap["id"] = r.ID + } + if r.Name != nil { + objectMap["name"] = r.Name + } + if r.Type != nil { + objectMap["type"] = r.Type + } + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) } // RouteProperties the properties of a routing rule that your IoT hub uses to route messages to endpoints. @@ -1255,9 +1414,9 @@ type RouteProperties struct { IsEnabled *bool `json:"isEnabled,omitempty"` } -// RoutingEndpoints the properties related to the custom endpoints to which your IoT hub routes messages based on the -// routing rules. A maximum of 10 custom endpoints are allowed across all endpoint types for paid hubs and only 1 -// custom endpoint is allowed across all endpoint types for free hubs. +// RoutingEndpoints the properties related to the custom endpoints to which your IoT hub routes messages based on +// the routing rules. A maximum of 10 custom endpoints are allowed across all endpoint types for paid hubs and only +// 1 custom endpoint is allowed across all endpoint types for free hubs. type RoutingEndpoints struct { // ServiceBusQueues - The list of Service Bus queue endpoints that IoT hub routes the messages to, based on the routing rules. ServiceBusQueues *[]RoutingServiceBusQueueEndpointProperties `json:"serviceBusQueues,omitempty"` @@ -1340,7 +1499,7 @@ type RoutingStorageContainerProperties struct { // SetObject ... type SetObject struct { autorest.Response `json:"-"` - Value *map[string]interface{} `json:"value,omitempty"` + Value interface{} `json:"value,omitempty"` } // SharedAccessSignatureAuthorizationRule the properties of an IoT hub shared access policy. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2017-07-01/devices/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2017-07-01/devices/version.go index 72b738b0a2c1..d03b1f2e8ac9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2017-07-01/devices/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2017-07-01/devices/version.go @@ -1,5 +1,7 @@ package devices +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package devices // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta services" + return "Azure-SDK-For-Go/" + version.Number + " devices/2017-07-01" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/2016-10-01/keyvault/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/2016-10-01/keyvault/client.go index c906bcb7d394..c8e98e451a97 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/2016-10-01/keyvault/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/2016-10-01/keyvault/client.go @@ -53,7 +53,7 @@ func NewWithoutDefaults() BaseClient { // Azure Key Vault. Individual versions of a key cannot be backed up. BACKUP / RESTORE can be performed within // geographical boundaries only; meaning that a BACKUP from one geographical area cannot be restored to another // geographical area. For example, a backup from the US geographical area cannot be restored in an EU geographical -// area. +// area. This operation requires the key/backup permission. // // vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. keyName is the name of the key. func (client BaseClient) BackupKey(ctx context.Context, vaultBaseURL string, keyName string) (result BackupKeyResult, err error) { @@ -121,10 +121,11 @@ func (client BaseClient) BackupKeyResponder(resp *http.Response) (result BackupK return } -// BackupSecret requests that a backup of the specified secret be downloaded to the client. Authorization: requires the -// secrets/backup permission. +// BackupSecret requests that a backup of the specified secret be downloaded to the client. All versions of the secret +// will be downloaded. This operation requires the secrets/backup permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. secretName is the name of the secret. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. secretName is the name of the +// secret. func (client BaseClient) BackupSecret(ctx context.Context, vaultBaseURL string, secretName string) (result BackupSecretResult, err error) { req, err := client.BackupSecretPreparer(ctx, vaultBaseURL, secretName) if err != nil { @@ -190,7 +191,8 @@ func (client BaseClient) BackupSecretResponder(resp *http.Response) (result Back return } -// CreateCertificate if this is the first version, the certificate resource is created. +// CreateCertificate if this is the first version, the certificate resource is created. This operation requires the +// certificates/create permission. // // vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. certificateName is the name of the // certificate. parameters is the parameters to create a certificate. @@ -205,7 +207,7 @@ func (client BaseClient) CreateCertificate(ctx context.Context, vaultBaseURL str Chain: []validation.Constraint{{Target: "parameters.CertificatePolicy.X509CertificateProperties.ValidityInMonths", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "CreateCertificate") + return result, validation.NewError("keyvault.BaseClient", "CreateCertificate", err.Error()) } req, err := client.CreateCertificatePreparer(ctx, vaultBaseURL, certificateName, parameters) @@ -275,15 +277,15 @@ func (client BaseClient) CreateCertificateResponder(resp *http.Response) (result } // CreateKey the create key operation can be used to create any key type in Azure Key Vault. If the named key already -// exists, Azure Key Vault creates a new version of the key. +// exists, Azure Key Vault creates a new version of the key. It requires the keys/create permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. keyName is the name for the new key. -// The system will generate the version name for the new key. parameters is the parameters to create a key. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. keyName is the name for the new +// key. The system will generate the version name for the new key. parameters is the parameters to create a key. func (client BaseClient) CreateKey(ctx context.Context, vaultBaseURL string, keyName string, parameters KeyCreateParameters) (result KeyBundle, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: keyName, Constraints: []validation.Constraint{{Target: "keyName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z-]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "CreateKey") + return result, validation.NewError("keyvault.BaseClient", "CreateKey", err.Error()) } req, err := client.CreateKeyPreparer(ctx, vaultBaseURL, keyName, parameters) @@ -356,6 +358,7 @@ func (client BaseClient) CreateKeyResponder(resp *http.Response) (result KeyBund // specified algorithm. This operation is the reverse of the ENCRYPT operation; only a single block of data may be // decrypted, the size of this block is dependent on the target key and the algorithm to be used. The DECRYPT operation // applies to asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of the key. +// This operation requires the keys/decrypt permission. // // vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. keyName is the name of the key. // keyVersion is the version of the key. parameters is the parameters for the decryption operation. @@ -363,7 +366,7 @@ func (client BaseClient) Decrypt(ctx context.Context, vaultBaseURL string, keyNa if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Value", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "Decrypt") + return result, validation.NewError("keyvault.BaseClient", "Decrypt", err.Error()) } req, err := client.DecryptPreparer(ctx, vaultBaseURL, keyName, keyVersion, parameters) @@ -434,7 +437,8 @@ func (client BaseClient) DecryptResponder(resp *http.Response) (result KeyOperat } // DeleteCertificate deletes all versions of a certificate object along with its associated policy. Delete certificate -// cannot be used to remove individual versions of a certificate object. +// cannot be used to remove individual versions of a certificate object. This operation requires the +// certificates/delete permission. // // vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. certificateName is the name of the // certificate. @@ -503,7 +507,7 @@ func (client BaseClient) DeleteCertificateResponder(resp *http.Response) (result return } -// DeleteCertificateContacts deletes the certificate contacts for a specified key vault certificate. Authorization: +// DeleteCertificateContacts deletes the certificate contacts for a specified key vault certificate. This operation // requires the certificates/managecontacts permission. // // vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. @@ -569,9 +573,10 @@ func (client BaseClient) DeleteCertificateContactsResponder(resp *http.Response) } // DeleteCertificateIssuer the DeleteCertificateIssuer operation permanently removes the specified certificate issuer -// from the vault. +// from the vault. This operation requires the certificates/manageissuers/deleteissuers permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. issuerName is the name of the issuer. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. issuerName is the name of the +// issuer. func (client BaseClient) DeleteCertificateIssuer(ctx context.Context, vaultBaseURL string, issuerName string) (result IssuerBundle, err error) { req, err := client.DeleteCertificateIssuerPreparer(ctx, vaultBaseURL, issuerName) if err != nil { @@ -637,8 +642,8 @@ func (client BaseClient) DeleteCertificateIssuerResponder(resp *http.Response) ( return } -// DeleteCertificateOperation deletes the operation for a specified certificate. Authorization: requires the -// certificates/update permission. +// DeleteCertificateOperation deletes the creation operation for a specified certificate that is in the process of +// being created. The certificate is no longer created. This operation requires the certificates/update permission. // // vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. certificateName is the name of the // certificate. @@ -709,7 +714,7 @@ func (client BaseClient) DeleteCertificateOperationResponder(resp *http.Response // DeleteKey the delete key operation cannot be used to remove individual versions of a key. This operation removes the // cryptographic material associated with the key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or -// Encrypt/Decrypt operations. +// Encrypt/Decrypt operations. This operation requires the keys/delete permission. // // vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. keyName is the name of the key to // delete. @@ -778,17 +783,18 @@ func (client BaseClient) DeleteKeyResponder(resp *http.Response) (result Deleted return } -// DeleteSasDefinition deletes a SAS definition from a specified storage account. +// DeleteSasDefinition deletes a SAS definition from a specified storage account. This operation requires the +// storage/deletesas permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. storageAccountName is the name of the -// storage account. sasDefinitionName is the name of the SAS definition. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. storageAccountName is the name of +// the storage account. sasDefinitionName is the name of the SAS definition. func (client BaseClient) DeleteSasDefinition(ctx context.Context, vaultBaseURL string, storageAccountName string, sasDefinitionName string) (result SasDefinitionBundle, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: storageAccountName, Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}, {TargetValue: sasDefinitionName, Constraints: []validation.Constraint{{Target: "sasDefinitionName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "DeleteSasDefinition") + return result, validation.NewError("keyvault.BaseClient", "DeleteSasDefinition", err.Error()) } req, err := client.DeleteSasDefinitionPreparer(ctx, vaultBaseURL, storageAccountName, sasDefinitionName) @@ -857,9 +863,10 @@ func (client BaseClient) DeleteSasDefinitionResponder(resp *http.Response) (resu } // DeleteSecret the DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied to an -// individual version of a secret. +// individual version of a secret. This operation requires the secrets/delete permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. secretName is the name of the secret. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. secretName is the name of the +// secret. func (client BaseClient) DeleteSecret(ctx context.Context, vaultBaseURL string, secretName string) (result DeletedSecretBundle, err error) { req, err := client.DeleteSecretPreparer(ctx, vaultBaseURL, secretName) if err != nil { @@ -925,15 +932,15 @@ func (client BaseClient) DeleteSecretResponder(resp *http.Response) (result Dele return } -// DeleteStorageAccount deletes a storage account. +// DeleteStorageAccount deletes a storage account. This operation requires the storage/delete permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. storageAccountName is the name of the -// storage account. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. storageAccountName is the name of +// the storage account. func (client BaseClient) DeleteStorageAccount(ctx context.Context, vaultBaseURL string, storageAccountName string) (result StorageBundle, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: storageAccountName, Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "DeleteStorageAccount") + return result, validation.NewError("keyvault.BaseClient", "DeleteStorageAccount", err.Error()) } req, err := client.DeleteStorageAccountPreparer(ctx, vaultBaseURL, storageAccountName) @@ -1005,7 +1012,8 @@ func (client BaseClient) DeleteStorageAccountResponder(resp *http.Response) (res // dependent on the target key and the encryption algorithm to be used. The ENCRYPT operation is only strictly // necessary for symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be performed // using public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that -// have a key-reference but do not have access to the public key material. +// have a key-reference but do not have access to the public key material. This operation requires the keys/encypt +// permission. // // vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. keyName is the name of the key. // keyVersion is the version of the key. parameters is the parameters for the encryption operation. @@ -1013,7 +1021,7 @@ func (client BaseClient) Encrypt(ctx context.Context, vaultBaseURL string, keyNa if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Value", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "Encrypt") + return result, validation.NewError("keyvault.BaseClient", "Encrypt", err.Error()) } req, err := client.EncryptPreparer(ctx, vaultBaseURL, keyName, keyVersion, parameters) @@ -1083,7 +1091,7 @@ func (client BaseClient) EncryptResponder(resp *http.Response) (result KeyOperat return } -// GetCertificate gets information about a specified certificate. Authorization: requires the certificates/get +// GetCertificate gets information about a specific certificate. This operation requires the certificates/get // permission. // // vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. certificateName is the name of the @@ -1155,7 +1163,7 @@ func (client BaseClient) GetCertificateResponder(resp *http.Response) (result Ce } // GetCertificateContacts the GetCertificateContacts operation returns the set of certificate contact resources in the -// specified key vault. +// specified key vault. This operation requires the certificates/managecontacts permission. // // vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. func (client BaseClient) GetCertificateContacts(ctx context.Context, vaultBaseURL string) (result Contacts, err error) { @@ -1220,9 +1228,10 @@ func (client BaseClient) GetCertificateContactsResponder(resp *http.Response) (r } // GetCertificateIssuer the GetCertificateIssuer operation returns the specified certificate issuer resources in the -// specified key vault +// specified key vault. This operation requires the certificates/manageissuers/getissuers permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. issuerName is the name of the issuer. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. issuerName is the name of the +// issuer. func (client BaseClient) GetCertificateIssuer(ctx context.Context, vaultBaseURL string, issuerName string) (result IssuerBundle, err error) { req, err := client.GetCertificateIssuerPreparer(ctx, vaultBaseURL, issuerName) if err != nil { @@ -1289,10 +1298,10 @@ func (client BaseClient) GetCertificateIssuerResponder(resp *http.Response) (res } // GetCertificateIssuers the GetCertificateIssuers operation returns the set of certificate issuer resources in the -// specified key vault +// specified key vault. This operation requires the certificates/manageissuers/getissuers permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. maxresults is maximum number of results -// to return in a page. If not specified the service will return up to 25 results. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. maxresults is maximum number of +// results to return in a page. If not specified the service will return up to 25 results. func (client BaseClient) GetCertificateIssuers(ctx context.Context, vaultBaseURL string, maxresults *int32) (result CertificateIssuerListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: maxresults, @@ -1300,7 +1309,7 @@ func (client BaseClient) GetCertificateIssuers(ctx context.Context, vaultBaseURL Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "GetCertificateIssuers") + return result, validation.NewError("keyvault.BaseClient", "GetCertificateIssuers", err.Error()) } result.fn = client.getCertificateIssuersNextResults @@ -1394,8 +1403,8 @@ func (client BaseClient) GetCertificateIssuersComplete(ctx context.Context, vaul return } -// GetCertificateOperation gets the operation associated with a specified certificate. Authorization: requires the -// certificates/get permission. +// GetCertificateOperation gets the creation operation associated with a specified certificate. This operation requires +// the certificates/get permission. // // vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. certificateName is the name of the // certificate. @@ -1465,7 +1474,7 @@ func (client BaseClient) GetCertificateOperationResponder(resp *http.Response) ( } // GetCertificatePolicy the GetCertificatePolicy operation returns the specified certificate policy resources in the -// specified key vault +// specified key vault. This operation requires the certificates/get permission. // // vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. certificateName is the name of the // certificate in a given key vault. @@ -1535,9 +1544,10 @@ func (client BaseClient) GetCertificatePolicyResponder(resp *http.Response) (res } // GetCertificates the GetCertificates operation returns the set of certificates resources in the specified key vault. +// This operation requires the certificates/list permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. maxresults is maximum number of results -// to return in a page. If not specified the service will return up to 25 results. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. maxresults is maximum number of +// results to return in a page. If not specified the service will return up to 25 results. func (client BaseClient) GetCertificates(ctx context.Context, vaultBaseURL string, maxresults *int32) (result CertificateListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: maxresults, @@ -1545,7 +1555,7 @@ func (client BaseClient) GetCertificates(ctx context.Context, vaultBaseURL strin Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "GetCertificates") + return result, validation.NewError("keyvault.BaseClient", "GetCertificates", err.Error()) } result.fn = client.getCertificatesNextResults @@ -1640,11 +1650,11 @@ func (client BaseClient) GetCertificatesComplete(ctx context.Context, vaultBaseU } // GetCertificateVersions the GetCertificateVersions operation returns the versions of a certificate in the specified -// key vault +// key vault. This operation requires the certificates/list permission. // // vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. certificateName is the name of the -// certificate. maxresults is maximum number of results to return in a page. If not specified the service will return -// up to 25 results. +// certificate. maxresults is maximum number of results to return in a page. If not specified the service will +// return up to 25 results. func (client BaseClient) GetCertificateVersions(ctx context.Context, vaultBaseURL string, certificateName string, maxresults *int32) (result CertificateListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: maxresults, @@ -1652,7 +1662,7 @@ func (client BaseClient) GetCertificateVersions(ctx context.Context, vaultBaseUR Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "GetCertificateVersions") + return result, validation.NewError("keyvault.BaseClient", "GetCertificateVersions", err.Error()) } result.fn = client.getCertificateVersionsNextResults @@ -1751,7 +1761,8 @@ func (client BaseClient) GetCertificateVersionsComplete(ctx context.Context, vau } // GetDeletedCertificate the GetDeletedCertificate operation retrieves the deleted certificate information plus its -// attributes, such as retention interval, scheduled permanent deletion and the current deletion recovery level. +// attributes, such as retention interval, scheduled permanent deletion and the current deletion recovery level. This +// operation requires the certificates/get permission. // // vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. certificateName is the name of the // certificate @@ -1821,10 +1832,12 @@ func (client BaseClient) GetDeletedCertificateResponder(resp *http.Response) (re } // GetDeletedCertificates the GetDeletedCertificates operation retrieves the certificates in the current vault which -// are in a deleted state and ready for recovery or purging. +// are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. +// This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete +// enabled vaults. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. maxresults is maximum number of results -// to return in a page. If not specified the service will return up to 25 results. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. maxresults is maximum number of +// results to return in a page. If not specified the service will return up to 25 results. func (client BaseClient) GetDeletedCertificates(ctx context.Context, vaultBaseURL string, maxresults *int32) (result DeletedCertificateListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: maxresults, @@ -1832,7 +1845,7 @@ func (client BaseClient) GetDeletedCertificates(ctx context.Context, vaultBaseUR Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "GetDeletedCertificates") + return result, validation.NewError("keyvault.BaseClient", "GetDeletedCertificates", err.Error()) } result.fn = client.getDeletedCertificatesNextResults @@ -1926,9 +1939,9 @@ func (client BaseClient) GetDeletedCertificatesComplete(ctx context.Context, vau return } -// GetDeletedKey the Get Deleted Key operation is applicable for soft-delete enabled vaults. It requires the keys/list -// permission to be enabled on this vault. While the operation can be invoked on any vault, it will return an error if -// invoked on a non soft-delete enabled vault. +// GetDeletedKey the Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be +// invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires +// the keys/get permission. // // vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. keyName is the name of the key. func (client BaseClient) GetDeletedKey(ctx context.Context, vaultBaseURL string, keyName string) (result DeletedKeyBundle, err error) { @@ -1997,12 +2010,12 @@ func (client BaseClient) GetDeletedKeyResponder(resp *http.Response) (result Del } // GetDeletedKeys retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part -// of a deleted key. The Get Deleted Keys operation is applicable for soft-delete enabled vaults. It requires the -// keys/list permission to be enabled on this vault. While the operation can be invoked on any vault, it will return an -// error if invoked on a non soft-delete enabled vault. +// of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is +// applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an +// error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. maxresults is maximum number of results -// to return in a page. If not specified the service will return up to 25 results. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. maxresults is maximum number of +// results to return in a page. If not specified the service will return up to 25 results. func (client BaseClient) GetDeletedKeys(ctx context.Context, vaultBaseURL string, maxresults *int32) (result DeletedKeyListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: maxresults, @@ -2010,7 +2023,7 @@ func (client BaseClient) GetDeletedKeys(ctx context.Context, vaultBaseURL string Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "GetDeletedKeys") + return result, validation.NewError("keyvault.BaseClient", "GetDeletedKeys", err.Error()) } result.fn = client.getDeletedKeysNextResults @@ -2104,10 +2117,11 @@ func (client BaseClient) GetDeletedKeysComplete(ctx context.Context, vaultBaseUR return } -// GetDeletedSecret retrieves the deleted secret information plus its attributes. Authorization: requires the -// secrets/get permission. +// GetDeletedSecret the Get Deleted Secret operation returns the specified deleted secret along with its attributes. +// This operation requires the secrets/get permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. secretName is the name of the secret +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. secretName is the name of the +// secret. func (client BaseClient) GetDeletedSecret(ctx context.Context, vaultBaseURL string, secretName string) (result DeletedSecretBundle, err error) { req, err := client.GetDeletedSecretPreparer(ctx, vaultBaseURL, secretName) if err != nil { @@ -2173,10 +2187,11 @@ func (client BaseClient) GetDeletedSecretResponder(resp *http.Response) (result return } -// GetDeletedSecrets list deleted secrets in the specified vault. Authorization: requires the secrets/list permission. +// GetDeletedSecrets the Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled +// for soft-delete. This operation requires the secrets/list permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. maxresults is maximum number of results -// to return in a page. If not specified the service will return up to 25 results. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. maxresults is maximum number of +// results to return in a page. If not specified the service will return up to 25 results. func (client BaseClient) GetDeletedSecrets(ctx context.Context, vaultBaseURL string, maxresults *int32) (result DeletedSecretListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: maxresults, @@ -2184,7 +2199,7 @@ func (client BaseClient) GetDeletedSecrets(ctx context.Context, vaultBaseURL str Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "GetDeletedSecrets") + return result, validation.NewError("keyvault.BaseClient", "GetDeletedSecrets", err.Error()) } result.fn = client.getDeletedSecretsNextResults @@ -2279,10 +2294,10 @@ func (client BaseClient) GetDeletedSecretsComplete(ctx context.Context, vaultBas } // GetKey the get key operation is applicable to all key types. If the requested key is symmetric, then no key material -// is released in the response. +// is released in the response. This operation requires the keys/get permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. keyName is the name of the key to get. -// keyVersion is adding the version parameter retrieves a specific version of a key. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. keyName is the name of the key to +// get. keyVersion is adding the version parameter retrieves a specific version of a key. func (client BaseClient) GetKey(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string) (result KeyBundle, err error) { req, err := client.GetKeyPreparer(ctx, vaultBaseURL, keyName, keyVersion) if err != nil { @@ -2350,12 +2365,12 @@ func (client BaseClient) GetKeyResponder(resp *http.Response) (result KeyBundle, } // GetKeys retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a -// stored key. The LIST operation is applicable to all key types, however only the base key identifier,attributes, and -// tags are provided in the response. Individual versions of a key are not listed in the response. Authorization: -// Requires the keys/list permission. +// stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and +// tags are provided in the response. Individual versions of a key are not listed in the response. This operation +// requires the keys/list permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. maxresults is maximum number of results -// to return in a page. If not specified the service will return up to 25 results. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. maxresults is maximum number of +// results to return in a page. If not specified the service will return up to 25 results. func (client BaseClient) GetKeys(ctx context.Context, vaultBaseURL string, maxresults *int32) (result KeyListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: maxresults, @@ -2363,7 +2378,7 @@ func (client BaseClient) GetKeys(ctx context.Context, vaultBaseURL string, maxre Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "GetKeys") + return result, validation.NewError("keyvault.BaseClient", "GetKeys", err.Error()) } result.fn = client.getKeysNextResults @@ -2457,7 +2472,8 @@ func (client BaseClient) GetKeysComplete(ctx context.Context, vaultBaseURL strin return } -// GetKeyVersions the full key identifier, attributes, and tags are provided in the response. +// GetKeyVersions the full key identifier, attributes, and tags are provided in the response. This operation requires +// the keys/list permission. // // vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. keyName is the name of the key. // maxresults is maximum number of results to return in a page. If not specified the service will return up to 25 @@ -2469,7 +2485,7 @@ func (client BaseClient) GetKeyVersions(ctx context.Context, vaultBaseURL string Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "GetKeyVersions") + return result, validation.NewError("keyvault.BaseClient", "GetKeyVersions", err.Error()) } result.fn = client.getKeyVersionsNextResults @@ -2567,17 +2583,18 @@ func (client BaseClient) GetKeyVersionsComplete(ctx context.Context, vaultBaseUR return } -// GetSasDefinition gets information about a SAS definition for the specified storage account. +// GetSasDefinition gets information about a SAS definition for the specified storage account. This operation requires +// the storage/getsas permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. storageAccountName is the name of the -// storage account. sasDefinitionName is the name of the SAS definition. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. storageAccountName is the name of +// the storage account. sasDefinitionName is the name of the SAS definition. func (client BaseClient) GetSasDefinition(ctx context.Context, vaultBaseURL string, storageAccountName string, sasDefinitionName string) (result SasDefinitionBundle, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: storageAccountName, Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}, {TargetValue: sasDefinitionName, Constraints: []validation.Constraint{{Target: "sasDefinitionName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "GetSasDefinition") + return result, validation.NewError("keyvault.BaseClient", "GetSasDefinition", err.Error()) } req, err := client.GetSasDefinitionPreparer(ctx, vaultBaseURL, storageAccountName, sasDefinitionName) @@ -2645,11 +2662,12 @@ func (client BaseClient) GetSasDefinitionResponder(resp *http.Response) (result return } -// GetSasDefinitions list storage SAS definitions for the given storage account. +// GetSasDefinitions list storage SAS definitions for the given storage account. This operation requires the +// storage/listsas permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. storageAccountName is the name of the -// storage account. maxresults is maximum number of results to return in a page. If not specified the service will -// return up to 25 results. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. storageAccountName is the name of +// the storage account. maxresults is maximum number of results to return in a page. If not specified the service +// will return up to 25 results. func (client BaseClient) GetSasDefinitions(ctx context.Context, vaultBaseURL string, storageAccountName string, maxresults *int32) (result SasDefinitionListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: storageAccountName, @@ -2659,7 +2677,7 @@ func (client BaseClient) GetSasDefinitions(ctx context.Context, vaultBaseURL str Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "GetSasDefinitions") + return result, validation.NewError("keyvault.BaseClient", "GetSasDefinitions", err.Error()) } result.fn = client.getSasDefinitionsNextResults @@ -2757,10 +2775,11 @@ func (client BaseClient) GetSasDefinitionsComplete(ctx context.Context, vaultBas return } -// GetSecret the GET operation is applicable to any secret stored in Azure Key Vault. +// GetSecret the GET operation is applicable to any secret stored in Azure Key Vault. This operation requires the +// secrets/get permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. secretName is the name of the secret. -// secretVersion is the version of the secret. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. secretName is the name of the +// secret. secretVersion is the version of the secret. func (client BaseClient) GetSecret(ctx context.Context, vaultBaseURL string, secretName string, secretVersion string) (result SecretBundle, err error) { req, err := client.GetSecretPreparer(ctx, vaultBaseURL, secretName, secretVersion) if err != nil { @@ -2827,11 +2846,12 @@ func (client BaseClient) GetSecretResponder(resp *http.Response) (result SecretB return } -// GetSecrets the LIST operation is applicable to the entire vault, however only the base secret identifier and -// attributes are provided in the response. Individual secret versions are not listed in the response. +// GetSecrets the Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and +// its attributes are provided in the response. Individual secret versions are not listed in the response. This +// operation requires the secrets/list permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. maxresults is maximum number of results -// to return in a page. If not specified the service will return up to 25 results. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. maxresults is maximum number of +// results to return in a page. If not specified, the service will return up to 25 results. func (client BaseClient) GetSecrets(ctx context.Context, vaultBaseURL string, maxresults *int32) (result SecretListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: maxresults, @@ -2839,7 +2859,7 @@ func (client BaseClient) GetSecrets(ctx context.Context, vaultBaseURL string, ma Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "GetSecrets") + return result, validation.NewError("keyvault.BaseClient", "GetSecrets", err.Error()) } result.fn = client.getSecretsNextResults @@ -2933,13 +2953,12 @@ func (client BaseClient) GetSecretsComplete(ctx context.Context, vaultBaseURL st return } -// GetSecretVersions the LIST VERSIONS operation can be applied to all versions having the same secret name in the same -// key vault. The full secret identifier and attributes are provided in the response. No values are returned for the -// secrets and only current versions of a secret are listed. +// GetSecretVersions the full secret identifier and attributes are provided in the response. No values are returned for +// the secrets. This operations requires the secrets/list permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. secretName is the name of the secret. -// maxresults is maximum number of results to return in a page. If not specified the service will return up to 25 -// results. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. secretName is the name of the +// secret. maxresults is maximum number of results to return in a page. If not specified, the service will return +// up to 25 results. func (client BaseClient) GetSecretVersions(ctx context.Context, vaultBaseURL string, secretName string, maxresults *int32) (result SecretListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: maxresults, @@ -2947,7 +2966,7 @@ func (client BaseClient) GetSecretVersions(ctx context.Context, vaultBaseURL str Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "GetSecretVersions") + return result, validation.NewError("keyvault.BaseClient", "GetSecretVersions", err.Error()) } result.fn = client.getSecretVersionsNextResults @@ -3045,15 +3064,16 @@ func (client BaseClient) GetSecretVersionsComplete(ctx context.Context, vaultBas return } -// GetStorageAccount gets information about a specified storage account. +// GetStorageAccount gets information about a specified storage account. This operation requires the storage/get +// permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. storageAccountName is the name of the -// storage account. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. storageAccountName is the name of +// the storage account. func (client BaseClient) GetStorageAccount(ctx context.Context, vaultBaseURL string, storageAccountName string) (result StorageBundle, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: storageAccountName, Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "GetStorageAccount") + return result, validation.NewError("keyvault.BaseClient", "GetStorageAccount", err.Error()) } req, err := client.GetStorageAccountPreparer(ctx, vaultBaseURL, storageAccountName) @@ -3120,10 +3140,11 @@ func (client BaseClient) GetStorageAccountResponder(resp *http.Response) (result return } -// GetStorageAccounts list storage accounts managed by specified key vault +// GetStorageAccounts list storage accounts managed by the specified key vault. This operation requires the +// storage/list permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. maxresults is maximum number of results -// to return in a page. If not specified the service will return up to 25 results. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. maxresults is maximum number of +// results to return in a page. If not specified the service will return up to 25 results. func (client BaseClient) GetStorageAccounts(ctx context.Context, vaultBaseURL string, maxresults *int32) (result StorageListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: maxresults, @@ -3131,7 +3152,7 @@ func (client BaseClient) GetStorageAccounts(ctx context.Context, vaultBaseURL st Chain: []validation.Constraint{{Target: "maxresults", Name: validation.InclusiveMaximum, Rule: 25, Chain: nil}, {Target: "maxresults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "GetStorageAccounts") + return result, validation.NewError("keyvault.BaseClient", "GetStorageAccounts", err.Error()) } result.fn = client.getStorageAccountsNextResults @@ -3227,7 +3248,7 @@ func (client BaseClient) GetStorageAccountsComplete(ctx context.Context, vaultBa // ImportCertificate imports an existing valid certificate, containing a private key, into Azure Key Vault. The // certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM format the PEM file must -// contain the key as well as x509 certificates. +// contain the key as well as x509 certificates. This operation requires the certificates/import permission. // // vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. certificateName is the name of the // certificate. parameters is the parameters to import the certificate. @@ -3243,7 +3264,7 @@ func (client BaseClient) ImportCertificate(ctx context.Context, vaultBaseURL str Chain: []validation.Constraint{{Target: "parameters.CertificatePolicy.X509CertificateProperties.ValidityInMonths", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "ImportCertificate") + return result, validation.NewError("keyvault.BaseClient", "ImportCertificate", err.Error()) } req, err := client.ImportCertificatePreparer(ctx, vaultBaseURL, certificateName, parameters) @@ -3313,17 +3334,18 @@ func (client BaseClient) ImportCertificateResponder(resp *http.Response) (result } // ImportKey the import key operation may be used to import any key type into an Azure Key Vault. If the named key -// already exists, Azure Key Vault creates a new version of the key. +// already exists, Azure Key Vault creates a new version of the key. This operation requires the keys/import +// permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. keyName is name for the imported key. -// parameters is the parameters to import a key. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. keyName is name for the imported +// key. parameters is the parameters to import a key. func (client BaseClient) ImportKey(ctx context.Context, vaultBaseURL string, keyName string, parameters KeyImportParameters) (result KeyBundle, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: keyName, Constraints: []validation.Constraint{{Target: "keyName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z-]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Key", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "ImportKey") + return result, validation.NewError("keyvault.BaseClient", "ImportKey", err.Error()) } req, err := client.ImportKeyPreparer(ctx, vaultBaseURL, keyName, parameters) @@ -3393,7 +3415,7 @@ func (client BaseClient) ImportKeyResponder(resp *http.Response) (result KeyBund } // MergeCertificate the MergeCertificate operation performs the merging of a certificate or certificate chain with a -// key pair currently available in the service. Authorization: requires the certificates/update permission. +// key pair currently available in the service. This operation requires the certificates/create permission. // // vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. certificateName is the name of the // certificate. parameters is the parameters to merge certificate. @@ -3401,7 +3423,7 @@ func (client BaseClient) MergeCertificate(ctx context.Context, vaultBaseURL stri if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.X509Certificates", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "MergeCertificate") + return result, validation.NewError("keyvault.BaseClient", "MergeCertificate", err.Error()) } req, err := client.MergeCertificatePreparer(ctx, vaultBaseURL, certificateName, parameters) @@ -3472,7 +3494,7 @@ func (client BaseClient) MergeCertificateResponder(resp *http.Response) (result // PurgeDeletedCertificate the PurgeDeletedCertificate operation performs an irreversible deletion of the specified // certificate, without possibility for recovery. The operation is not available if the recovery level does not specify -// 'Purgeable'. Requires the explicit granting of the 'purge' permission. +// 'Purgeable'. This operation requires the certificate/purge permission. // // vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. certificateName is the name of the // certificate @@ -3540,9 +3562,9 @@ func (client BaseClient) PurgeDeletedCertificateResponder(resp *http.Response) ( return } -// PurgeDeletedKey the Purge Deleted Key operation is applicable for soft-delete enabled vaults. It requires the -// keys/purge permission to be enabled on this vault. While the operation can be invoked on any vault, it will return -// an error if invoked on a non soft-delete enabled vault. +// PurgeDeletedKey the Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the operation +// can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation +// requires the keys/purge permission. // // vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. keyName is the name of the key func (client BaseClient) PurgeDeletedKey(ctx context.Context, vaultBaseURL string, keyName string) (result autorest.Response, err error) { @@ -3609,10 +3631,12 @@ func (client BaseClient) PurgeDeletedKeyResponder(resp *http.Response) (result a return } -// PurgeDeletedSecret permanently deletes the specified secret. aka purges the secret. Authorization: requires the +// PurgeDeletedSecret the purge deleted secret operation removes the secret permanently, without the possibility of +// recovery. This operation can only be enabled on a soft-delete enabled vault. This operation requires the // secrets/purge permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. secretName is the name of the secret +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. secretName is the name of the +// secret. func (client BaseClient) PurgeDeletedSecret(ctx context.Context, vaultBaseURL string, secretName string) (result autorest.Response, err error) { req, err := client.PurgeDeletedSecretPreparer(ctx, vaultBaseURL, secretName) if err != nil { @@ -3679,7 +3703,7 @@ func (client BaseClient) PurgeDeletedSecretResponder(resp *http.Response) (resul // RecoverDeletedCertificate the RecoverDeletedCertificate operation performs the reversal of the Delete operation. The // operation is applicable in vaults enabled for soft-delete, and must be issued during the retention interval -// (available in the deleted certificate's attributes). +// (available in the deleted certificate's attributes). This operation requires the certificates/recover permission. // // vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. certificateName is the name of the // deleted certificate @@ -3749,11 +3773,12 @@ func (client BaseClient) RecoverDeletedCertificateResponder(resp *http.Response) } // RecoverDeletedKey the Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults. It -// recovers the deleted key back to its latest version under /keys. It requires the keys/recover permissions to be -// enabled on this vault. An attempt to recover an non-deleted key will return an error. Consider this the inverse of -// the delete operation on soft-delete enabled vaults. +// recovers the deleted key back to its latest version under /keys. An attempt to recover an non-deleted key will +// return an error. Consider this the inverse of the delete operation on soft-delete enabled vaults. This operation +// requires the keys/recover permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. keyName is the name of the deleted key. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. keyName is the name of the deleted +// key. func (client BaseClient) RecoverDeletedKey(ctx context.Context, vaultBaseURL string, keyName string) (result KeyBundle, err error) { req, err := client.RecoverDeletedKeyPreparer(ctx, vaultBaseURL, keyName) if err != nil { @@ -3819,11 +3844,11 @@ func (client BaseClient) RecoverDeletedKeyResponder(resp *http.Response) (result return } -// RecoverDeletedSecret recovers the deleted secret back to its current version under /secrets. Authorization: requires -// the secrets/recover permission. +// RecoverDeletedSecret recovers the deleted secret in the specified vault. This operation can only be performed on a +// soft-delete enabled vault. This operation requires the secrets/recover permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. secretName is the name of the deleted -// secret +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. secretName is the name of the +// deleted secret. func (client BaseClient) RecoverDeletedSecret(ctx context.Context, vaultBaseURL string, secretName string) (result SecretBundle, err error) { req, err := client.RecoverDeletedSecretPreparer(ctx, vaultBaseURL, secretName) if err != nil { @@ -3889,17 +3914,18 @@ func (client BaseClient) RecoverDeletedSecretResponder(resp *http.Response) (res return } -// RegenerateStorageAccountKey regenerates the specified key value for the given storage account. +// RegenerateStorageAccountKey regenerates the specified key value for the given storage account. This operation +// requires the storage/regeneratekey permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. storageAccountName is the name of the -// storage account. parameters is the parameters to regenerate storage account key. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. storageAccountName is the name of +// the storage account. parameters is the parameters to regenerate storage account key. func (client BaseClient) RegenerateStorageAccountKey(ctx context.Context, vaultBaseURL string, storageAccountName string, parameters StorageAccountRegenerteKeyParameters) (result StorageBundle, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: storageAccountName, Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.KeyName", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "RegenerateStorageAccountKey") + return result, validation.NewError("keyvault.BaseClient", "RegenerateStorageAccountKey", err.Error()) } req, err := client.RegenerateStorageAccountKeyPreparer(ctx, vaultBaseURL, storageAccountName, parameters) @@ -3975,15 +4001,16 @@ func (client BaseClient) RegenerateStorageAccountKeyResponder(resp *http.Respons // rejected. While the key name is retained during restore, the final key identifier will change if the key is restored // to a different vault. Restore will restore all versions and preserve version identifiers. The RESTORE operation is // subject to security constraints: The target Key Vault must be owned by the same Microsoft Azure Subscription as the -// source Key Vault The user must have RESTORE permission in the target Key Vault. +// source Key Vault The user must have RESTORE permission in the target Key Vault. This operation requires the +// keys/restore permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. parameters is the parameters to restore -// the key. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. parameters is the parameters to +// restore the key. func (client BaseClient) RestoreKey(ctx context.Context, vaultBaseURL string, parameters KeyRestoreParameters) (result KeyBundle, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.KeyBundleBackup", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "RestoreKey") + return result, validation.NewError("keyvault.BaseClient", "RestoreKey", err.Error()) } req, err := client.RestoreKeyPreparer(ctx, vaultBaseURL, parameters) @@ -4048,15 +4075,16 @@ func (client BaseClient) RestoreKeyResponder(resp *http.Response) (result KeyBun return } -// RestoreSecret restores a backed up secret to a vault. Authorization: requires the secrets/restore permission. +// RestoreSecret restores a backed up secret, and all its versions, to a vault. This operation requires the +// secrets/restore permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. parameters is the parameters to restore -// the secret. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. parameters is the parameters to +// restore the secret. func (client BaseClient) RestoreSecret(ctx context.Context, vaultBaseURL string, parameters SecretRestoreParameters) (result SecretBundle, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.SecretBundleBackup", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "RestoreSecret") + return result, validation.NewError("keyvault.BaseClient", "RestoreSecret", err.Error()) } req, err := client.RestoreSecretPreparer(ctx, vaultBaseURL, parameters) @@ -4121,11 +4149,11 @@ func (client BaseClient) RestoreSecretResponder(resp *http.Response) (result Sec return } -// SetCertificateContacts sets the certificate contacts for the specified key vault. Authorization: requires the +// SetCertificateContacts sets the certificate contacts for the specified key vault. This operation requires the // certificates/managecontacts permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. contacts is the contacts for the key -// vault certificate. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. contacts is the contacts for the +// key vault certificate. func (client BaseClient) SetCertificateContacts(ctx context.Context, vaultBaseURL string, contacts Contacts) (result Contacts, err error) { req, err := client.SetCertificateContactsPreparer(ctx, vaultBaseURL, contacts) if err != nil { @@ -4189,15 +4217,16 @@ func (client BaseClient) SetCertificateContactsResponder(resp *http.Response) (r return } -// SetCertificateIssuer the SetCertificateIssuer operation adds or updates the specified certificate issuer. +// SetCertificateIssuer the SetCertificateIssuer operation adds or updates the specified certificate issuer. This +// operation requires the certificates/setissuers permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. issuerName is the name of the issuer. -// parameter is certificate issuer set parameter. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. issuerName is the name of the +// issuer. parameter is certificate issuer set parameter. func (client BaseClient) SetCertificateIssuer(ctx context.Context, vaultBaseURL string, issuerName string, parameter CertificateIssuerSetParameters) (result IssuerBundle, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameter, Constraints: []validation.Constraint{{Target: "parameter.Provider", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "SetCertificateIssuer") + return result, validation.NewError("keyvault.BaseClient", "SetCertificateIssuer", err.Error()) } req, err := client.SetCertificateIssuerPreparer(ctx, vaultBaseURL, issuerName, parameter) @@ -4266,11 +4295,12 @@ func (client BaseClient) SetCertificateIssuerResponder(resp *http.Response) (res return } -// SetSasDefinition creates or updates a new SAS definition for the specified storage account. +// SetSasDefinition creates or updates a new SAS definition for the specified storage account. This operation requires +// the storage/setsas permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. storageAccountName is the name of the -// storage account. sasDefinitionName is the name of the SAS definition. parameters is the parameters to create a SAS -// definition. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. storageAccountName is the name of +// the storage account. sasDefinitionName is the name of the SAS definition. parameters is the parameters to create +// a SAS definition. func (client BaseClient) SetSasDefinition(ctx context.Context, vaultBaseURL string, storageAccountName string, sasDefinitionName string, parameters SasDefinitionCreateParameters) (result SasDefinitionBundle, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: storageAccountName, @@ -4279,7 +4309,7 @@ func (client BaseClient) SetSasDefinition(ctx context.Context, vaultBaseURL stri Constraints: []validation.Constraint{{Target: "sasDefinitionName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Parameters", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "SetSasDefinition") + return result, validation.NewError("keyvault.BaseClient", "SetSasDefinition", err.Error()) } req, err := client.SetSasDefinitionPreparer(ctx, vaultBaseURL, storageAccountName, sasDefinitionName, parameters) @@ -4350,17 +4380,17 @@ func (client BaseClient) SetSasDefinitionResponder(resp *http.Response) (result } // SetSecret the SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key -// Vault creates a new version of that secret. +// Vault creates a new version of that secret. This operation requires the secrets/set permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. secretName is the name of the secret. -// parameters is the parameters for setting the secret. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. secretName is the name of the +// secret. parameters is the parameters for setting the secret. func (client BaseClient) SetSecret(ctx context.Context, vaultBaseURL string, secretName string, parameters SecretSetParameters) (result SecretBundle, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: secretName, Constraints: []validation.Constraint{{Target: "secretName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z-]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Value", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "SetSecret") + return result, validation.NewError("keyvault.BaseClient", "SetSecret", err.Error()) } req, err := client.SetSecretPreparer(ctx, vaultBaseURL, secretName, parameters) @@ -4429,10 +4459,10 @@ func (client BaseClient) SetSecretResponder(resp *http.Response) (result SecretB return } -// SetStorageAccount creates or updates a new storage account. +// SetStorageAccount creates or updates a new storage account. This operation requires the storage/set permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. storageAccountName is the name of the -// storage account. parameters is the parameters to create a storage account. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. storageAccountName is the name of +// the storage account. parameters is the parameters to create a storage account. func (client BaseClient) SetStorageAccount(ctx context.Context, vaultBaseURL string, storageAccountName string, parameters StorageAccountCreateParameters) (result StorageBundle, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: storageAccountName, @@ -4441,7 +4471,7 @@ func (client BaseClient) SetStorageAccount(ctx context.Context, vaultBaseURL str Constraints: []validation.Constraint{{Target: "parameters.ResourceID", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.ActiveKeyName", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.AutoRegenerateKey", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "SetStorageAccount") + return result, validation.NewError("keyvault.BaseClient", "SetStorageAccount", err.Error()) } req, err := client.SetStorageAccountPreparer(ctx, vaultBaseURL, storageAccountName, parameters) @@ -4511,7 +4541,7 @@ func (client BaseClient) SetStorageAccountResponder(resp *http.Response) (result } // Sign the SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault since this -// operation uses the private portion of the key. +// operation uses the private portion of the key. This operation requires the keys/sign permission. // // vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. keyName is the name of the key. // keyVersion is the version of the key. parameters is the parameters for the signing operation. @@ -4519,7 +4549,7 @@ func (client BaseClient) Sign(ctx context.Context, vaultBaseURL string, keyName if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Value", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "Sign") + return result, validation.NewError("keyvault.BaseClient", "Sign", err.Error()) } req, err := client.SignPreparer(ctx, vaultBaseURL, keyName, keyVersion, parameters) @@ -4591,7 +4621,8 @@ func (client BaseClient) SignResponder(resp *http.Response) (result KeyOperation // UnwrapKey the UNWRAP operation supports decryption of a symmetric key using the target key encryption key. This // operation is the reverse of the WRAP operation. The UNWRAP operation applies to asymmetric and symmetric keys stored -// in Azure Key Vault since it uses the private portion of the key. +// in Azure Key Vault since it uses the private portion of the key. This operation requires the keys/unwrapKey +// permission. // // vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. keyName is the name of the key. // keyVersion is the version of the key. parameters is the parameters for the key operation. @@ -4599,7 +4630,7 @@ func (client BaseClient) UnwrapKey(ctx context.Context, vaultBaseURL string, key if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Value", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "UnwrapKey") + return result, validation.NewError("keyvault.BaseClient", "UnwrapKey", err.Error()) } req, err := client.UnwrapKeyPreparer(ctx, vaultBaseURL, keyName, keyVersion, parameters) @@ -4669,8 +4700,8 @@ func (client BaseClient) UnwrapKeyResponder(resp *http.Response) (result KeyOper return } -// UpdateCertificate the UpdateCertificate operation applies the specified update on the given certificate; note the -// only elements being updated are the certificate's attributes. +// UpdateCertificate the UpdateCertificate operation applies the specified update on the given certificate; the only +// elements updated are the certificate's attributes. This operation requires the certificates/update permission. // // vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. certificateName is the name of the // certificate in the given key vault. certificateVersion is the version of the certificate. parameters is the @@ -4744,10 +4775,10 @@ func (client BaseClient) UpdateCertificateResponder(resp *http.Response) (result } // UpdateCertificateIssuer the UpdateCertificateIssuer operation performs an update on the specified certificate issuer -// entity. +// entity. This operation requires the certificates/setissuers permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. issuerName is the name of the issuer. -// parameter is certificate issuer update parameter. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. issuerName is the name of the +// issuer. parameter is certificate issuer update parameter. func (client BaseClient) UpdateCertificateIssuer(ctx context.Context, vaultBaseURL string, issuerName string, parameter CertificateIssuerUpdateParameters) (result IssuerBundle, err error) { req, err := client.UpdateCertificateIssuerPreparer(ctx, vaultBaseURL, issuerName, parameter) if err != nil { @@ -4815,8 +4846,8 @@ func (client BaseClient) UpdateCertificateIssuerResponder(resp *http.Response) ( return } -// UpdateCertificateOperation updates a certificate operation. Authorization: requires the certificates/update -// permission. +// UpdateCertificateOperation updates a certificate creation operation that is already in progress. This operation +// requires the certificates/update permission. // // vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. certificateName is the name of the // certificate. certificateOperation is the certificate operation response. @@ -4887,7 +4918,8 @@ func (client BaseClient) UpdateCertificateOperationResponder(resp *http.Response return } -// UpdateCertificatePolicy set specified members in the certificate policy. Leave others as null. +// UpdateCertificatePolicy set specified members in the certificate policy. Leave others as null. This operation +// requires the certificates/update permission. // // vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. certificateName is the name of the // certificate in the given vault. certificatePolicy is the policy for the certificate. @@ -4959,10 +4991,10 @@ func (client BaseClient) UpdateCertificatePolicyResponder(resp *http.Response) ( } // UpdateKey in order to perform this operation, the key must already exist in the Key Vault. Note: The cryptographic -// material of a key itself cannot be changed. +// material of a key itself cannot be changed. This operation requires the keys/update permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. keyName is the name of key to update. -// keyVersion is the version of the key to update. parameters is the parameters of the key to update. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. keyName is the name of key to +// update. keyVersion is the version of the key to update. parameters is the parameters of the key to update. func (client BaseClient) UpdateKey(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyUpdateParameters) (result KeyBundle, err error) { req, err := client.UpdateKeyPreparer(ctx, vaultBaseURL, keyName, keyVersion, parameters) if err != nil { @@ -5031,18 +5063,19 @@ func (client BaseClient) UpdateKeyResponder(resp *http.Response) (result KeyBund return } -// UpdateSasDefinition updates the specified attributes associated with the given SAS definition. +// UpdateSasDefinition updates the specified attributes associated with the given SAS definition. This operation +// requires the storage/setsas permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. storageAccountName is the name of the -// storage account. sasDefinitionName is the name of the SAS definition. parameters is the parameters to update a SAS -// definition. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. storageAccountName is the name of +// the storage account. sasDefinitionName is the name of the SAS definition. parameters is the parameters to update +// a SAS definition. func (client BaseClient) UpdateSasDefinition(ctx context.Context, vaultBaseURL string, storageAccountName string, sasDefinitionName string, parameters SasDefinitionUpdateParameters) (result SasDefinitionBundle, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: storageAccountName, Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}, {TargetValue: sasDefinitionName, Constraints: []validation.Constraint{{Target: "sasDefinitionName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "UpdateSasDefinition") + return result, validation.NewError("keyvault.BaseClient", "UpdateSasDefinition", err.Error()) } req, err := client.UpdateSasDefinitionPreparer(ctx, vaultBaseURL, storageAccountName, sasDefinitionName, parameters) @@ -5113,10 +5146,11 @@ func (client BaseClient) UpdateSasDefinitionResponder(resp *http.Response) (resu } // UpdateSecret the UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not -// specified in the request are left unchanged. The value of a secret itself cannot be changed. +// specified in the request are left unchanged. The value of a secret itself cannot be changed. This operation requires +// the secrets/set permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. secretName is the name of the secret. -// secretVersion is the version of the secret. parameters is the parameters for update secret operation. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. secretName is the name of the +// secret. secretVersion is the version of the secret. parameters is the parameters for update secret operation. func (client BaseClient) UpdateSecret(ctx context.Context, vaultBaseURL string, secretName string, secretVersion string, parameters SecretUpdateParameters) (result SecretBundle, err error) { req, err := client.UpdateSecretPreparer(ctx, vaultBaseURL, secretName, secretVersion, parameters) if err != nil { @@ -5185,15 +5219,16 @@ func (client BaseClient) UpdateSecretResponder(resp *http.Response) (result Secr return } -// UpdateStorageAccount updates the specified attributes associated with the given storage account. +// UpdateStorageAccount updates the specified attributes associated with the given storage account. This operation +// requires the storage/set/update permission. // -// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. storageAccountName is the name of the -// storage account. parameters is the parameters to update a storage account. +// vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. storageAccountName is the name of +// the storage account. parameters is the parameters to update a storage account. func (client BaseClient) UpdateStorageAccount(ctx context.Context, vaultBaseURL string, storageAccountName string, parameters StorageAccountUpdateParameters) (result StorageBundle, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: storageAccountName, Constraints: []validation.Constraint{{Target: "storageAccountName", Name: validation.Pattern, Rule: `^[0-9a-zA-Z]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "UpdateStorageAccount") + return result, validation.NewError("keyvault.BaseClient", "UpdateStorageAccount", err.Error()) } req, err := client.UpdateStorageAccountPreparer(ctx, vaultBaseURL, storageAccountName, parameters) @@ -5265,7 +5300,7 @@ func (client BaseClient) UpdateStorageAccountResponder(resp *http.Response) (res // Verify the VERIFY operation is applicable to symmetric keys stored in Azure Key Vault. VERIFY is not strictly // necessary for asymmetric keys stored in Azure Key Vault since signature verification can be performed using the // public portion of the key but this operation is supported as a convenience for callers that only have a -// key-reference and not the public portion of the key. +// key-reference and not the public portion of the key. This operation requires the keys/verify permission. // // vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. keyName is the name of the key. // keyVersion is the version of the key. parameters is the parameters for verify operations. @@ -5274,7 +5309,7 @@ func (client BaseClient) Verify(ctx context.Context, vaultBaseURL string, keyNam {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Digest", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.Signature", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "Verify") + return result, validation.NewError("keyvault.BaseClient", "Verify", err.Error()) } req, err := client.VerifyPreparer(ctx, vaultBaseURL, keyName, keyVersion, parameters) @@ -5348,7 +5383,7 @@ func (client BaseClient) VerifyResponder(resp *http.Response) (result KeyVerifyR // been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for symmetric keys stored in Azure // Key Vault since protection with an asymmetric key can be performed using the public portion of the key. This // operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have -// access to the public key material. +// access to the public key material. This operation requires the keys/wrapKey permission. // // vaultBaseURL is the vault name, for example https://myvault.vault.azure.net. keyName is the name of the key. // keyVersion is the version of the key. parameters is the parameters for wrap operation. @@ -5356,7 +5391,7 @@ func (client BaseClient) WrapKey(ctx context.Context, vaultBaseURL string, keyNa if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Value", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.BaseClient", "WrapKey") + return result, validation.NewError("keyvault.BaseClient", "WrapKey", err.Error()) } req, err := client.WrapKeyPreparer(ctx, vaultBaseURL, keyName, keyVersion, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/2016-10-01/keyvault/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/2016-10-01/keyvault/models.go index 672f5a859760..56c2a792ed14 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/2016-10-01/keyvault/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/2016-10-01/keyvault/models.go @@ -18,6 +18,7 @@ package keyvault // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( + "encoding/json" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/date" "github.com/Azure/go-autorest/autorest/to" @@ -208,6 +209,8 @@ type BackupSecretResult struct { // CertificateAttributes the certificate management attributes. type CertificateAttributes struct { + // RecoveryLevel - Reflects the deletion recovery level currently in effect for certificates in the current vault. If it contains 'Purgeable', the certificate can be permanently deleted by a privileged user; otherwise, only the system can purge the certificate, at the end of the retention interval. Possible values include: 'Purgeable', 'RecoverablePurgeable', 'Recoverable', 'RecoverableProtectedSubscription' + RecoveryLevel DeletionRecoveryLevel `json:"recoveryLevel,omitempty"` // Enabled - Determines whether the object is enabled. Enabled *bool `json:"enabled,omitempty"` // NotBefore - Not before date in UTC. @@ -218,8 +221,6 @@ type CertificateAttributes struct { Created *date.UnixTime `json:"created,omitempty"` // Updated - Last updated time in UTC. Updated *date.UnixTime `json:"updated,omitempty"` - // RecoveryLevel - Reflects the deletion recovery level currently in effect for certificates in the current vault. If it contains 'Purgeable', the certificate can be permanently deleted by a privileged user; otherwise, only the system can purge the certificate, at the end of the retention interval. Possible values include: 'Purgeable', 'RecoverablePurgeable', 'Recoverable', 'RecoverableProtectedSubscription' - RecoveryLevel DeletionRecoveryLevel `json:"recoveryLevel,omitempty"` } // CertificateBundle a certificate bundle consists of a certificate (X509) plus its attributes. @@ -242,7 +243,40 @@ type CertificateBundle struct { // Attributes - The certificate attributes. Attributes *CertificateAttributes `json:"attributes,omitempty"` // Tags - Application specific metadata in the form of key-value pairs - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for CertificateBundle. +func (cb CertificateBundle) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cb.ID != nil { + objectMap["id"] = cb.ID + } + if cb.Kid != nil { + objectMap["kid"] = cb.Kid + } + if cb.Sid != nil { + objectMap["sid"] = cb.Sid + } + if cb.X509Thumbprint != nil { + objectMap["x5t"] = cb.X509Thumbprint + } + if cb.Policy != nil { + objectMap["policy"] = cb.Policy + } + if cb.Cer != nil { + objectMap["cer"] = cb.Cer + } + if cb.ContentType != nil { + objectMap["contentType"] = cb.ContentType + } + if cb.Attributes != nil { + objectMap["attributes"] = cb.Attributes + } + if cb.Tags != nil { + objectMap["tags"] = cb.Tags + } + return json.Marshal(objectMap) } // CertificateCreateParameters the certificate create parameters. @@ -252,7 +286,22 @@ type CertificateCreateParameters struct { // CertificateAttributes - The attributes of the certificate (optional). CertificateAttributes *CertificateAttributes `json:"attributes,omitempty"` // Tags - Application specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for CertificateCreateParameters. +func (ccp CertificateCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ccp.CertificatePolicy != nil { + objectMap["policy"] = ccp.CertificatePolicy + } + if ccp.CertificateAttributes != nil { + objectMap["attributes"] = ccp.CertificateAttributes + } + if ccp.Tags != nil { + objectMap["tags"] = ccp.Tags + } + return json.Marshal(objectMap) } // CertificateImportParameters the certificate import parameters. @@ -266,7 +315,28 @@ type CertificateImportParameters struct { // CertificateAttributes - The attributes of the certificate (optional). CertificateAttributes *CertificateAttributes `json:"attributes,omitempty"` // Tags - Application specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for CertificateImportParameters. +func (cip CertificateImportParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cip.Base64EncodedCertificate != nil { + objectMap["value"] = cip.Base64EncodedCertificate + } + if cip.Password != nil { + objectMap["pwd"] = cip.Password + } + if cip.CertificatePolicy != nil { + objectMap["policy"] = cip.CertificatePolicy + } + if cip.CertificateAttributes != nil { + objectMap["attributes"] = cip.CertificateAttributes + } + if cip.Tags != nil { + objectMap["tags"] = cip.Tags + } + return json.Marshal(objectMap) } // CertificateIssuerItem the certificate issuer item containing certificate issuer metadata. @@ -410,11 +480,29 @@ type CertificateItem struct { // Attributes - The certificate management attributes. Attributes *CertificateAttributes `json:"attributes,omitempty"` // Tags - Application specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` // X509Thumbprint - Thumbprint of the certificate. X509Thumbprint *string `json:"x5t,omitempty"` } +// MarshalJSON is the custom marshaler for CertificateItem. +func (ci CertificateItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ci.ID != nil { + objectMap["id"] = ci.ID + } + if ci.Attributes != nil { + objectMap["attributes"] = ci.Attributes + } + if ci.Tags != nil { + objectMap["tags"] = ci.Tags + } + if ci.X509Thumbprint != nil { + objectMap["x5t"] = ci.X509Thumbprint + } + return json.Marshal(objectMap) +} + // CertificateListResult the certificate list result. type CertificateListResult struct { autorest.Response `json:"-"` @@ -524,7 +612,22 @@ type CertificateMergeParameters struct { // CertificateAttributes - The attributes of the certificate (optional). CertificateAttributes *CertificateAttributes `json:"attributes,omitempty"` // Tags - Application specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for CertificateMergeParameters. +func (cmp CertificateMergeParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cmp.X509Certificates != nil { + objectMap["x5c"] = cmp.X509Certificates + } + if cmp.CertificateAttributes != nil { + objectMap["attributes"] = cmp.CertificateAttributes + } + if cmp.Tags != nil { + objectMap["tags"] = cmp.Tags + } + return json.Marshal(objectMap) } // CertificateOperation a certificate operation is returned in case of asynchronous requests. @@ -582,7 +685,22 @@ type CertificateUpdateParameters struct { // CertificateAttributes - The attributes of the certificate (optional). CertificateAttributes *CertificateAttributes `json:"attributes,omitempty"` // Tags - Application specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for CertificateUpdateParameters. +func (cup CertificateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cup.CertificatePolicy != nil { + objectMap["policy"] = cup.CertificatePolicy + } + if cup.CertificateAttributes != nil { + objectMap["attributes"] = cup.CertificateAttributes + } + if cup.Tags != nil { + objectMap["tags"] = cup.Tags + } + return json.Marshal(objectMap) } // Contact the contact information for the vault certificates. @@ -604,10 +722,16 @@ type Contacts struct { ContactList *[]Contact `json:"contacts,omitempty"` } -// DeletedCertificateBundle a Deleted Certificate consisting of its previous id, attributes and its tags, as well as -// information on when it will be purged. +// DeletedCertificateBundle a Deleted Certificate consisting of its previous id, attributes and its tags, as well +// as information on when it will be purged. type DeletedCertificateBundle struct { autorest.Response `json:"-"` + // RecoveryID - The url of the recovery object, used to identify and recover the deleted certificate. + RecoveryID *string `json:"recoveryId,omitempty"` + // ScheduledPurgeDate - The time when the certificate is scheduled to be purged, in UTC + ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` + // DeletedDate - The time when the certificate was deleted, in UTC + DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` // ID - The certificate id. ID *string `json:"id,omitempty"` // Kid - The key id. @@ -625,31 +749,94 @@ type DeletedCertificateBundle struct { // Attributes - The certificate attributes. Attributes *CertificateAttributes `json:"attributes,omitempty"` // Tags - Application specific metadata in the form of key-value pairs - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DeletedCertificateBundle. +func (dcb DeletedCertificateBundle) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcb.RecoveryID != nil { + objectMap["recoveryId"] = dcb.RecoveryID + } + if dcb.ScheduledPurgeDate != nil { + objectMap["scheduledPurgeDate"] = dcb.ScheduledPurgeDate + } + if dcb.DeletedDate != nil { + objectMap["deletedDate"] = dcb.DeletedDate + } + if dcb.ID != nil { + objectMap["id"] = dcb.ID + } + if dcb.Kid != nil { + objectMap["kid"] = dcb.Kid + } + if dcb.Sid != nil { + objectMap["sid"] = dcb.Sid + } + if dcb.X509Thumbprint != nil { + objectMap["x5t"] = dcb.X509Thumbprint + } + if dcb.Policy != nil { + objectMap["policy"] = dcb.Policy + } + if dcb.Cer != nil { + objectMap["cer"] = dcb.Cer + } + if dcb.ContentType != nil { + objectMap["contentType"] = dcb.ContentType + } + if dcb.Attributes != nil { + objectMap["attributes"] = dcb.Attributes + } + if dcb.Tags != nil { + objectMap["tags"] = dcb.Tags + } + return json.Marshal(objectMap) +} + +// DeletedCertificateItem the deleted certificate item containing metadata about the deleted certificate. +type DeletedCertificateItem struct { // RecoveryID - The url of the recovery object, used to identify and recover the deleted certificate. RecoveryID *string `json:"recoveryId,omitempty"` // ScheduledPurgeDate - The time when the certificate is scheduled to be purged, in UTC ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` // DeletedDate - The time when the certificate was deleted, in UTC DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` -} - -// DeletedCertificateItem the deleted certificate item containing metadata about the deleted certificate. -type DeletedCertificateItem struct { // ID - Certificate identifier. ID *string `json:"id,omitempty"` // Attributes - The certificate management attributes. Attributes *CertificateAttributes `json:"attributes,omitempty"` // Tags - Application specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` // X509Thumbprint - Thumbprint of the certificate. X509Thumbprint *string `json:"x5t,omitempty"` - // RecoveryID - The url of the recovery object, used to identify and recover the deleted certificate. - RecoveryID *string `json:"recoveryId,omitempty"` - // ScheduledPurgeDate - The time when the certificate is scheduled to be purged, in UTC - ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` - // DeletedDate - The time when the certificate was deleted, in UTC - DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeletedCertificateItem. +func (dci DeletedCertificateItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dci.RecoveryID != nil { + objectMap["recoveryId"] = dci.RecoveryID + } + if dci.ScheduledPurgeDate != nil { + objectMap["scheduledPurgeDate"] = dci.ScheduledPurgeDate + } + if dci.DeletedDate != nil { + objectMap["deletedDate"] = dci.DeletedDate + } + if dci.ID != nil { + objectMap["id"] = dci.ID + } + if dci.Attributes != nil { + objectMap["attributes"] = dci.Attributes + } + if dci.Tags != nil { + objectMap["tags"] = dci.Tags + } + if dci.X509Thumbprint != nil { + objectMap["x5t"] = dci.X509Thumbprint + } + return json.Marshal(objectMap) } // DeletedCertificateListResult a list of certificates that have been deleted in this vault. @@ -757,38 +944,92 @@ func (page DeletedCertificateListResultPage) Values() []DeletedCertificateItem { // DeletedKeyBundle a DeletedKeyBundle consisting of a WebKey plus its Attributes and deletion info type DeletedKeyBundle struct { autorest.Response `json:"-"` + // RecoveryID - The url of the recovery object, used to identify and recover the deleted key. + RecoveryID *string `json:"recoveryId,omitempty"` + // ScheduledPurgeDate - The time when the key is scheduled to be purged, in UTC + ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` + // DeletedDate - The time when the key was deleted, in UTC + DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` // Key - The Json web key. Key *JSONWebKey `json:"key,omitempty"` // Attributes - The key management attributes. Attributes *KeyAttributes `json:"attributes,omitempty"` // Tags - Application specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` // Managed - True if the key's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. Managed *bool `json:"managed,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeletedKeyBundle. +func (dkb DeletedKeyBundle) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dkb.RecoveryID != nil { + objectMap["recoveryId"] = dkb.RecoveryID + } + if dkb.ScheduledPurgeDate != nil { + objectMap["scheduledPurgeDate"] = dkb.ScheduledPurgeDate + } + if dkb.DeletedDate != nil { + objectMap["deletedDate"] = dkb.DeletedDate + } + if dkb.Key != nil { + objectMap["key"] = dkb.Key + } + if dkb.Attributes != nil { + objectMap["attributes"] = dkb.Attributes + } + if dkb.Tags != nil { + objectMap["tags"] = dkb.Tags + } + if dkb.Managed != nil { + objectMap["managed"] = dkb.Managed + } + return json.Marshal(objectMap) +} + +// DeletedKeyItem the deleted key item containing the deleted key metadata and information about deletion. +type DeletedKeyItem struct { // RecoveryID - The url of the recovery object, used to identify and recover the deleted key. RecoveryID *string `json:"recoveryId,omitempty"` // ScheduledPurgeDate - The time when the key is scheduled to be purged, in UTC ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` // DeletedDate - The time when the key was deleted, in UTC DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` -} - -// DeletedKeyItem the deleted key item containing the deleted key metadata and information about deletion. -type DeletedKeyItem struct { // Kid - Key identifier. Kid *string `json:"kid,omitempty"` // Attributes - The key management attributes. Attributes *KeyAttributes `json:"attributes,omitempty"` // Tags - Application specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` // Managed - True if the key's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. Managed *bool `json:"managed,omitempty"` - // RecoveryID - The url of the recovery object, used to identify and recover the deleted key. - RecoveryID *string `json:"recoveryId,omitempty"` - // ScheduledPurgeDate - The time when the key is scheduled to be purged, in UTC - ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` - // DeletedDate - The time when the key was deleted, in UTC - DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeletedKeyItem. +func (dki DeletedKeyItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dki.RecoveryID != nil { + objectMap["recoveryId"] = dki.RecoveryID + } + if dki.ScheduledPurgeDate != nil { + objectMap["scheduledPurgeDate"] = dki.ScheduledPurgeDate + } + if dki.DeletedDate != nil { + objectMap["deletedDate"] = dki.DeletedDate + } + if dki.Kid != nil { + objectMap["kid"] = dki.Kid + } + if dki.Attributes != nil { + objectMap["attributes"] = dki.Attributes + } + if dki.Tags != nil { + objectMap["tags"] = dki.Tags + } + if dki.Managed != nil { + objectMap["managed"] = dki.Managed + } + return json.Marshal(objectMap) } // DeletedKeyListResult a list of keys that have been deleted in this vault. @@ -893,10 +1134,16 @@ func (page DeletedKeyListResultPage) Values() []DeletedKeyItem { return *page.dklr.Value } -// DeletedSecretBundle a Deleted Secret consisting of its previous id, attributes and its tags, as well as information -// on when it will be purged. +// DeletedSecretBundle a Deleted Secret consisting of its previous id, attributes and its tags, as well as +// information on when it will be purged. type DeletedSecretBundle struct { autorest.Response `json:"-"` + // RecoveryID - The url of the recovery object, used to identify and recover the deleted secret. + RecoveryID *string `json:"recoveryId,omitempty"` + // ScheduledPurgeDate - The time when the secret is scheduled to be purged, in UTC + ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` + // DeletedDate - The time when the secret was deleted, in UTC + DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` // Value - The secret value. Value *string `json:"value,omitempty"` // ID - The secret id. @@ -906,37 +1153,97 @@ type DeletedSecretBundle struct { // Attributes - The secret management attributes. Attributes *SecretAttributes `json:"attributes,omitempty"` // Tags - Application specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` // Kid - If this is a secret backing a KV certificate, then this field specifies the corresponding key backing the KV certificate. Kid *string `json:"kid,omitempty"` // Managed - True if the secret's lifetime is managed by key vault. If this is a secret backing a certificate, then managed will be true. Managed *bool `json:"managed,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeletedSecretBundle. +func (dsb DeletedSecretBundle) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dsb.RecoveryID != nil { + objectMap["recoveryId"] = dsb.RecoveryID + } + if dsb.ScheduledPurgeDate != nil { + objectMap["scheduledPurgeDate"] = dsb.ScheduledPurgeDate + } + if dsb.DeletedDate != nil { + objectMap["deletedDate"] = dsb.DeletedDate + } + if dsb.Value != nil { + objectMap["value"] = dsb.Value + } + if dsb.ID != nil { + objectMap["id"] = dsb.ID + } + if dsb.ContentType != nil { + objectMap["contentType"] = dsb.ContentType + } + if dsb.Attributes != nil { + objectMap["attributes"] = dsb.Attributes + } + if dsb.Tags != nil { + objectMap["tags"] = dsb.Tags + } + if dsb.Kid != nil { + objectMap["kid"] = dsb.Kid + } + if dsb.Managed != nil { + objectMap["managed"] = dsb.Managed + } + return json.Marshal(objectMap) +} + +// DeletedSecretItem the deleted secret item containing metadata about the deleted secret. +type DeletedSecretItem struct { // RecoveryID - The url of the recovery object, used to identify and recover the deleted secret. RecoveryID *string `json:"recoveryId,omitempty"` // ScheduledPurgeDate - The time when the secret is scheduled to be purged, in UTC ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` // DeletedDate - The time when the secret was deleted, in UTC DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` -} - -// DeletedSecretItem the deleted secret item containing metadata about the deleted secret. -type DeletedSecretItem struct { // ID - Secret identifier. ID *string `json:"id,omitempty"` // Attributes - The secret management attributes. Attributes *SecretAttributes `json:"attributes,omitempty"` // Tags - Application specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` // ContentType - Type of the secret value such as a password. ContentType *string `json:"contentType,omitempty"` // Managed - True if the secret's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. Managed *bool `json:"managed,omitempty"` - // RecoveryID - The url of the recovery object, used to identify and recover the deleted secret. - RecoveryID *string `json:"recoveryId,omitempty"` - // ScheduledPurgeDate - The time when the secret is scheduled to be purged, in UTC - ScheduledPurgeDate *date.UnixTime `json:"scheduledPurgeDate,omitempty"` - // DeletedDate - The time when the secret was deleted, in UTC - DeletedDate *date.UnixTime `json:"deletedDate,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeletedSecretItem. +func (dsi DeletedSecretItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dsi.RecoveryID != nil { + objectMap["recoveryId"] = dsi.RecoveryID + } + if dsi.ScheduledPurgeDate != nil { + objectMap["scheduledPurgeDate"] = dsi.ScheduledPurgeDate + } + if dsi.DeletedDate != nil { + objectMap["deletedDate"] = dsi.DeletedDate + } + if dsi.ID != nil { + objectMap["id"] = dsi.ID + } + if dsi.Attributes != nil { + objectMap["attributes"] = dsi.Attributes + } + if dsi.Tags != nil { + objectMap["tags"] = dsi.Tags + } + if dsi.ContentType != nil { + objectMap["contentType"] = dsi.ContentType + } + if dsi.Managed != nil { + objectMap["managed"] = dsi.Managed + } + return json.Marshal(objectMap) } // DeletedSecretListResult the deleted secret list result @@ -1133,6 +1440,8 @@ type JSONWebKey struct { // KeyAttributes the attributes of a key managed by the key vault service. type KeyAttributes struct { + // RecoveryLevel - Reflects the deletion recovery level currently in effect for keys in the current vault. If it contains 'Purgeable' the key can be permanently deleted by a privileged user; otherwise, only the system can purge the key, at the end of the retention interval. Possible values include: 'Purgeable', 'RecoverablePurgeable', 'Recoverable', 'RecoverableProtectedSubscription' + RecoveryLevel DeletionRecoveryLevel `json:"recoveryLevel,omitempty"` // Enabled - Determines whether the object is enabled. Enabled *bool `json:"enabled,omitempty"` // NotBefore - Not before date in UTC. @@ -1143,8 +1452,6 @@ type KeyAttributes struct { Created *date.UnixTime `json:"created,omitempty"` // Updated - Last updated time in UTC. Updated *date.UnixTime `json:"updated,omitempty"` - // RecoveryLevel - Reflects the deletion recovery level currently in effect for keys in the current vault. If it contains 'Purgeable' the key can be permanently deleted by a privileged user; otherwise, only the system can purge the key, at the end of the retention interval. Possible values include: 'Purgeable', 'RecoverablePurgeable', 'Recoverable', 'RecoverableProtectedSubscription' - RecoveryLevel DeletionRecoveryLevel `json:"recoveryLevel,omitempty"` } // KeyBundle a KeyBundle consisting of a WebKey plus its attributes. @@ -1155,11 +1462,29 @@ type KeyBundle struct { // Attributes - The key management attributes. Attributes *KeyAttributes `json:"attributes,omitempty"` // Tags - Application specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` // Managed - True if the key's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. Managed *bool `json:"managed,omitempty"` } +// MarshalJSON is the custom marshaler for KeyBundle. +func (kb KeyBundle) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if kb.Key != nil { + objectMap["key"] = kb.Key + } + if kb.Attributes != nil { + objectMap["attributes"] = kb.Attributes + } + if kb.Tags != nil { + objectMap["tags"] = kb.Tags + } + if kb.Managed != nil { + objectMap["managed"] = kb.Managed + } + return json.Marshal(objectMap) +} + // KeyCreateParameters the key create parameters. type KeyCreateParameters struct { // Kty - The type of key to create. For valid values, see JsonWebKeyType. Possible values include: 'EC', 'ECHSM', 'RSA', 'RSAHSM', 'Oct' @@ -1169,11 +1494,31 @@ type KeyCreateParameters struct { KeyOps *[]JSONWebKeyOperation `json:"key_ops,omitempty"` KeyAttributes *KeyAttributes `json:"attributes,omitempty"` // Tags - Application specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` // Curve - Elliptic curve name. For valid values, see JsonWebKeyCurveName. Possible values include: 'P256', 'P384', 'P521', 'SECP256K1' Curve JSONWebKeyCurveName `json:"crv,omitempty"` } +// MarshalJSON is the custom marshaler for KeyCreateParameters. +func (kcp KeyCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["kty"] = kcp.Kty + if kcp.KeySize != nil { + objectMap["key_size"] = kcp.KeySize + } + if kcp.KeyOps != nil { + objectMap["key_ops"] = kcp.KeyOps + } + if kcp.KeyAttributes != nil { + objectMap["attributes"] = kcp.KeyAttributes + } + if kcp.Tags != nil { + objectMap["tags"] = kcp.Tags + } + objectMap["crv"] = kcp.Curve + return json.Marshal(objectMap) +} + // KeyImportParameters the key import parameters. type KeyImportParameters struct { // Hsm - Whether to import as a hardware key (HSM) or software key. @@ -1183,7 +1528,25 @@ type KeyImportParameters struct { // KeyAttributes - The key management attributes. KeyAttributes *KeyAttributes `json:"attributes,omitempty"` // Tags - Application specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for KeyImportParameters. +func (kip KeyImportParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if kip.Hsm != nil { + objectMap["Hsm"] = kip.Hsm + } + if kip.Key != nil { + objectMap["key"] = kip.Key + } + if kip.KeyAttributes != nil { + objectMap["attributes"] = kip.KeyAttributes + } + if kip.Tags != nil { + objectMap["tags"] = kip.Tags + } + return json.Marshal(objectMap) } // KeyItem the key item containing key metadata. @@ -1193,11 +1556,29 @@ type KeyItem struct { // Attributes - The key management attributes. Attributes *KeyAttributes `json:"attributes,omitempty"` // Tags - Application specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` // Managed - True if the key's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. Managed *bool `json:"managed,omitempty"` } +// MarshalJSON is the custom marshaler for KeyItem. +func (ki KeyItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ki.Kid != nil { + objectMap["kid"] = ki.Kid + } + if ki.Attributes != nil { + objectMap["attributes"] = ki.Attributes + } + if ki.Tags != nil { + objectMap["tags"] = ki.Tags + } + if ki.Managed != nil { + objectMap["managed"] = ki.Managed + } + return json.Marshal(objectMap) +} + // KeyListResult the key list result. type KeyListResult struct { autorest.Response `json:"-"` @@ -1346,7 +1727,22 @@ type KeyUpdateParameters struct { KeyOps *[]JSONWebKeyOperation `json:"key_ops,omitempty"` KeyAttributes *KeyAttributes `json:"attributes,omitempty"` // Tags - Application specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for KeyUpdateParameters. +func (kup KeyUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if kup.KeyOps != nil { + objectMap["key_ops"] = kup.KeyOps + } + if kup.KeyAttributes != nil { + objectMap["attributes"] = kup.KeyAttributes + } + if kup.Tags != nil { + objectMap["tags"] = kup.Tags + } + return json.Marshal(objectMap) } // KeyVerifyParameters the key verify parameters. @@ -1406,21 +1802,57 @@ type SasDefinitionBundle struct { // SecretID - Storage account SAS definition secret id. SecretID *string `json:"sid,omitempty"` // Parameters - The SAS definition metadata in the form of key-value pairs. - Parameters *map[string]*string `json:"parameters,omitempty"` + Parameters map[string]*string `json:"parameters"` // Attributes - The SAS definition attributes. Attributes *SasDefinitionAttributes `json:"attributes,omitempty"` // Tags - Application specific metadata in the form of key-value pairs - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for SasDefinitionBundle. +func (sdb SasDefinitionBundle) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sdb.ID != nil { + objectMap["id"] = sdb.ID + } + if sdb.SecretID != nil { + objectMap["sid"] = sdb.SecretID + } + if sdb.Parameters != nil { + objectMap["parameters"] = sdb.Parameters + } + if sdb.Attributes != nil { + objectMap["attributes"] = sdb.Attributes + } + if sdb.Tags != nil { + objectMap["tags"] = sdb.Tags + } + return json.Marshal(objectMap) } // SasDefinitionCreateParameters the SAS definition create parameters. type SasDefinitionCreateParameters struct { // Parameters - Sas definition creation metadata in the form of key-value pairs. - Parameters *map[string]*string `json:"parameters,omitempty"` + Parameters map[string]*string `json:"parameters"` // SasDefinitionAttributes - The attributes of the SAS definition. SasDefinitionAttributes *SasDefinitionAttributes `json:"attributes,omitempty"` // Tags - Application specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for SasDefinitionCreateParameters. +func (sdcp SasDefinitionCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sdcp.Parameters != nil { + objectMap["parameters"] = sdcp.Parameters + } + if sdcp.SasDefinitionAttributes != nil { + objectMap["attributes"] = sdcp.SasDefinitionAttributes + } + if sdcp.Tags != nil { + objectMap["tags"] = sdcp.Tags + } + return json.Marshal(objectMap) } // SasDefinitionItem the SAS definition item containing storage SAS definition metadata. @@ -1432,7 +1864,25 @@ type SasDefinitionItem struct { // Attributes - The SAS definition management attributes. Attributes *SasDefinitionAttributes `json:"attributes,omitempty"` // Tags - Application specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for SasDefinitionItem. +func (sdi SasDefinitionItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sdi.ID != nil { + objectMap["id"] = sdi.ID + } + if sdi.SecretID != nil { + objectMap["sid"] = sdi.SecretID + } + if sdi.Attributes != nil { + objectMap["attributes"] = sdi.Attributes + } + if sdi.Tags != nil { + objectMap["tags"] = sdi.Tags + } + return json.Marshal(objectMap) } // SasDefinitionListResult the storage account SAS definition list result. @@ -1540,15 +1990,32 @@ func (page SasDefinitionListResultPage) Values() []SasDefinitionItem { // SasDefinitionUpdateParameters the SAS definition update parameters. type SasDefinitionUpdateParameters struct { // Parameters - Sas definition update metadata in the form of key-value pairs. - Parameters *map[string]*string `json:"parameters,omitempty"` + Parameters map[string]*string `json:"parameters"` // SasDefinitionAttributes - The attributes of the SAS definition. SasDefinitionAttributes *SasDefinitionAttributes `json:"attributes,omitempty"` // Tags - Application specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for SasDefinitionUpdateParameters. +func (sdup SasDefinitionUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sdup.Parameters != nil { + objectMap["parameters"] = sdup.Parameters + } + if sdup.SasDefinitionAttributes != nil { + objectMap["attributes"] = sdup.SasDefinitionAttributes + } + if sdup.Tags != nil { + objectMap["tags"] = sdup.Tags + } + return json.Marshal(objectMap) } // SecretAttributes the secret management attributes. type SecretAttributes struct { + // RecoveryLevel - Reflects the deletion recovery level currently in effect for secrets in the current vault. If it contains 'Purgeable', the secret can be permanently deleted by a privileged user; otherwise, only the system can purge the secret, at the end of the retention interval. Possible values include: 'Purgeable', 'RecoverablePurgeable', 'Recoverable', 'RecoverableProtectedSubscription' + RecoveryLevel DeletionRecoveryLevel `json:"recoveryLevel,omitempty"` // Enabled - Determines whether the object is enabled. Enabled *bool `json:"enabled,omitempty"` // NotBefore - Not before date in UTC. @@ -1559,8 +2026,6 @@ type SecretAttributes struct { Created *date.UnixTime `json:"created,omitempty"` // Updated - Last updated time in UTC. Updated *date.UnixTime `json:"updated,omitempty"` - // RecoveryLevel - Reflects the deletion recovery level currently in effect for secrets in the current vault. If it contains 'Purgeable', the secret can be permanently deleted by a privileged user; otherwise, only the system can purge the secret, at the end of the retention interval. Possible values include: 'Purgeable', 'RecoverablePurgeable', 'Recoverable', 'RecoverableProtectedSubscription' - RecoveryLevel DeletionRecoveryLevel `json:"recoveryLevel,omitempty"` } // SecretBundle a secret consisting of a value, id and its attributes. @@ -1575,13 +2040,40 @@ type SecretBundle struct { // Attributes - The secret management attributes. Attributes *SecretAttributes `json:"attributes,omitempty"` // Tags - Application specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` // Kid - If this is a secret backing a KV certificate, then this field specifies the corresponding key backing the KV certificate. Kid *string `json:"kid,omitempty"` // Managed - True if the secret's lifetime is managed by key vault. If this is a secret backing a certificate, then managed will be true. Managed *bool `json:"managed,omitempty"` } +// MarshalJSON is the custom marshaler for SecretBundle. +func (sb SecretBundle) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sb.Value != nil { + objectMap["value"] = sb.Value + } + if sb.ID != nil { + objectMap["id"] = sb.ID + } + if sb.ContentType != nil { + objectMap["contentType"] = sb.ContentType + } + if sb.Attributes != nil { + objectMap["attributes"] = sb.Attributes + } + if sb.Tags != nil { + objectMap["tags"] = sb.Tags + } + if sb.Kid != nil { + objectMap["kid"] = sb.Kid + } + if sb.Managed != nil { + objectMap["managed"] = sb.Managed + } + return json.Marshal(objectMap) +} + // SecretItem the secret item containing secret metadata. type SecretItem struct { // ID - Secret identifier. @@ -1589,13 +2081,34 @@ type SecretItem struct { // Attributes - The secret management attributes. Attributes *SecretAttributes `json:"attributes,omitempty"` // Tags - Application specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` // ContentType - Type of the secret value such as a password. ContentType *string `json:"contentType,omitempty"` // Managed - True if the secret's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. Managed *bool `json:"managed,omitempty"` } +// MarshalJSON is the custom marshaler for SecretItem. +func (si SecretItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if si.ID != nil { + objectMap["id"] = si.ID + } + if si.Attributes != nil { + objectMap["attributes"] = si.Attributes + } + if si.Tags != nil { + objectMap["tags"] = si.Tags + } + if si.ContentType != nil { + objectMap["contentType"] = si.ContentType + } + if si.Managed != nil { + objectMap["managed"] = si.Managed + } + return json.Marshal(objectMap) +} + // SecretListResult the secret list result. type SecretListResult struct { autorest.Response `json:"-"` @@ -1715,13 +2228,31 @@ type SecretSetParameters struct { // Value - The value of the secret. Value *string `json:"value,omitempty"` // Tags - Application specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` // ContentType - Type of the secret value such as a password. ContentType *string `json:"contentType,omitempty"` // SecretAttributes - The secret management attributes. SecretAttributes *SecretAttributes `json:"attributes,omitempty"` } +// MarshalJSON is the custom marshaler for SecretSetParameters. +func (ssp SecretSetParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssp.Value != nil { + objectMap["value"] = ssp.Value + } + if ssp.Tags != nil { + objectMap["tags"] = ssp.Tags + } + if ssp.ContentType != nil { + objectMap["contentType"] = ssp.ContentType + } + if ssp.SecretAttributes != nil { + objectMap["attributes"] = ssp.SecretAttributes + } + return json.Marshal(objectMap) +} + // SecretUpdateParameters the secret update parameters. type SecretUpdateParameters struct { // ContentType - Type of the secret value such as a password. @@ -1729,7 +2260,22 @@ type SecretUpdateParameters struct { // SecretAttributes - The secret management attributes. SecretAttributes *SecretAttributes `json:"attributes,omitempty"` // Tags - Application specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for SecretUpdateParameters. +func (sup SecretUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sup.ContentType != nil { + objectMap["contentType"] = sup.ContentType + } + if sup.SecretAttributes != nil { + objectMap["attributes"] = sup.SecretAttributes + } + if sup.Tags != nil { + objectMap["tags"] = sup.Tags + } + return json.Marshal(objectMap) } // StorageAccountAttributes the storage account management attributes. @@ -1755,7 +2301,31 @@ type StorageAccountCreateParameters struct { // StorageAccountAttributes - The attributes of the storage account. StorageAccountAttributes *StorageAccountAttributes `json:"attributes,omitempty"` // Tags - Application specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for StorageAccountCreateParameters. +func (sacp StorageAccountCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sacp.ResourceID != nil { + objectMap["resourceId"] = sacp.ResourceID + } + if sacp.ActiveKeyName != nil { + objectMap["activeKeyName"] = sacp.ActiveKeyName + } + if sacp.AutoRegenerateKey != nil { + objectMap["autoRegenerateKey"] = sacp.AutoRegenerateKey + } + if sacp.RegenerationPeriod != nil { + objectMap["regenerationPeriod"] = sacp.RegenerationPeriod + } + if sacp.StorageAccountAttributes != nil { + objectMap["attributes"] = sacp.StorageAccountAttributes + } + if sacp.Tags != nil { + objectMap["tags"] = sacp.Tags + } + return json.Marshal(objectMap) } // StorageAccountItem the storage account item containing storage account metadata. @@ -1767,7 +2337,25 @@ type StorageAccountItem struct { // Attributes - The storage account management attributes. Attributes *StorageAccountAttributes `json:"attributes,omitempty"` // Tags - Application specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for StorageAccountItem. +func (sai StorageAccountItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sai.ID != nil { + objectMap["id"] = sai.ID + } + if sai.ResourceID != nil { + objectMap["resourceId"] = sai.ResourceID + } + if sai.Attributes != nil { + objectMap["attributes"] = sai.Attributes + } + if sai.Tags != nil { + objectMap["tags"] = sai.Tags + } + return json.Marshal(objectMap) } // StorageAccountRegenerteKeyParameters the storage account key regenerate parameters. @@ -1787,7 +2375,28 @@ type StorageAccountUpdateParameters struct { // StorageAccountAttributes - The attributes of the storage account. StorageAccountAttributes *StorageAccountAttributes `json:"attributes,omitempty"` // Tags - Application specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for StorageAccountUpdateParameters. +func (saup StorageAccountUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if saup.ActiveKeyName != nil { + objectMap["activeKeyName"] = saup.ActiveKeyName + } + if saup.AutoRegenerateKey != nil { + objectMap["autoRegenerateKey"] = saup.AutoRegenerateKey + } + if saup.RegenerationPeriod != nil { + objectMap["regenerationPeriod"] = saup.RegenerationPeriod + } + if saup.StorageAccountAttributes != nil { + objectMap["attributes"] = saup.StorageAccountAttributes + } + if saup.Tags != nil { + objectMap["tags"] = saup.Tags + } + return json.Marshal(objectMap) } // StorageBundle a Storage account bundle consists of key vault storage account details plus its attributes. @@ -1806,7 +2415,34 @@ type StorageBundle struct { // Attributes - The storage account attributes. Attributes *StorageAccountAttributes `json:"attributes,omitempty"` // Tags - Application specific metadata in the form of key-value pairs - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for StorageBundle. +func (sb StorageBundle) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sb.ID != nil { + objectMap["id"] = sb.ID + } + if sb.ResourceID != nil { + objectMap["resourceId"] = sb.ResourceID + } + if sb.ActiveKeyName != nil { + objectMap["activeKeyName"] = sb.ActiveKeyName + } + if sb.AutoRegenerateKey != nil { + objectMap["autoRegenerateKey"] = sb.AutoRegenerateKey + } + if sb.RegenerationPeriod != nil { + objectMap["regenerationPeriod"] = sb.RegenerationPeriod + } + if sb.Attributes != nil { + objectMap["attributes"] = sb.Attributes + } + if sb.Tags != nil { + objectMap["tags"] = sb.Tags + } + return json.Marshal(objectMap) } // StorageListResult the storage accounts list result. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/2016-10-01/keyvault/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/2016-10-01/keyvault/version.go index 9607ea4b2981..fb6a25c73006 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/2016-10-01/keyvault/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/2016-10-01/keyvault/version.go @@ -1,5 +1,7 @@ package keyvault +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package keyvault // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta services" + return "Azure-SDK-For-Go/" + version.Number + " keyvault/2016-10-01" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2016-10-01/keyvault/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2016-10-01/keyvault/models.go index 93190dce5dee..0024be5b746b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2016-10-01/keyvault/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2016-10-01/keyvault/models.go @@ -18,6 +18,7 @@ package keyvault // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( + "encoding/json" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/date" @@ -26,6 +27,18 @@ import ( "net/http" ) +// AccessPolicyUpdateKind enumerates the values for access policy update kind. +type AccessPolicyUpdateKind string + +const ( + // Add ... + Add AccessPolicyUpdateKind = "add" + // Remove ... + Remove AccessPolicyUpdateKind = "remove" + // Replace ... + Replace AccessPolicyUpdateKind = "replace" +) + // CertificatePermissions enumerates the values for certificate permissions. type CertificatePermissions string @@ -108,6 +121,16 @@ const ( KeyPermissionsWrapKey KeyPermissions = "wrapKey" ) +// Reason enumerates the values for reason. +type Reason string + +const ( + // AccountNameInvalid ... + AccountNameInvalid Reason = "AccountNameInvalid" + // AlreadyExists ... + AlreadyExists Reason = "AlreadyExists" +) + // SecretPermissions enumerates the values for secret permissions. type SecretPermissions string @@ -144,6 +167,8 @@ const ( type StoragePermissions string const ( + // StoragePermissionsBackup ... + StoragePermissionsBackup StoragePermissions = "backup" // StoragePermissionsDelete ... StoragePermissionsDelete StoragePermissions = "delete" // StoragePermissionsDeletesas ... @@ -156,8 +181,14 @@ const ( StoragePermissionsList StoragePermissions = "list" // StoragePermissionsListsas ... StoragePermissionsListsas StoragePermissions = "listsas" + // StoragePermissionsPurge ... + StoragePermissionsPurge StoragePermissions = "purge" + // StoragePermissionsRecover ... + StoragePermissionsRecover StoragePermissions = "recover" // StoragePermissionsRegeneratekey ... StoragePermissionsRegeneratekey StoragePermissions = "regeneratekey" + // StoragePermissionsRestore ... + StoragePermissionsRestore StoragePermissions = "restore" // StoragePermissionsSet ... StoragePermissionsSet StoragePermissions = "set" // StoragePermissionsSetsas ... @@ -179,6 +210,17 @@ type AccessPolicyEntry struct { Permissions *Permissions `json:"permissions,omitempty"` } +// CheckNameAvailabilityResult the CheckNameAvailability operation response. +type CheckNameAvailabilityResult struct { + autorest.Response `json:"-"` + // NameAvailable - A boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or is invalid and cannot be used. + NameAvailable *bool `json:"nameAvailable,omitempty"` + // Reason - The reason that a vault name could not be used. The Reason element is only returned if NameAvailable is false. Possible values include: 'AccountNameInvalid', 'AlreadyExists' + Reason Reason `json:"reason,omitempty"` + // Message - An error message explaining the Reason value in more detail. + Message *string `json:"message,omitempty"` +} + // DeletedVault deleted vault information with extended details. type DeletedVault struct { autorest.Response `json:"-"` @@ -305,7 +347,222 @@ type DeletedVaultProperties struct { // ScheduledPurgeDate - The scheduled purged date. ScheduledPurgeDate *date.Time `json:"scheduledPurgeDate,omitempty"` // Tags - Tags of the original vault. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DeletedVaultProperties. +func (dvp DeletedVaultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dvp.VaultID != nil { + objectMap["vaultId"] = dvp.VaultID + } + if dvp.Location != nil { + objectMap["location"] = dvp.Location + } + if dvp.DeletionDate != nil { + objectMap["deletionDate"] = dvp.DeletionDate + } + if dvp.ScheduledPurgeDate != nil { + objectMap["scheduledPurgeDate"] = dvp.ScheduledPurgeDate + } + if dvp.Tags != nil { + objectMap["tags"] = dvp.Tags + } + return json.Marshal(objectMap) +} + +// LogSpecification log specification of operation. +type LogSpecification struct { + // Name - Name of log specification. + Name *string `json:"name,omitempty"` + // DisplayName - Display name of log specification. + DisplayName *string `json:"displayName,omitempty"` + // BlobDuration - Blob duration of specification. + BlobDuration *string `json:"blobDuration,omitempty"` +} + +// Operation key Vault REST API operation definition. +type Operation struct { + // Name - Operation name: {provider}/{resource}/{operation} + Name *string `json:"name,omitempty"` + // Display - Display metadata associated with the operation. + Display *OperationDisplay `json:"display,omitempty"` + // Origin - The origin of operations. + Origin *string `json:"origin,omitempty"` + // OperationProperties - Properties of operation, include metric specifications. + *OperationProperties `json:"properties,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for Operation struct. +func (o *Operation) 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 + } + o.Name = &name + } + case "display": + if v != nil { + var display OperationDisplay + err = json.Unmarshal(*v, &display) + if err != nil { + return err + } + o.Display = &display + } + case "origin": + if v != nil { + var origin string + err = json.Unmarshal(*v, &origin) + if err != nil { + return err + } + o.Origin = &origin + } + case "properties": + if v != nil { + var operationProperties OperationProperties + err = json.Unmarshal(*v, &operationProperties) + if err != nil { + return err + } + o.OperationProperties = &operationProperties + } + } + } + + return nil +} + +// OperationDisplay display metadata associated with the operation. +type OperationDisplay struct { + // Provider - Service provider: Microsoft Key Vault. + Provider *string `json:"provider,omitempty"` + // Resource - Resource on which the operation is performed etc. + Resource *string `json:"resource,omitempty"` + // Operation - Type of operation: get, read, delete, etc. + Operation *string `json:"operation,omitempty"` + // Description - Decription of operation. + Description *string `json:"description,omitempty"` +} + +// OperationListResult result of the request to list Storage operations. It contains a list of operations and a URL +// link to get the next set of results. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - List of Storage operations supported by the Storage resource provider. + Value *[]Operation `json:"value,omitempty"` + // NextLink - The URL to get the next set of operations. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationListResultIterator provides access to a complete listing of Operation values. +type OperationListResultIterator struct { + i int + page OperationListResultPage +} + +// Next 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 *OperationListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationListResultIterator) 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 OperationListResultIterator) Response() OperationListResult { + 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 OperationListResultIterator) Value() Operation { + if !iter.page.NotDone() { + return Operation{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (olr OperationListResult) IsEmpty() bool { + return olr.Value == nil || len(*olr.Value) == 0 +} + +// operationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (olr OperationListResult) operationListResultPreparer() (*http.Request, error) { + if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(olr.NextLink))) +} + +// OperationListResultPage contains a page of Operation values. +type OperationListResultPage struct { + fn func(OperationListResult) (OperationListResult, error) + olr OperationListResult +} + +// 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. +func (page *OperationListResultPage) Next() error { + next, err := page.fn(page.olr) + if err != nil { + return err + } + page.olr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationListResultPage) NotDone() bool { + return !page.olr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationListResultPage) Response() OperationListResult { + return page.olr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationListResultPage) Values() []Operation { + if page.olr.IsEmpty() { + return nil + } + return *page.olr.Value +} + +// OperationProperties properties of operation, include metric specifications. +type OperationProperties struct { + // ServiceSpecification - One property of operation, include metric specifications. + ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"` } // Permissions permissions the identity has for keys, secrets, certificates and storage. @@ -331,15 +588,36 @@ type Resource struct { // Location - The supported Azure location where the key vault should be created. Location *string `json:"location,omitempty"` // Tags - The tags that will be assigned to the key vault. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.ID != nil { + objectMap["id"] = r.ID + } + if r.Name != nil { + objectMap["name"] = r.Name + } + if r.Type != nil { + objectMap["type"] = r.Type + } + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) } // ResourceListResult list of vault resources. type ResourceListResult struct { autorest.Response `json:"-"` - // Value - Gets the list of vault resources. + // Value - The list of vault resources. Value *[]Resource `json:"value,omitempty"` - // NextLink - Gets the URL to get the next set of vault resources. + // NextLink - The URL to get the next set of vault resources. NextLink *string `json:"nextLink,omitempty"` } @@ -436,6 +714,12 @@ func (page ResourceListResultPage) Values() []Resource { return *page.rlr.Value } +// ServiceSpecification one property of operation, include log specifications. +type ServiceSpecification struct { + // LogSpecifications - Log specifications of operation. + LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"` +} + // Sku SKU details type Sku struct { // Family - SKU family name @@ -447,6 +731,8 @@ type Sku struct { // Vault resource information with extended details. type Vault struct { autorest.Response `json:"-"` + // Properties - Properties of the vault + Properties *VaultProperties `json:"properties,omitempty"` // ID - The Azure Resource Manager resource ID for the key vault. ID *string `json:"id,omitempty"` // Name - The name of the key vault. @@ -456,9 +742,60 @@ type Vault struct { // Location - The supported Azure location where the key vault should be created. Location *string `json:"location,omitempty"` // Tags - The tags that will be assigned to the key vault. - Tags *map[string]*string `json:"tags,omitempty"` - // Properties - Properties of the vault - Properties *VaultProperties `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Vault. +func (vVar Vault) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vVar.Properties != nil { + objectMap["properties"] = vVar.Properties + } + if vVar.ID != nil { + objectMap["id"] = vVar.ID + } + if vVar.Name != nil { + objectMap["name"] = vVar.Name + } + if vVar.Type != nil { + objectMap["type"] = vVar.Type + } + if vVar.Location != nil { + objectMap["location"] = vVar.Location + } + if vVar.Tags != nil { + objectMap["tags"] = vVar.Tags + } + return json.Marshal(objectMap) +} + +// VaultAccessPolicyParameters parameters for updating the access policy in a vault +type VaultAccessPolicyParameters struct { + autorest.Response `json:"-"` + // ID - The resource id of the access policy. + ID *string `json:"id,omitempty"` + // Name - The resource name of the access policy. + Name *string `json:"name,omitempty"` + // Type - The resource name of the access policy. + Type *string `json:"type,omitempty"` + // Location - The resource type of the the access policy. + Location *string `json:"location,omitempty"` + // Properties - Properties of the access policy + Properties *VaultAccessPolicyProperties `json:"properties,omitempty"` +} + +// VaultAccessPolicyProperties properties of the vault access policy +type VaultAccessPolicyProperties struct { + // AccessPolicies - An array of 0 to 16 identities that have access to the key vault. All identities in the array must use the same tenant ID as the key vault's tenant ID. + AccessPolicies *[]AccessPolicyEntry `json:"accessPolicies,omitempty"` +} + +// VaultCheckNameAvailabilityParameters the parameters used to check the availabity of the vault name. +type VaultCheckNameAvailabilityParameters struct { + // Name - The vault name. + Name *string `json:"name,omitempty"` + // Type - The type of resource, Microsoft.KeyVault/vaults + Type *string `json:"type,omitempty"` } // VaultCreateOrUpdateParameters parameters for creating or updating a vault @@ -466,17 +803,32 @@ type VaultCreateOrUpdateParameters struct { // Location - The supported Azure location where the key vault should be created. Location *string `json:"location,omitempty"` // Tags - The tags that will be assigned to the key vault. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` // Properties - Properties of the vault Properties *VaultProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for VaultCreateOrUpdateParameters. +func (vcoup VaultCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vcoup.Location != nil { + objectMap["location"] = vcoup.Location + } + if vcoup.Tags != nil { + objectMap["tags"] = vcoup.Tags + } + if vcoup.Properties != nil { + objectMap["properties"] = vcoup.Properties + } + return json.Marshal(objectMap) +} + // VaultListResult list of vaults type VaultListResult struct { autorest.Response `json:"-"` - // Value - Gets or sets the list of vaults. + // Value - The list of vaults. Value *[]Vault `json:"value,omitempty"` - // NextLink - Gets or sets the URL to get the next set of vaults. + // NextLink - The URL to get the next set of vaults. NextLink *string `json:"nextLink,omitempty"` } @@ -573,6 +925,46 @@ func (page VaultListResultPage) Values() []Vault { return *page.vlr.Value } +// VaultPatchParameters parameters for creating or updating a vault +type VaultPatchParameters struct { + // Tags - The tags that will be assigned to the key vault. + Tags map[string]*string `json:"tags"` + // Properties - Properties of the vault + Properties *VaultPatchProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for VaultPatchParameters. +func (vpp VaultPatchParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vpp.Tags != nil { + objectMap["tags"] = vpp.Tags + } + if vpp.Properties != nil { + objectMap["properties"] = vpp.Properties + } + return json.Marshal(objectMap) +} + +// VaultPatchProperties properties of the vault +type VaultPatchProperties struct { + // TenantID - The Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. + TenantID *uuid.UUID `json:"tenantId,omitempty"` + // Sku - SKU details + Sku *Sku `json:"sku,omitempty"` + // AccessPolicies - An array of 0 to 16 identities that have access to the key vault. All identities in the array must use the same tenant ID as the key vault's tenant ID. + AccessPolicies *[]AccessPolicyEntry `json:"accessPolicies,omitempty"` + // EnabledForDeployment - Property to specify whether Azure Virtual Machines are permitted to retrieve certificates stored as secrets from the key vault. + EnabledForDeployment *bool `json:"enabledForDeployment,omitempty"` + // EnabledForDiskEncryption - Property to specify whether Azure Disk Encryption is permitted to retrieve secrets from the vault and unwrap keys. + EnabledForDiskEncryption *bool `json:"enabledForDiskEncryption,omitempty"` + // EnabledForTemplateDeployment - Property to specify whether Azure Resource Manager is permitted to retrieve secrets from the key vault. + EnabledForTemplateDeployment *bool `json:"enabledForTemplateDeployment,omitempty"` + // EnableSoftDelete - Property to specify whether the 'soft delete' functionality is enabled for this key vault. It does not accept false value. + EnableSoftDelete *bool `json:"enableSoftDelete,omitempty"` + // CreateMode - The vault's create mode to indicate whether the vault need to be recovered or not. Possible values include: 'CreateModeRecover', 'CreateModeDefault' + CreateMode CreateMode `json:"createMode,omitempty"` +} + // VaultProperties properties of the vault type VaultProperties struct { // TenantID - The Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. @@ -607,21 +999,38 @@ func (future VaultsPurgeDeletedFuture) Result(client VaultsClient) (ar autorest. var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsPurgeDeletedFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("keyvault.VaultsPurgeDeletedFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("keyvault.VaultsPurgeDeletedFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.PurgeDeletedResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsPurgeDeletedFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsPurgeDeletedFuture", "Result", resp, "Failure sending request") return } ar, err = client.PurgeDeletedResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsPurgeDeletedFuture", "Result", resp, "Failure responding to request") + } return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2016-10-01/keyvault/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2016-10-01/keyvault/operations.go new file mode 100644 index 000000000000..b2325f7b1413 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2016-10-01/keyvault/operations.go @@ -0,0 +1,127 @@ +package keyvault + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" + "net/http" +) + +// OperationsClient is the the Azure management API provides a RESTful set of web services that interact with Azure Key +// Vault. +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client. +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all of the available Key Vault Rest API operations. +func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.olr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.olr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2016-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.KeyVault/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(lastResults OperationListResult) (result OperationListResult, err error) { + req, err := lastResults.operationListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "keyvault.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "keyvault.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResultIterator, err error) { + result.page, err = client.List(ctx) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2016-10-01/keyvault/vaults.go b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2016-10-01/keyvault/vaults.go index 90be091a5d08..3948cc6758c9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2016-10-01/keyvault/vaults.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2016-10-01/keyvault/vaults.go @@ -41,6 +41,79 @@ func NewVaultsClientWithBaseURI(baseURI string, subscriptionID string) VaultsCli return VaultsClient{NewWithBaseURI(baseURI, subscriptionID)} } +// CheckNameAvailability checks that the vault name is valid and is not already in use. +// +// vaultName is the name of the vault. +func (client VaultsClient) CheckNameAvailability(ctx context.Context, vaultName VaultCheckNameAvailabilityParameters) (result CheckNameAvailabilityResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: vaultName, + Constraints: []validation.Constraint{{Target: "vaultName.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "vaultName.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.VaultsClient", "CheckNameAvailability", err.Error()) + } + + req, err := client.CheckNameAvailabilityPreparer(ctx, vaultName) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "CheckNameAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckNameAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "CheckNameAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckNameAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "CheckNameAvailability", resp, "Failure responding to request") + } + + return +} + +// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. +func (client VaultsClient) CheckNameAvailabilityPreparer(ctx context.Context, vaultName VaultCheckNameAvailabilityParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2016-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/checkNameAvailability", pathParameters), + autorest.WithJSON(vaultName), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the +// http.Response Body if it receives an error. +func (client VaultsClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always +// closes the http.Response Body. +func (client VaultsClient) CheckNameAvailabilityResponder(resp *http.Response) (result CheckNameAvailabilityResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // CreateOrUpdate create or update a key vault in the specified subscription. // // resourceGroupName is the name of the Resource Group to which the server belongs. vaultName is name of the vault @@ -55,10 +128,8 @@ func (client VaultsClient) CreateOrUpdate(ctx context.Context, resourceGroupName Chain: []validation.Constraint{{Target: "parameters.Properties.TenantID", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.Properties.Sku", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.Properties.Sku.Family", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.Properties.AccessPolicies", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Properties.AccessPolicies", Name: validation.MaxItems, Rule: 16, Chain: nil}}}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "keyvault.VaultsClient", "CreateOrUpdate") + return result, validation.NewError("keyvault.VaultsClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, vaultName, parameters) @@ -127,8 +198,8 @@ func (client VaultsClient) CreateOrUpdateResponder(resp *http.Response) (result // Delete deletes the specified Azure key vault. // -// resourceGroupName is the name of the Resource Group to which the vault belongs. vaultName is the name of the vault -// to delete +// resourceGroupName is the name of the Resource Group to which the vault belongs. vaultName is the name of the +// vault to delete func (client VaultsClient) Delete(ctx context.Context, resourceGroupName string, vaultName string) (result autorest.Response, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, vaultName) if err != nil { @@ -193,7 +264,8 @@ func (client VaultsClient) DeleteResponder(resp *http.Response) (result autorest // Get gets the specified Azure key vault. // -// resourceGroupName is the name of the Resource Group to which the vault belongs. vaultName is the name of the vault. +// resourceGroupName is the name of the Resource Group to which the vault belongs. vaultName is the name of the +// vault. func (client VaultsClient) Get(ctx context.Context, resourceGroupName string, vaultName string) (result Vault, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, vaultName) if err != nil { @@ -325,10 +397,10 @@ func (client VaultsClient) GetDeletedResponder(resp *http.Response) (result Dele // List the List operation gets information about the vaults associated with the subscription. // -// filter is the filter to apply on the operation. top is maximum number of results to return. -func (client VaultsClient) List(ctx context.Context, filter string, top *int32) (result ResourceListResultPage, err error) { +// top is maximum number of results to return. +func (client VaultsClient) List(ctx context.Context, top *int32) (result ResourceListResultPage, err error) { result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter, top) + req, err := client.ListPreparer(ctx, top) if err != nil { err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "List", nil, "Failure preparing request") return @@ -350,14 +422,14 @@ func (client VaultsClient) List(ctx context.Context, filter string, top *int32) } // ListPreparer prepares the List request. -func (client VaultsClient) ListPreparer(ctx context.Context, filter string, top *int32) (*http.Request, error) { +func (client VaultsClient) ListPreparer(ctx context.Context, top *int32) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2015-11-01" queryParameters := map[string]interface{}{ - "$filter": autorest.Encode("query", filter), + "$filter": autorest.Encode("query", "resourceType eq 'Microsoft.KeyVault/vaults'"), "api-version": APIVersion, } if top != nil { @@ -414,16 +486,16 @@ func (client VaultsClient) listNextResults(lastResults ResourceListResult) (resu } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VaultsClient) ListComplete(ctx context.Context, filter string, top *int32) (result ResourceListResultIterator, err error) { - result.page, err = client.List(ctx, filter, top) +func (client VaultsClient) ListComplete(ctx context.Context, top *int32) (result ResourceListResultIterator, err error) { + result.page, err = client.List(ctx, top) return } // ListByResourceGroup the List operation gets information about the vaults associated with the subscription and within // the specified resource group. // -// resourceGroupName is the name of the Resource Group to which the vault belongs. top is maximum number of results to -// return. +// resourceGroupName is the name of the Resource Group to which the vault belongs. top is maximum number of results +// to return. func (client VaultsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, top *int32) (result VaultListResultPage, err error) { result.fn = client.listByResourceGroupNextResults req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, top) @@ -517,6 +589,101 @@ func (client VaultsClient) ListByResourceGroupComplete(ctx context.Context, reso return } +// ListBySubscription the List operation gets information about the vaults associated with the subscription. +// +// top is maximum number of results to return. +func (client VaultsClient) ListBySubscription(ctx context.Context, top *int32) (result VaultListResultPage, err error) { + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx, top) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.vlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.vlr, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client VaultsClient) ListBySubscriptionPreparer(ctx context.Context, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2016-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/vaults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client VaultsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client VaultsClient) ListBySubscriptionResponder(resp *http.Response) (result VaultListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client VaultsClient) listBySubscriptionNextResults(lastResults VaultListResult) (result VaultListResult, err error) { + req, err := lastResults.vaultListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "keyvault.VaultsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "keyvault.VaultsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client VaultsClient) ListBySubscriptionComplete(ctx context.Context, top *int32) (result VaultListResultIterator, err error) { + result.page, err = client.ListBySubscription(ctx, top) + return +} + // ListDeleted gets information about the deleted vaults in a subscription. func (client VaultsClient) ListDeleted(ctx context.Context) (result DeletedVaultListResultPage, err error) { result.fn = client.listDeletedNextResults @@ -673,3 +840,157 @@ func (client VaultsClient) PurgeDeletedResponder(resp *http.Response) (result au result.Response = resp return } + +// Update update a key vault in the specified subscription. +// +// resourceGroupName is the name of the Resource Group to which the server belongs. vaultName is name of the vault +// parameters is parameters to patch the vault +func (client VaultsClient) Update(ctx context.Context, resourceGroupName string, vaultName string, parameters VaultPatchParameters) (result Vault, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: vaultName, + Constraints: []validation.Constraint{{Target: "vaultName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-]{3,24}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("keyvault.VaultsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, vaultName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client VaultsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, vaultName string, parameters VaultPatchParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}", pathParameters), + autorest.WithJSON(parameters), + 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 VaultsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client VaultsClient) UpdateResponder(resp *http.Response) (result Vault, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateAccessPolicy update access policies in a key vault in the specified subscription. +// +// resourceGroupName is the name of the Resource Group to which the vault belongs. vaultName is name of the vault +// operationKind is name of the operation parameters is access policy to merge into the vault +func (client VaultsClient) UpdateAccessPolicy(ctx context.Context, resourceGroupName string, vaultName string, operationKind AccessPolicyUpdateKind, parameters VaultAccessPolicyParameters) (result VaultAccessPolicyParameters, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: vaultName, + Constraints: []validation.Constraint{{Target: "vaultName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-]{3,24}$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.AccessPolicies", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("keyvault.VaultsClient", "UpdateAccessPolicy", err.Error()) + } + + req, err := client.UpdateAccessPolicyPreparer(ctx, resourceGroupName, vaultName, operationKind, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "UpdateAccessPolicy", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateAccessPolicySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "UpdateAccessPolicy", resp, "Failure sending request") + return + } + + result, err = client.UpdateAccessPolicyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "keyvault.VaultsClient", "UpdateAccessPolicy", resp, "Failure responding to request") + } + + return +} + +// UpdateAccessPolicyPreparer prepares the UpdateAccessPolicy request. +func (client VaultsClient) UpdateAccessPolicyPreparer(ctx context.Context, resourceGroupName string, vaultName string, operationKind AccessPolicyUpdateKind, parameters VaultAccessPolicyParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "operationKind": autorest.Encode("path", operationKind), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2016-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/accessPolicies/{operationKind}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateAccessPolicySender sends the UpdateAccessPolicy request. The method will close the +// http.Response Body if it receives an error. +func (client VaultsClient) UpdateAccessPolicySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateAccessPolicyResponder handles the response to the UpdateAccessPolicy request. The method always +// closes the http.Response Body. +func (client VaultsClient) UpdateAccessPolicyResponder(resp *http.Response) (result VaultAccessPolicyParameters, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2016-10-01/keyvault/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2016-10-01/keyvault/version.go index 9607ea4b2981..fb6a25c73006 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2016-10-01/keyvault/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2016-10-01/keyvault/version.go @@ -1,5 +1,7 @@ package keyvault +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package keyvault // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta services" + return "Azure-SDK-For-Go/" + version.Number + " keyvault/2016-10-01" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/actiongroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/actiongroups.go index 94121c5eeb32..d66cfb9c9b82 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/actiongroups.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/actiongroups.go @@ -450,3 +450,72 @@ func (client ActionGroupsClient) ListBySubscriptionIDResponder(resp *http.Respon result.Response = autorest.Response{Response: resp} return } + +// Update updates an existing action group's tags. To update other fields use the CreateOrUpdate method. +// +// resourceGroupName is the name of the resource group. actionGroupName is the name of the action group. +// actionGroupPatch is parameters supplied to the operation. +func (client ActionGroupsClient) Update(ctx context.Context, resourceGroupName string, actionGroupName string, actionGroupPatch ActionGroupPatchBody) (result ActionGroupResource, err error) { + req, err := client.UpdatePreparer(ctx, resourceGroupName, actionGroupName, actionGroupPatch) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ActionGroupsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, actionGroupName string, actionGroupPatch ActionGroupPatchBody) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "actionGroupName": autorest.Encode("path", actionGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/actionGroups/{actionGroupName}", pathParameters), + autorest.WithJSON(actionGroupPatch), + 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 ActionGroupsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ActionGroupsClient) UpdateResponder(resp *http.Response) (result ActionGroupResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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/monitor/mgmt/2017-05-01-preview/insights/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/models.go index b68ac83cf2ca..92e727037be4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/models.go @@ -221,6 +221,12 @@ type ActionGroup struct { SmsReceivers *[]SmsReceiver `json:"smsReceivers,omitempty"` // WebhookReceivers - The list of webhook receivers that are part of this action group. WebhookReceivers *[]WebhookReceiver `json:"webhookReceivers,omitempty"` + // ItsmReceivers - The list of ITSM receivers that are part of this action group. + ItsmReceivers *[]ItsmReceiver `json:"itsmReceivers,omitempty"` + // AzureAppPushReceivers - The list of AzureAppPush receivers that are part of this action group. + AzureAppPushReceivers *[]AzureAppPushReceiver `json:"azureAppPushReceivers,omitempty"` + // AutomationRunbookReceivers - The list of AutomationRunbook receivers that are part of this action group. + AutomationRunbookReceivers *[]AutomationRunbookReceiver `json:"automationRunbookReceivers,omitempty"` } // ActionGroupList a list of action groups. @@ -232,6 +238,52 @@ type ActionGroupList struct { NextLink *string `json:"nextLink,omitempty"` } +// ActionGroupPatch an Azure action group for patch operations. +type ActionGroupPatch struct { + // Enabled - Indicates whether this action group is enabled. If an action group is not enabled, then none of its actions will be activated. + Enabled *bool `json:"enabled,omitempty"` +} + +// ActionGroupPatchBody an action group object for the body of patch operations. +type ActionGroupPatchBody struct { + // Tags - Resource tags + Tags *map[string]*string `json:"tags,omitempty"` + // ActionGroupPatch - The action group settings for an update operation. + *ActionGroupPatch `json:"properties,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ActionGroupPatchBody struct. +func (agpb *ActionGroupPatchBody) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + var v *json.RawMessage + + v = m["tags"] + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*m["tags"], &tags) + if err != nil { + return err + } + agpb.Tags = &tags + } + + v = m["properties"] + if v != nil { + var properties ActionGroupPatch + err = json.Unmarshal(*m["properties"], &properties) + if err != nil { + return err + } + agpb.ActionGroupPatch = &properties + } + + return nil +} + // ActionGroupResource an action group resource. type ActionGroupResource struct { autorest.Response `json:"-"` @@ -730,6 +782,22 @@ func (arrp *AlertRuleResourcePatch) UnmarshalJSON(body []byte) error { return nil } +// AutomationRunbookReceiver the Azure Automation Runbook notification receiver. +type AutomationRunbookReceiver struct { + // AutomationAccountID - The Azure automation account Id which holds this runbook and authenticate to Azure resource. + AutomationAccountID *string `json:"automationAccountId,omitempty"` + // RunbookName - The name for this runbook. + RunbookName *string `json:"runbookName,omitempty"` + // WebhookResourceID - The resource id for webhook linked to this runbook. + WebhookResourceID *string `json:"webhookResourceId,omitempty"` + // IsGlobalRunbook - Indicates whether this instance is global runbook. + IsGlobalRunbook *bool `json:"isGlobalRunbook,omitempty"` + // Name - Indicates name of the webhook. + Name *string `json:"name,omitempty"` + // ServiceURI - The URI where webhooks should be sent. + ServiceURI *string `json:"serviceUri,omitempty"` +} + // AutoscaleNotification autoscale notification. type AutoscaleNotification struct { // Operation - the operation associated with the notification and its value must be "scale" @@ -999,6 +1067,14 @@ func (asrp *AutoscaleSettingResourcePatch) UnmarshalJSON(body []byte) error { return nil } +// AzureAppPushReceiver the Azure mobile App push notification receiver. +type AzureAppPushReceiver struct { + // Name - The name of the Azure mobile app push receiver. Names must be unique across all receivers within an action group. + Name *string `json:"name,omitempty"` + // EmailAddress - The email address registered for the Azure mobile app. + EmailAddress *string `json:"emailAddress,omitempty"` +} + // DiagnosticSettings the diagnostic settings. type DiagnosticSettings struct { // StorageAccountID - The resource ID of the storage account to which you would like to send Diagnostic Logs. @@ -1219,6 +1295,20 @@ type IncidentListResult struct { Value *[]Incident `json:"value,omitempty"` } +// ItsmReceiver an Itsm receiver. +type ItsmReceiver struct { + // Name - The name of the Itsm receiver. Names must be unique across all receivers within an action group. + Name *string `json:"name,omitempty"` + // WorkspaceID - OMS LA instance identifier. + WorkspaceID *string `json:"workspaceId,omitempty"` + // ConnectionID - Unique identification of ITSM connection among multiple defined in above workspace. + ConnectionID *string `json:"connectionId,omitempty"` + // TicketConfiguration - JSON blob for the configurations of the ITSM action. CreateMultipleWorkItems option will be part of this blob as well. + TicketConfiguration *string `json:"ticketConfiguration,omitempty"` + // Region - Region in which workspace resides. Supported values:'centralindia','japaneast','southeastasia','australiasoutheast','uksouth','westcentralus','canadacentral','eastus','westeurope' + Region *string `json:"region,omitempty"` +} + // LocationThresholdRuleCondition a rule condition based on a certain number of locations failing. type LocationThresholdRuleCondition struct { // DataSource - the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/version.go index 8f55e2f90685..c33ff9d7cbc9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/version.go @@ -1,5 +1,7 @@ package insights +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package insights // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta services" + return "Azure-SDK-For-Go/" + version.Number + " insights/2017-05-01-preview" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/checknameavailability.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/checknameavailability.go index 2fe6378d7bfd..f14cb6d8d7b5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/checknameavailability.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/checknameavailability.go @@ -26,8 +26,7 @@ import ( ) // CheckNameAvailabilityClient is the the Microsoft Azure management API provides create, read, update, and delete -// functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and -// configurations. +// functionality for Azure MySQL resources including servers, databases, firewall rules, log files and configurations. type CheckNameAvailabilityClient struct { BaseClient } @@ -49,7 +48,7 @@ func (client CheckNameAvailabilityClient) Execute(ctx context.Context, nameAvail if err := validation.Validate([]validation.Validation{ {TargetValue: nameAvailabilityRequest, Constraints: []validation.Constraint{{Target: "nameAvailabilityRequest.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "mysql.CheckNameAvailabilityClient", "Execute") + return result, validation.NewError("mysql.CheckNameAvailabilityClient", "Execute", err.Error()) } req, err := client.ExecutePreparer(ctx, nameAvailabilityRequest) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/client.go index eaaf2b5e71da..8fb41d952da2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/client.go @@ -1,7 +1,7 @@ // Package mysql implements the Azure ARM Mysql service API version 2017-04-30-preview. // // The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources -// including servers, databases, firewall rules, VNET rules, log files and configurations. +// including servers, databases, firewall rules, log files and configurations. package mysql // Copyright (c) Microsoft and contributors. All rights reserved. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/configurations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/configurations.go index b4f2e72d6cf0..ac28b7f0b890 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/configurations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/configurations.go @@ -25,8 +25,7 @@ import ( ) // ConfigurationsClient is the the Microsoft Azure management API provides create, read, update, and delete -// functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and -// configurations. +// functionality for Azure MySQL resources including servers, databases, firewall rules, log files and configurations. type ConfigurationsClient struct { BaseClient } @@ -43,9 +42,9 @@ func NewConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) C // CreateOrUpdate updates a configuration of a server. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. configurationName is the name of the -// server configuration. parameters is the required parameters for updating a server configuration. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. configurationName is the +// name of the server configuration. parameters is the required parameters for updating a server configuration. func (client ConfigurationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters Configuration) (result ConfigurationsCreateOrUpdateFuture, err error) { req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, configurationName, parameters) if err != nil { @@ -116,9 +115,9 @@ func (client ConfigurationsClient) CreateOrUpdateResponder(resp *http.Response) // Get gets information about a configuration of server. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. configurationName is the name of the -// server configuration. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. configurationName is the +// name of the server configuration. func (client ConfigurationsClient) Get(ctx context.Context, resourceGroupName string, serverName string, configurationName string) (result Configuration, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, serverName, configurationName) if err != nil { @@ -185,8 +184,8 @@ func (client ConfigurationsClient) GetResponder(resp *http.Response) (result Con // ListByServer list all the configurations in a given server. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. func (client ConfigurationsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result ConfigurationListResult, err error) { req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/databases.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/databases.go index a23d07db3bed..b9c5433835e7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/databases.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/databases.go @@ -25,7 +25,7 @@ import ( ) // DatabasesClient is the the Microsoft Azure management API provides create, read, update, and delete functionality -// for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations. +// for Azure MySQL resources including servers, databases, firewall rules, log files and configurations. type DatabasesClient struct { BaseClient } @@ -42,9 +42,9 @@ func NewDatabasesClientWithBaseURI(baseURI string, subscriptionID string) Databa // CreateOrUpdate creates a new database or updates an existing database. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database. parameters is the required parameters for creating or updating a database. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database. parameters is the required parameters for creating or updating a database. func (client DatabasesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters Database) (result DatabasesCreateOrUpdateFuture, err error) { req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, parameters) if err != nil { @@ -115,9 +115,9 @@ func (client DatabasesClient) CreateOrUpdateResponder(resp *http.Response) (resu // Delete deletes a database. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database. func (client DatabasesClient) Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DatabasesDeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, databaseName) if err != nil { @@ -185,9 +185,9 @@ func (client DatabasesClient) DeleteResponder(resp *http.Response) (result autor // Get gets information about a database. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database. func (client DatabasesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result Database, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, serverName, databaseName) if err != nil { @@ -254,8 +254,8 @@ func (client DatabasesClient) GetResponder(resp *http.Response) (result Database // ListByServer list all the databases in a given server. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. func (client DatabasesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result DatabaseListResult, err error) { req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/firewallrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/firewallrules.go index 18742fc4b380..05c111ca6976 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/firewallrules.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/firewallrules.go @@ -26,8 +26,7 @@ import ( ) // FirewallRulesClient is the the Microsoft Azure management API provides create, read, update, and delete -// functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and -// configurations. +// functionality for Azure MySQL resources including servers, databases, firewall rules, log files and configurations. type FirewallRulesClient struct { BaseClient } @@ -44,9 +43,9 @@ func NewFirewallRulesClientWithBaseURI(baseURI string, subscriptionID string) Fi // CreateOrUpdate creates a new firewall rule or updates an existing firewall rule. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. firewallRuleName is the name of the -// server firewall rule. parameters is the required parameters for creating or updating a firewall rule. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. firewallRuleName is the name +// of the server firewall rule. parameters is the required parameters for creating or updating a firewall rule. func (client FirewallRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters FirewallRule) (result FirewallRulesCreateOrUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -56,7 +55,7 @@ func (client FirewallRulesClient) CreateOrUpdate(ctx context.Context, resourceGr {Target: "parameters.FirewallRuleProperties.EndIPAddress", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.FirewallRuleProperties.EndIPAddress", Name: validation.Pattern, Rule: `^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$`, Chain: nil}}}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "mysql.FirewallRulesClient", "CreateOrUpdate") + return result, validation.NewError("mysql.FirewallRulesClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, firewallRuleName, parameters) @@ -128,9 +127,9 @@ func (client FirewallRulesClient) CreateOrUpdateResponder(resp *http.Response) ( // Delete deletes a server firewall rule. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. firewallRuleName is the name of the -// server firewall rule. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. firewallRuleName is the name +// of the server firewall rule. func (client FirewallRulesClient) Delete(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string) (result FirewallRulesDeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, firewallRuleName) if err != nil { @@ -198,9 +197,9 @@ func (client FirewallRulesClient) DeleteResponder(resp *http.Response) (result a // Get gets information about a server firewall rule. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. firewallRuleName is the name of the -// server firewall rule. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. firewallRuleName is the name +// of the server firewall rule. func (client FirewallRulesClient) Get(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string) (result FirewallRule, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, serverName, firewallRuleName) if err != nil { @@ -267,8 +266,8 @@ func (client FirewallRulesClient) GetResponder(resp *http.Response) (result Fire // ListByServer list all the firewall rules in a given server. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. func (client FirewallRulesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result FirewallRuleListResult, err error) { req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/locationbasedperformancetier.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/locationbasedperformancetier.go index 42021ed107fd..be6a669bbf66 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/locationbasedperformancetier.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/locationbasedperformancetier.go @@ -25,8 +25,8 @@ import ( ) // LocationBasedPerformanceTierClient is the the Microsoft Azure management API provides create, read, update, and -// delete functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files -// and configurations. +// delete functionality for Azure MySQL resources including servers, databases, firewall rules, log files and +// configurations. type LocationBasedPerformanceTierClient struct { BaseClient } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/logfiles.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/logfiles.go index f0aca9cbf130..85edf75deff7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/logfiles.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/logfiles.go @@ -25,7 +25,7 @@ import ( ) // LogFilesClient is the the Microsoft Azure management API provides create, read, update, and delete functionality for -// Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations. +// Azure MySQL resources including servers, databases, firewall rules, log files and configurations. type LogFilesClient struct { BaseClient } @@ -42,8 +42,8 @@ func NewLogFilesClientWithBaseURI(baseURI string, subscriptionID string) LogFile // ListByServer list all the log files in a given server. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. func (client LogFilesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result LogFileListResult, err error) { req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/models.go index fbeb080dbfa2..c72fa0017c46 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/models.go @@ -22,7 +22,6 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/date" - "github.com/Azure/go-autorest/autorest/to" "net/http" ) @@ -92,33 +91,17 @@ const ( SslEnforcementEnumEnabled SslEnforcementEnum = "Enabled" ) -// VirtualNetworkRuleState enumerates the values for virtual network rule state. -type VirtualNetworkRuleState string - -const ( - // VirtualNetworkRuleStateDeleting ... - VirtualNetworkRuleStateDeleting VirtualNetworkRuleState = "Deleting" - // VirtualNetworkRuleStateInitializing ... - VirtualNetworkRuleStateInitializing VirtualNetworkRuleState = "Initializing" - // VirtualNetworkRuleStateInProgress ... - VirtualNetworkRuleStateInProgress VirtualNetworkRuleState = "InProgress" - // VirtualNetworkRuleStateReady ... - VirtualNetworkRuleStateReady VirtualNetworkRuleState = "Ready" - // VirtualNetworkRuleStateUnknown ... - VirtualNetworkRuleStateUnknown VirtualNetworkRuleState = "Unknown" -) - // Configuration represents a Configuration. type Configuration struct { autorest.Response `json:"-"` + // ConfigurationProperties - The properties of a configuration. + *ConfigurationProperties `json:"properties,omitempty"` // ID - Resource ID ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // ConfigurationProperties - The properties of a configuration. - *ConfigurationProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for Configuration struct. @@ -128,46 +111,45 @@ func (c *Configuration) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ConfigurationProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var configurationProperties ConfigurationProperties + err = json.Unmarshal(*v, &configurationProperties) + if err != nil { + return err + } + c.ConfigurationProperties = &configurationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + c.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + c.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } } - c.ConfigurationProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - c.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - c.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - c.Type = &typeVar } return nil @@ -209,36 +191,53 @@ func (future ConfigurationsCreateOrUpdateFuture) Result(client ConfigurationsCli var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ConfigurationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return c, autorest.NewError("mysql.ConfigurationsCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return c, azure.NewAsyncOpIncompleteError("mysql.ConfigurationsCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { c, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ConfigurationsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ConfigurationsCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } c, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ConfigurationsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } // Database represents a Database. type Database struct { autorest.Response `json:"-"` + // DatabaseProperties - The properties of a database. + *DatabaseProperties `json:"properties,omitempty"` // ID - Resource ID ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // DatabaseProperties - The properties of a database. - *DatabaseProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for Database struct. @@ -248,46 +247,45 @@ func (d *Database) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties DatabaseProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var databaseProperties DatabaseProperties + err = json.Unmarshal(*v, &databaseProperties) + if err != nil { + return err + } + d.DatabaseProperties = &databaseProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + d.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + d.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + d.Type = &typeVar + } } - d.DatabaseProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - d.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - d.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - d.Type = &typeVar } return nil @@ -308,7 +306,8 @@ type DatabaseProperties struct { Collation *string `json:"collation,omitempty"` } -// DatabasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// DatabasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type DatabasesCreateOrUpdateFuture struct { azure.Future req *http.Request @@ -320,22 +319,39 @@ func (future DatabasesCreateOrUpdateFuture) Result(client DatabasesClient) (d Da var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "mysql.DatabasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return d, autorest.NewError("mysql.DatabasesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return d, azure.NewAsyncOpIncompleteError("mysql.DatabasesCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { d, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.DatabasesCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "mysql.DatabasesCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } d, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.DatabasesCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -351,36 +367,53 @@ func (future DatabasesDeleteFuture) Result(client DatabasesClient) (ar autorest. var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "mysql.DatabasesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("mysql.DatabasesDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("mysql.DatabasesDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.DatabasesDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "mysql.DatabasesDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.DatabasesDeleteFuture", "Result", resp, "Failure responding to request") + } return } // FirewallRule represents a server firewall rule. type FirewallRule struct { autorest.Response `json:"-"` + // FirewallRuleProperties - The properties of a firewall rule. + *FirewallRuleProperties `json:"properties,omitempty"` // ID - Resource ID ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // FirewallRuleProperties - The properties of a firewall rule. - *FirewallRuleProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for FirewallRule struct. @@ -390,46 +423,45 @@ func (fr *FirewallRule) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties FirewallRuleProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var firewallRuleProperties FirewallRuleProperties + err = json.Unmarshal(*v, &firewallRuleProperties) + if err != nil { + return err + } + fr.FirewallRuleProperties = &firewallRuleProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + fr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + fr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + fr.Type = &typeVar + } } - fr.FirewallRuleProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - fr.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - fr.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - fr.Type = &typeVar } return nil @@ -463,22 +495,39 @@ func (future FirewallRulesCreateOrUpdateFuture) Result(client FirewallRulesClien var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "mysql.FirewallRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return fr, autorest.NewError("mysql.FirewallRulesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return fr, azure.NewAsyncOpIncompleteError("mysql.FirewallRulesCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { fr, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.FirewallRulesCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "mysql.FirewallRulesCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } fr, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.FirewallRulesCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -494,35 +543,52 @@ func (future FirewallRulesDeleteFuture) Result(client FirewallRulesClient) (ar a var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "mysql.FirewallRulesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("mysql.FirewallRulesDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("mysql.FirewallRulesDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.FirewallRulesDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "mysql.FirewallRulesDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.FirewallRulesDeleteFuture", "Result", resp, "Failure responding to request") + } return } // LogFile represents a log file. type LogFile struct { + // LogFileProperties - The properties of the log file. + *LogFileProperties `json:"properties,omitempty"` // ID - Resource ID ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // LogFileProperties - The properties of the log file. - *LogFileProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for LogFile struct. @@ -532,46 +598,45 @@ func (lf *LogFile) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties LogFileProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var logFileProperties LogFileProperties + err = json.Unmarshal(*v, &logFileProperties) + if err != nil { + return err + } + lf.LogFileProperties = &logFileProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + lf.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + lf.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + lf.Type = &typeVar + } } - lf.LogFileProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - lf.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - lf.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - lf.Type = &typeVar } return nil @@ -628,7 +693,23 @@ type Operation struct { // Origin - The intended executor of the operation. Possible values include: 'NotSpecified', 'User', 'System' Origin OperationOrigin `json:"origin,omitempty"` // Properties - Additional descriptions for the operation. - Properties *map[string]*map[string]interface{} `json:"properties,omitempty"` + Properties map[string]interface{} `json:"properties"` +} + +// MarshalJSON is the custom marshaler for Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if o.Name != nil { + objectMap["name"] = o.Name + } + if o.Display != nil { + objectMap["display"] = o.Display + } + objectMap["origin"] = o.Origin + if o.Properties != nil { + objectMap["properties"] = o.Properties + } + return json.Marshal(objectMap) } // OperationDisplay display metadata associated with the operation. @@ -692,99 +773,122 @@ type ProxyResource struct { // Server represents a server. type Server struct { autorest.Response `json:"-"` + // Sku - The SKU (pricing tier) of the server. + Sku *Sku `json:"sku,omitempty"` + // ServerProperties - Properties of the server. + *ServerProperties `json:"properties,omitempty"` + // Location - The location the resource resides in. + Location *string `json:"location,omitempty"` + // Tags - Application-specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags"` // ID - Resource ID ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // Location - The location the resource resides in. - Location *string `json:"location,omitempty"` - // Tags - Application-specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` - // Sku - The SKU (pricing tier) of the server. - Sku *Sku `json:"sku,omitempty"` - // ServerProperties - Properties of the server. - *ServerProperties `json:"properties,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for Server struct. -func (s *Server) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for Server. +func (s Server) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.Sku != nil { + objectMap["sku"] = s.Sku } - var v *json.RawMessage - - v = m["sku"] - if v != nil { - var sku Sku - err = json.Unmarshal(*m["sku"], &sku) - if err != nil { - return err - } - s.Sku = &sku + if s.ServerProperties != nil { + objectMap["properties"] = s.ServerProperties } - - v = m["properties"] - if v != nil { - var properties ServerProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - s.ServerProperties = &properties + if s.Location != nil { + objectMap["location"] = s.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - s.Location = &location + if s.Tags != nil { + objectMap["tags"] = s.Tags } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - s.Tags = &tags + if s.ID != nil { + objectMap["id"] = s.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - s.ID = &ID + if s.Name != nil { + objectMap["name"] = s.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - s.Name = &name + if s.Type != nil { + objectMap["type"] = s.Type } + return json.Marshal(objectMap) +} - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for Server struct. +func (s *Server) 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 "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + s.Sku = &sku + } + case "properties": + if v != nil { + var serverProperties ServerProperties + err = json.Unmarshal(*v, &serverProperties) + if err != nil { + return err + } + s.ServerProperties = &serverProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + s.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + s.Tags = tags + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + s.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + s.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + s.Type = &typeVar + } } - s.Type = &typeVar } return nil @@ -799,7 +903,23 @@ type ServerForCreate struct { // Location - The location the resource resides in. Location *string `json:"location,omitempty"` // Tags - Application-specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ServerForCreate. +func (sfc ServerForCreate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sfc.Sku != nil { + objectMap["sku"] = sfc.Sku + } + objectMap["properties"] = sfc.Properties + if sfc.Location != nil { + objectMap["location"] = sfc.Location + } + if sfc.Tags != nil { + objectMap["tags"] = sfc.Tags + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ServerForCreate struct. @@ -809,45 +929,44 @@ func (sfc *ServerForCreate) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["sku"] - if v != nil { - var sku Sku - err = json.Unmarshal(*m["sku"], &sku) - if err != nil { - return err - } - sfc.Sku = &sku - } - - v = m["properties"] - if v != nil { - properties, err := unmarshalBasicServerPropertiesForCreate(*m["properties"]) - if err != nil { - return err + for k, v := range m { + switch k { + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + sfc.Sku = &sku + } + case "properties": + if v != nil { + properties, err := unmarshalBasicServerPropertiesForCreate(*v) + if err != nil { + return err + } + sfc.Properties = properties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + sfc.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + sfc.Tags = tags + } } - sfc.Properties = properties - } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - sfc.Location = &location - } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - sfc.Tags = &tags } return nil @@ -939,12 +1058,14 @@ func unmarshalBasicServerPropertiesForCreateArray(body []byte) ([]BasicServerPro // MarshalJSON is the custom marshaler for ServerPropertiesForCreate. func (spfc ServerPropertiesForCreate) MarshalJSON() ([]byte, error) { spfc.CreateMode = CreateModeServerPropertiesForCreate - type Alias ServerPropertiesForCreate - return json.Marshal(&struct { - Alias - }{ - Alias: (Alias)(spfc), - }) + objectMap := make(map[string]interface{}) + if spfc.StorageMB != nil { + objectMap["storageMB"] = spfc.StorageMB + } + objectMap["version"] = spfc.Version + objectMap["sslEnforcement"] = spfc.SslEnforcement + objectMap["createMode"] = spfc.CreateMode + return json.Marshal(objectMap) } // AsServerPropertiesForDefaultCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForCreate. @@ -969,6 +1090,10 @@ func (spfc ServerPropertiesForCreate) AsBasicServerPropertiesForCreate() (BasicS // ServerPropertiesForDefaultCreate the properties used to create a new server. type ServerPropertiesForDefaultCreate struct { + // AdministratorLogin - The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). + AdministratorLogin *string `json:"administratorLogin,omitempty"` + // AdministratorLoginPassword - The password of the administrator login. + AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` // StorageMB - The maximum storage allowed for a server. StorageMB *int64 `json:"storageMB,omitempty"` // Version - Server version. Possible values include: 'FiveFullStopSix', 'FiveFullStopSeven' @@ -977,21 +1102,25 @@ type ServerPropertiesForDefaultCreate struct { SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"` // CreateMode - Possible values include: 'CreateModeServerPropertiesForCreate', 'CreateModeDefault', 'CreateModePointInTimeRestore' CreateMode CreateMode `json:"createMode,omitempty"` - // AdministratorLogin - The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). - AdministratorLogin *string `json:"administratorLogin,omitempty"` - // AdministratorLoginPassword - The password of the administrator login. - AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` } // MarshalJSON is the custom marshaler for ServerPropertiesForDefaultCreate. func (spfdc ServerPropertiesForDefaultCreate) MarshalJSON() ([]byte, error) { spfdc.CreateMode = CreateModeDefault - type Alias ServerPropertiesForDefaultCreate - return json.Marshal(&struct { - Alias - }{ - Alias: (Alias)(spfdc), - }) + objectMap := make(map[string]interface{}) + if spfdc.AdministratorLogin != nil { + objectMap["administratorLogin"] = spfdc.AdministratorLogin + } + if spfdc.AdministratorLoginPassword != nil { + objectMap["administratorLoginPassword"] = spfdc.AdministratorLoginPassword + } + if spfdc.StorageMB != nil { + objectMap["storageMB"] = spfdc.StorageMB + } + objectMap["version"] = spfdc.Version + objectMap["sslEnforcement"] = spfdc.SslEnforcement + objectMap["createMode"] = spfdc.CreateMode + return json.Marshal(objectMap) } // AsServerPropertiesForDefaultCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForDefaultCreate. @@ -1016,6 +1145,10 @@ func (spfdc ServerPropertiesForDefaultCreate) AsBasicServerPropertiesForCreate() // ServerPropertiesForRestore the properties to a new server by restoring from a backup. type ServerPropertiesForRestore struct { + // SourceServerID - The source server id to restore from. + SourceServerID *string `json:"sourceServerId,omitempty"` + // RestorePointInTime - Restore point creation time (ISO8601 format), specifying the time to restore from. + RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"` // StorageMB - The maximum storage allowed for a server. StorageMB *int64 `json:"storageMB,omitempty"` // Version - Server version. Possible values include: 'FiveFullStopSix', 'FiveFullStopSeven' @@ -1024,21 +1157,25 @@ type ServerPropertiesForRestore struct { SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"` // CreateMode - Possible values include: 'CreateModeServerPropertiesForCreate', 'CreateModeDefault', 'CreateModePointInTimeRestore' CreateMode CreateMode `json:"createMode,omitempty"` - // SourceServerID - The source server id to restore from. - SourceServerID *string `json:"sourceServerId,omitempty"` - // RestorePointInTime - Restore point creation time (ISO8601 format), specifying the time to restore from. - RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"` } // MarshalJSON is the custom marshaler for ServerPropertiesForRestore. func (spfr ServerPropertiesForRestore) MarshalJSON() ([]byte, error) { spfr.CreateMode = CreateModePointInTimeRestore - type Alias ServerPropertiesForRestore - return json.Marshal(&struct { - Alias - }{ - Alias: (Alias)(spfr), - }) + objectMap := make(map[string]interface{}) + if spfr.SourceServerID != nil { + objectMap["sourceServerId"] = spfr.SourceServerID + } + if spfr.RestorePointInTime != nil { + objectMap["restorePointInTime"] = spfr.RestorePointInTime + } + if spfr.StorageMB != nil { + objectMap["storageMB"] = spfr.StorageMB + } + objectMap["version"] = spfr.Version + objectMap["sslEnforcement"] = spfr.SslEnforcement + objectMap["createMode"] = spfr.CreateMode + return json.Marshal(objectMap) } // AsServerPropertiesForDefaultCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForRestore. @@ -1061,7 +1198,8 @@ func (spfr ServerPropertiesForRestore) AsBasicServerPropertiesForCreate() (Basic return &spfr, true } -// ServersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// ServersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type ServersCreateOrUpdateFuture struct { azure.Future req *http.Request @@ -1073,22 +1211,39 @@ func (future ServersCreateOrUpdateFuture) Result(client ServersClient) (s Server var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return s, autorest.NewError("mysql.ServersCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return s, azure.NewAsyncOpIncompleteError("mysql.ServersCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { s, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServersCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServersCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } s, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServersCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -1104,22 +1259,39 @@ func (future ServersDeleteFuture) Result(client ServersClient) (ar autorest.Resp var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServersDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("mysql.ServersDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("mysql.ServersDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServersDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServersDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServersDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -1135,22 +1307,39 @@ func (future ServersUpdateFuture) Result(client ServersClient) (s Server, err er var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServersUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return s, autorest.NewError("mysql.ServersUpdateFuture", "Result", "asynchronous operation has not completed") + return s, azure.NewAsyncOpIncompleteError("mysql.ServersUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { s, err = client.UpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServersUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServersUpdateFuture", "Result", resp, "Failure sending request") return } s, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mysql.ServersUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -1161,7 +1350,22 @@ type ServerUpdateParameters struct { // ServerUpdateParametersProperties - The properties that can be updated for a server. *ServerUpdateParametersProperties `json:"properties,omitempty"` // Tags - Application-specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ServerUpdateParameters. +func (sup ServerUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sup.Sku != nil { + objectMap["sku"] = sup.Sku + } + if sup.ServerUpdateParametersProperties != nil { + objectMap["properties"] = sup.ServerUpdateParametersProperties + } + if sup.Tags != nil { + objectMap["tags"] = sup.Tags + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ServerUpdateParameters struct. @@ -1171,36 +1375,36 @@ func (sup *ServerUpdateParameters) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["sku"] - if v != nil { - var sku Sku - err = json.Unmarshal(*m["sku"], &sku) - if err != nil { - return err - } - sup.Sku = &sku - } - - v = m["properties"] - if v != nil { - var properties ServerUpdateParametersProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + sup.Sku = &sku + } + case "properties": + if v != nil { + var serverUpdateParametersProperties ServerUpdateParametersProperties + err = json.Unmarshal(*v, &serverUpdateParametersProperties) + if err != nil { + return err + } + sup.ServerUpdateParametersProperties = &serverUpdateParametersProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + sup.Tags = tags + } } - sup.ServerUpdateParametersProperties = &properties - } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - sup.Tags = &tags } return nil @@ -1234,255 +1438,35 @@ type Sku struct { // TrackedResource resource properties including location and tags for track resources. type TrackedResource struct { - // ID - Resource ID - ID *string `json:"id,omitempty"` - // Name - Resource name. - Name *string `json:"name,omitempty"` - // Type - Resource type. - Type *string `json:"type,omitempty"` // Location - The location the resource resides in. Location *string `json:"location,omitempty"` // Tags - Application-specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` -} - -// VirtualNetworkRule a virtual network rule. -type VirtualNetworkRule struct { - autorest.Response `json:"-"` + Tags map[string]*string `json:"tags"` // ID - Resource ID ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // VirtualNetworkRuleProperties - Resource properties. - *VirtualNetworkRuleProperties `json:"properties,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for VirtualNetworkRule struct. -func (vnr *VirtualNetworkRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Location != nil { + objectMap["location"] = tr.Location } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties VirtualNetworkRuleProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - vnr.VirtualNetworkRuleProperties = &properties + if tr.Tags != nil { + objectMap["tags"] = tr.Tags } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - vnr.ID = &ID + if tr.ID != nil { + objectMap["id"] = tr.ID } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - vnr.Name = &name + if tr.Name != nil { + objectMap["name"] = tr.Name } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - vnr.Type = &typeVar + if tr.Type != nil { + objectMap["type"] = tr.Type } - - return nil -} - -// VirtualNetworkRuleListResult a list of virtual network rules. -type VirtualNetworkRuleListResult struct { - autorest.Response `json:"-"` - // Value - Array of results. - Value *[]VirtualNetworkRule `json:"value,omitempty"` - // NextLink - Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualNetworkRuleListResultIterator provides access to a complete listing of VirtualNetworkRule values. -type VirtualNetworkRuleListResultIterator struct { - i int - page VirtualNetworkRuleListResultPage -} - -// Next 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 *VirtualNetworkRuleListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualNetworkRuleListResultIterator) 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 VirtualNetworkRuleListResultIterator) Response() VirtualNetworkRuleListResult { - 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 VirtualNetworkRuleListResultIterator) Value() VirtualNetworkRule { - if !iter.page.NotDone() { - return VirtualNetworkRule{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (vnrlr VirtualNetworkRuleListResult) IsEmpty() bool { - return vnrlr.Value == nil || len(*vnrlr.Value) == 0 -} - -// virtualNetworkRuleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vnrlr VirtualNetworkRuleListResult) virtualNetworkRuleListResultPreparer() (*http.Request, error) { - if vnrlr.NextLink == nil || len(to.String(vnrlr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vnrlr.NextLink))) -} - -// VirtualNetworkRuleListResultPage contains a page of VirtualNetworkRule values. -type VirtualNetworkRuleListResultPage struct { - fn func(VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error) - vnrlr VirtualNetworkRuleListResult -} - -// 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. -func (page *VirtualNetworkRuleListResultPage) Next() error { - next, err := page.fn(page.vnrlr) - if err != nil { - return err - } - page.vnrlr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualNetworkRuleListResultPage) NotDone() bool { - return !page.vnrlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualNetworkRuleListResultPage) Response() VirtualNetworkRuleListResult { - return page.vnrlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualNetworkRuleListResultPage) Values() []VirtualNetworkRule { - if page.vnrlr.IsEmpty() { - return nil - } - return *page.vnrlr.Value -} - -// VirtualNetworkRuleProperties properties of a virtual network rule. -type VirtualNetworkRuleProperties struct { - // VirtualNetworkSubnetID - The ARM resource id of the virtual network subnet. - VirtualNetworkSubnetID *string `json:"virtualNetworkSubnetId,omitempty"` - // IgnoreMissingVnetServiceEndpoint - Create firewall rule before the virtual network has vnet service endpoint enabled. - IgnoreMissingVnetServiceEndpoint *bool `json:"ignoreMissingVnetServiceEndpoint,omitempty"` - // State - Virtual Network Rule State. Possible values include: 'VirtualNetworkRuleStateInitializing', 'VirtualNetworkRuleStateInProgress', 'VirtualNetworkRuleStateReady', 'VirtualNetworkRuleStateDeleting', 'VirtualNetworkRuleStateUnknown' - State VirtualNetworkRuleState `json:"state,omitempty"` -} - -// VirtualNetworkRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualNetworkRulesCreateOrUpdateFuture struct { - azure.Future - req *http.Request -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future VirtualNetworkRulesCreateOrUpdateFuture) Result(client VirtualNetworkRulesClient) (vnr VirtualNetworkRule, err error) { - var done bool - done, err = future.Done(client) - if err != nil { - return - } - if !done { - return vnr, autorest.NewError("mysql.VirtualNetworkRulesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") - } - if future.PollingMethod() == azure.PollingLocation { - vnr, err = client.CreateOrUpdateResponder(future.Response()) - return - } - var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if err != nil { - return - } - vnr, err = client.CreateOrUpdateResponder(resp) - return -} - -// VirtualNetworkRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualNetworkRulesDeleteFuture struct { - azure.Future - req *http.Request -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future VirtualNetworkRulesDeleteFuture) Result(client VirtualNetworkRulesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.Done(client) - if err != nil { - return - } - if !done { - return ar, autorest.NewError("mysql.VirtualNetworkRulesDeleteFuture", "Result", "asynchronous operation has not completed") - } - if future.PollingMethod() == azure.PollingLocation { - ar, err = client.DeleteResponder(future.Response()) - return - } - var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if err != nil { - return - } - ar, err = client.DeleteResponder(resp) - return + return json.Marshal(objectMap) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/operations.go index bef9c1a0b767..921148785f33 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/operations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/operations.go @@ -25,7 +25,7 @@ import ( ) // OperationsClient is the the Microsoft Azure management API provides create, read, update, and delete functionality -// for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations. +// for Azure MySQL resources including servers, databases, firewall rules, log files and configurations. type OperationsClient struct { BaseClient } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/performancetiers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/performancetiers.go index 6c4231906199..c7db15a3fee5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/performancetiers.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/performancetiers.go @@ -25,8 +25,7 @@ import ( ) // PerformanceTiersClient is the the Microsoft Azure management API provides create, read, update, and delete -// functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and -// configurations. +// functionality for Azure MySQL resources including servers, databases, firewall rules, log files and configurations. type PerformanceTiersClient struct { BaseClient } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/servers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/servers.go index 2ba105ecbd5a..541b806ee54d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/servers.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/servers.go @@ -26,7 +26,7 @@ import ( ) // ServersClient is the the Microsoft Azure management API provides create, read, update, and delete functionality for -// Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations. +// Azure MySQL resources including servers, databases, firewall rules, log files and configurations. type ServersClient struct { BaseClient } @@ -44,8 +44,8 @@ func NewServersClientWithBaseURI(baseURI string, subscriptionID string) ServersC // CreateOrUpdate creates a new server or updates an existing server. The update action will overwrite the existing // server. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. parameters is the required +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. parameters is the required // parameters for creating or updating a server. func (client ServersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters ServerForCreate) (result ServersCreateOrUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ @@ -59,7 +59,7 @@ func (client ServersClient) CreateOrUpdate(ctx context.Context, resourceGroupNam Chain: []validation.Constraint{{Target: "parameters.Properties.StorageMB", Name: validation.InclusiveMinimum, Rule: 1024, Chain: nil}}}, }}, {Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "mysql.ServersClient", "CreateOrUpdate") + return result, validation.NewError("mysql.ServersClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, parameters) @@ -130,8 +130,8 @@ func (client ServersClient) CreateOrUpdateResponder(resp *http.Response) (result // Delete deletes a server. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. func (client ServersClient) Delete(ctx context.Context, resourceGroupName string, serverName string) (result ServersDeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, serverName) if err != nil { @@ -198,8 +198,8 @@ func (client ServersClient) DeleteResponder(resp *http.Response) (result autores // Get gets information about a server. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. func (client ServersClient) Get(ctx context.Context, resourceGroupName string, serverName string) (result Server, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, serverName) if err != nil { @@ -327,8 +327,8 @@ func (client ServersClient) ListResponder(resp *http.Response) (result ServerLis // ListByResourceGroup list all the servers in a given resource group. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. func (client ServersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ServerListResult, err error) { req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) if err != nil { @@ -394,8 +394,8 @@ func (client ServersClient) ListByResourceGroupResponder(resp *http.Response) (r // Update updates an existing server. The request body can contain one to many of the properties present in the normal // server definition. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. parameters is the required +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. parameters is the required // parameters for updating a server. func (client ServersClient) Update(ctx context.Context, resourceGroupName string, serverName string, parameters ServerUpdateParameters) (result ServersUpdateFuture, err error) { req, err := client.UpdatePreparer(ctx, resourceGroupName, serverName, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/version.go index 9dbbc49e82fc..91fde84c3b82 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/version.go @@ -1,5 +1,7 @@ package mysql +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package mysql // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta services" + return "Azure-SDK-For-Go/" + version.Number + " mysql/2017-04-30-preview" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/virtualnetworkrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/virtualnetworkrules.go deleted file mode 100644 index 8b0f96eba296..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/virtualnetworkrules.go +++ /dev/null @@ -1,357 +0,0 @@ -package mysql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// 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" - "net/http" -) - -// VirtualNetworkRulesClient is the the Microsoft Azure management API provides create, read, update, and delete -// functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and -// configurations. -type VirtualNetworkRulesClient struct { - BaseClient -} - -// NewVirtualNetworkRulesClient creates an instance of the VirtualNetworkRulesClient client. -func NewVirtualNetworkRulesClient(subscriptionID string) VirtualNetworkRulesClient { - return NewVirtualNetworkRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualNetworkRulesClientWithBaseURI creates an instance of the VirtualNetworkRulesClient client. -func NewVirtualNetworkRulesClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworkRulesClient { - return VirtualNetworkRulesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates an existing virtual network rule. -// -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. virtualNetworkRuleName is the name -// of the virtual network rule. parameters is the requested virtual Network Rule Resource state. -func (client VirtualNetworkRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, parameters VirtualNetworkRule) (result VirtualNetworkRulesCreateOrUpdateFuture, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VirtualNetworkRuleProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkRuleProperties.VirtualNetworkSubnetID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "mysql.VirtualNetworkRulesClient", "CreateOrUpdate") - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, virtualNetworkRuleName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "mysql.VirtualNetworkRulesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "mysql.VirtualNetworkRulesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualNetworkRulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, parameters VirtualNetworkRule) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkRuleName": autorest.Encode("path", virtualNetworkRuleName), - } - - const APIVersion = "2017-04-30-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsJSON(), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", pathParameters), - autorest.WithJSON(parameters), - 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 VirtualNetworkRulesClient) CreateOrUpdateSender(req *http.Request) (future VirtualNetworkRulesCreateOrUpdateFuture, err error) { - sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) - future.Future = azure.NewFuture(req) - future.req = req - _, err = future.Done(sender) - if err != nil { - return - } - err = autorest.Respond(future.Response(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted)) - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualNetworkRulesClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetworkRule, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the virtual network rule with the given name. -// -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. virtualNetworkRuleName is the name -// of the virtual network rule. -func (client VirtualNetworkRulesClient) Delete(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string) (result VirtualNetworkRulesDeleteFuture, err error) { - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, virtualNetworkRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "mysql.VirtualNetworkRulesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "mysql.VirtualNetworkRulesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualNetworkRulesClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkRuleName": autorest.Encode("path", virtualNetworkRuleName), - } - - const APIVersion = "2017-04-30-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", 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 VirtualNetworkRulesClient) DeleteSender(req *http.Request) (future VirtualNetworkRulesDeleteFuture, err error) { - sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) - future.Future = azure.NewFuture(req) - future.req = req - _, err = future.Done(sender) - if err != nil { - return - } - err = autorest.Respond(future.Response(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualNetworkRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets a virtual network rule. -// -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. virtualNetworkRuleName is the name -// of the virtual network rule. -func (client VirtualNetworkRulesClient) Get(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string) (result VirtualNetworkRule, err error) { - req, err := client.GetPreparer(ctx, resourceGroupName, serverName, virtualNetworkRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "mysql.VirtualNetworkRulesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mysql.VirtualNetworkRulesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mysql.VirtualNetworkRulesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualNetworkRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkRuleName": autorest.Encode("path", virtualNetworkRuleName), - } - - const APIVersion = "2017-04-30-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", 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 VirtualNetworkRulesClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualNetworkRulesClient) GetResponder(resp *http.Response) (result VirtualNetworkRule, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByServer gets a list of virtual network rules in a server. -// -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. -func (client VirtualNetworkRulesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result VirtualNetworkRuleListResultPage, err error) { - result.fn = client.listByServerNextResults - req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) - if err != nil { - err = autorest.NewErrorWithError(err, "mysql.VirtualNetworkRulesClient", "ListByServer", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServerSender(req) - if err != nil { - result.vnrlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "mysql.VirtualNetworkRulesClient", "ListByServer", resp, "Failure sending request") - return - } - - result.vnrlr, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mysql.VirtualNetworkRulesClient", "ListByServer", resp, "Failure responding to request") - } - - return -} - -// ListByServerPreparer prepares the ListByServer request. -func (client VirtualNetworkRulesClient) ListByServerPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-04-30-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/virtualNetworkRules", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByServerSender sends the ListByServer request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkRulesClient) ListByServerSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListByServerResponder handles the response to the ListByServer request. The method always -// closes the http.Response Body. -func (client VirtualNetworkRulesClient) ListByServerResponder(resp *http.Response) (result VirtualNetworkRuleListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByServerNextResults retrieves the next set of results, if any. -func (client VirtualNetworkRulesClient) listByServerNextResults(lastResults VirtualNetworkRuleListResult) (result VirtualNetworkRuleListResult, err error) { - req, err := lastResults.virtualNetworkRuleListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "mysql.VirtualNetworkRulesClient", "listByServerNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByServerSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "mysql.VirtualNetworkRulesClient", "listByServerNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "mysql.VirtualNetworkRulesClient", "listByServerNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByServerComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualNetworkRulesClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result VirtualNetworkRuleListResultIterator, err error) { - result.page, err = client.ListByServer(ctx, resourceGroupName, serverName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/applicationgateways.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/applicationgateways.go index e8e58f9a151f..a05b0b04af81 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/applicationgateways.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/applicationgateways.go @@ -42,8 +42,8 @@ func NewApplicationGatewaysClientWithBaseURI(baseURI string, subscriptionID stri // BackendHealth gets the backend health of the specified application gateway in a resource group. // -// resourceGroupName is the name of the resource group. applicationGatewayName is the name of the application gateway. -// expand is expands BackendAddressPool and BackendHttpSettings referenced in backend health. +// resourceGroupName is the name of the resource group. applicationGatewayName is the name of the application +// gateway. expand is expands BackendAddressPool and BackendHttpSettings referenced in backend health. func (client ApplicationGatewaysClient) BackendHealth(ctx context.Context, resourceGroupName string, applicationGatewayName string, expand string) (result ApplicationGatewaysBackendHealthFuture, err error) { req, err := client.BackendHealthPreparer(ctx, resourceGroupName, applicationGatewayName, expand) if err != nil { @@ -114,8 +114,8 @@ func (client ApplicationGatewaysClient) BackendHealthResponder(resp *http.Respon // CreateOrUpdate creates or updates the specified application gateway. // -// resourceGroupName is the name of the resource group. applicationGatewayName is the name of the application gateway. -// parameters is parameters supplied to the create or update application gateway operation. +// resourceGroupName is the name of the resource group. applicationGatewayName is the name of the application +// gateway. parameters is parameters supplied to the create or update application gateway operation. func (client ApplicationGatewaysClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, applicationGatewayName string, parameters ApplicationGateway) (result ApplicationGatewaysCreateOrUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -126,7 +126,7 @@ func (client ApplicationGatewaysClient) CreateOrUpdate(ctx context.Context, reso {Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.RuleSetVersion", Name: validation.Null, Rule: true, Chain: nil}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "network.ApplicationGatewaysClient", "CreateOrUpdate") + return result, validation.NewError("network.ApplicationGatewaysClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, applicationGatewayName, parameters) @@ -197,7 +197,8 @@ func (client ApplicationGatewaysClient) CreateOrUpdateResponder(resp *http.Respo // Delete deletes the specified application gateway. // -// resourceGroupName is the name of the resource group. applicationGatewayName is the name of the application gateway. +// resourceGroupName is the name of the resource group. applicationGatewayName is the name of the application +// gateway. func (client ApplicationGatewaysClient) Delete(ctx context.Context, resourceGroupName string, applicationGatewayName string) (result ApplicationGatewaysDeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, applicationGatewayName) if err != nil { @@ -264,7 +265,8 @@ func (client ApplicationGatewaysClient) DeleteResponder(resp *http.Response) (re // Get gets the specified application gateway. // -// resourceGroupName is the name of the resource group. applicationGatewayName is the name of the application gateway. +// resourceGroupName is the name of the resource group. applicationGatewayName is the name of the application +// gateway. func (client ApplicationGatewaysClient) Get(ctx context.Context, resourceGroupName string, applicationGatewayName string) (result ApplicationGateway, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, applicationGatewayName) if err != nil { @@ -792,7 +794,8 @@ func (client ApplicationGatewaysClient) ListAvailableWafRuleSetsResponder(resp * // Start starts the specified application gateway. // -// resourceGroupName is the name of the resource group. applicationGatewayName is the name of the application gateway. +// resourceGroupName is the name of the resource group. applicationGatewayName is the name of the application +// gateway. func (client ApplicationGatewaysClient) Start(ctx context.Context, resourceGroupName string, applicationGatewayName string) (result ApplicationGatewaysStartFuture, err error) { req, err := client.StartPreparer(ctx, resourceGroupName, applicationGatewayName) if err != nil { @@ -859,7 +862,8 @@ func (client ApplicationGatewaysClient) StartResponder(resp *http.Response) (res // Stop stops the specified application gateway in a resource group. // -// resourceGroupName is the name of the resource group. applicationGatewayName is the name of the application gateway. +// resourceGroupName is the name of the resource group. applicationGatewayName is the name of the application +// gateway. func (client ApplicationGatewaysClient) Stop(ctx context.Context, resourceGroupName string, applicationGatewayName string) (result ApplicationGatewaysStopFuture, err error) { req, err := client.StopPreparer(ctx, resourceGroupName, applicationGatewayName) if err != nil { @@ -926,8 +930,8 @@ func (client ApplicationGatewaysClient) StopResponder(resp *http.Response) (resu // UpdateTags updates the specified application gateway tags. // -// resourceGroupName is the name of the resource group. applicationGatewayName is the name of the application gateway. -// parameters is parameters supplied to update application gateway tags. +// resourceGroupName is the name of the resource group. applicationGatewayName is the name of the application +// gateway. parameters is parameters supplied to update application gateway tags. func (client ApplicationGatewaysClient) UpdateTags(ctx context.Context, resourceGroupName string, applicationGatewayName string, parameters TagsObject) (result ApplicationGatewaysUpdateTagsFuture, err error) { req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, applicationGatewayName, parameters) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/client.go index 5e459d4d479f..3c5bc3888085 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/client.go @@ -55,8 +55,8 @@ func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { // CheckDNSNameAvailability checks whether a domain name in the cloudapp.azure.com zone is available for use. // -// location is the location of the domain name. domainNameLabel is the domain name to be verified. It must conform to -// the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. +// location is the location of the domain name. domainNameLabel is the domain name to be verified. It must conform +// to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. func (client BaseClient) CheckDNSNameAvailability(ctx context.Context, location string, domainNameLabel string) (result DNSNameAvailabilityResult, err error) { req, err := client.CheckDNSNameAvailabilityPreparer(ctx, location, domainNameLabel) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/defaultsecurityrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/defaultsecurityrules.go index 7117b2c778a0..94666cae9888 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/defaultsecurityrules.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/defaultsecurityrules.go @@ -41,8 +41,8 @@ func NewDefaultSecurityRulesClientWithBaseURI(baseURI string, subscriptionID str // Get get the specified default network security rule. // -// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network security -// group. defaultSecurityRuleName is the name of the default security rule. +// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network +// security group. defaultSecurityRuleName is the name of the default security rule. func (client DefaultSecurityRulesClient) Get(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, defaultSecurityRuleName string) (result SecurityRule, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName) if err != nil { @@ -109,8 +109,8 @@ func (client DefaultSecurityRulesClient) GetResponder(resp *http.Response) (resu // List gets all default security rules in a network security group. // -// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network security -// group. +// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network +// security group. func (client DefaultSecurityRulesClient) List(ctx context.Context, resourceGroupName string, networkSecurityGroupName string) (result SecurityRuleListResultPage, err error) { result.fn = client.listNextResults req, err := client.ListPreparer(ctx, resourceGroupName, networkSecurityGroupName) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/expressroutecircuitauthorizations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/expressroutecircuitauthorizations.go index 607e3fb8a5ab..72d1bf6e5845 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/expressroutecircuitauthorizations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/expressroutecircuitauthorizations.go @@ -44,8 +44,8 @@ func NewExpressRouteCircuitAuthorizationsClientWithBaseURI(baseURI string, subsc // CreateOrUpdate creates or updates an authorization in the specified express route circuit. // // resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit. -// authorizationName is the name of the authorization. authorizationParameters is parameters supplied to the create or -// update express route circuit authorization operation. +// authorizationName is the name of the authorization. authorizationParameters is parameters supplied to the create +// or update express route circuit authorization operation. func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string, authorizationParameters ExpressRouteCircuitAuthorization) (result ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture, err error) { req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, circuitName, authorizationName, authorizationParameters) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/inboundnatrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/inboundnatrules.go index 78fc1d1ce65e..f582c18247ba 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/inboundnatrules.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/inboundnatrules.go @@ -62,7 +62,7 @@ func (client InboundNatRulesClient) CreateOrUpdate(ctx context.Context, resource }}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "network.InboundNatRulesClient", "CreateOrUpdate") + return result, validation.NewError("network.InboundNatRulesClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/interfaces.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/interfaces.go index 3e1529edb909..fc6eddebd2ff 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/interfaces.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/interfaces.go @@ -318,9 +318,10 @@ func (client InterfacesClient) GetEffectiveRouteTableResponder(resp *http.Respon // GetVirtualMachineScaleSetIPConfiguration get the specified network interface ip configuration in a virtual machine // scale set. // -// resourceGroupName is the name of the resource group. virtualMachineScaleSetName is the name of the virtual machine -// scale set. virtualmachineIndex is the virtual machine index. networkInterfaceName is the name of the network -// interface. IPConfigurationName is the name of the ip configuration. expand is expands referenced resources. +// resourceGroupName is the name of the resource group. virtualMachineScaleSetName is the name of the virtual +// machine scale set. virtualmachineIndex is the virtual machine index. networkInterfaceName is the name of the +// network interface. IPConfigurationName is the name of the ip configuration. expand is expands referenced +// resources. func (client InterfacesClient) GetVirtualMachineScaleSetIPConfiguration(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, IPConfigurationName string, expand string) (result InterfaceIPConfiguration, err error) { req, err := client.GetVirtualMachineScaleSetIPConfigurationPreparer(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, IPConfigurationName, expand) if err != nil { @@ -392,9 +393,9 @@ func (client InterfacesClient) GetVirtualMachineScaleSetIPConfigurationResponder // GetVirtualMachineScaleSetNetworkInterface get the specified network interface in a virtual machine scale set. // -// resourceGroupName is the name of the resource group. virtualMachineScaleSetName is the name of the virtual machine -// scale set. virtualmachineIndex is the virtual machine index. networkInterfaceName is the name of the network -// interface. expand is expands referenced resources. +// resourceGroupName is the name of the resource group. virtualMachineScaleSetName is the name of the virtual +// machine scale set. virtualmachineIndex is the virtual machine index. networkInterfaceName is the name of the +// network interface. expand is expands referenced resources. func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterface(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, expand string) (result Interface, err error) { req, err := client.GetVirtualMachineScaleSetNetworkInterfacePreparer(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand) if err != nil { @@ -717,9 +718,9 @@ func (client InterfacesClient) ListEffectiveNetworkSecurityGroupsResponder(resp // ListVirtualMachineScaleSetIPConfigurations get the specified network interface ip configuration in a virtual machine // scale set. // -// resourceGroupName is the name of the resource group. virtualMachineScaleSetName is the name of the virtual machine -// scale set. virtualmachineIndex is the virtual machine index. networkInterfaceName is the name of the network -// interface. expand is expands referenced resources. +// resourceGroupName is the name of the resource group. virtualMachineScaleSetName is the name of the virtual +// machine scale set. virtualmachineIndex is the virtual machine index. networkInterfaceName is the name of the +// network interface. expand is expands referenced resources. func (client InterfacesClient) ListVirtualMachineScaleSetIPConfigurations(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, expand string) (result InterfaceIPConfigurationListResultPage, err error) { result.fn = client.listVirtualMachineScaleSetIPConfigurationsNextResults req, err := client.ListVirtualMachineScaleSetIPConfigurationsPreparer(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand) @@ -818,8 +819,8 @@ func (client InterfacesClient) ListVirtualMachineScaleSetIPConfigurationsComplet // ListVirtualMachineScaleSetNetworkInterfaces gets all network interfaces in a virtual machine scale set. // -// resourceGroupName is the name of the resource group. virtualMachineScaleSetName is the name of the virtual machine -// scale set. +// resourceGroupName is the name of the resource group. virtualMachineScaleSetName is the name of the virtual +// machine scale set. func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfaces(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string) (result InterfaceListResultPage, err error) { result.fn = client.listVirtualMachineScaleSetNetworkInterfacesNextResults req, err := client.ListVirtualMachineScaleSetNetworkInterfacesPreparer(ctx, resourceGroupName, virtualMachineScaleSetName) @@ -914,8 +915,8 @@ func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesComple // ListVirtualMachineScaleSetVMNetworkInterfaces gets information about all network interfaces in a virtual machine in // a virtual machine scale set. // -// resourceGroupName is the name of the resource group. virtualMachineScaleSetName is the name of the virtual machine -// scale set. virtualmachineIndex is the virtual machine index. +// resourceGroupName is the name of the resource group. virtualMachineScaleSetName is the name of the virtual +// machine scale set. virtualmachineIndex is the virtual machine index. func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfaces(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string) (result InterfaceListResultPage, err error) { result.fn = client.listVirtualMachineScaleSetVMNetworkInterfacesNextResults req, err := client.ListVirtualMachineScaleSetVMNetworkInterfacesPreparer(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/loadbalancerprobes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/loadbalancerprobes.go index c7bbd9bfb350..ae7ba4ebdf00 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/loadbalancerprobes.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/loadbalancerprobes.go @@ -41,8 +41,8 @@ func NewLoadBalancerProbesClientWithBaseURI(baseURI string, subscriptionID strin // Get gets load balancer probe. // -// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. probeName is -// the name of the probe. +// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. +// probeName is the name of the probe. func (client LoadBalancerProbesClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, probeName string) (result Probe, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, loadBalancerName, probeName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/loadbalancers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/loadbalancers.go index 572ded9d0d56..abde569832dc 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/loadbalancers.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/loadbalancers.go @@ -41,8 +41,8 @@ func NewLoadBalancersClientWithBaseURI(baseURI string, subscriptionID string) Lo // CreateOrUpdate creates or updates a load balancer. // -// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. parameters -// is parameters supplied to the create or update load balancer operation. +// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. +// parameters is parameters supplied to the create or update load balancer operation. func (client LoadBalancersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters LoadBalancer) (result LoadBalancersCreateOrUpdateFuture, err error) { req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, loadBalancerName, parameters) if err != nil { @@ -179,8 +179,8 @@ func (client LoadBalancersClient) DeleteResponder(resp *http.Response) (result a // Get gets the specified load balancer. // -// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. expand is -// expands referenced resources. +// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. expand +// is expands referenced resources. func (client LoadBalancersClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, expand string) (result LoadBalancer, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, loadBalancerName, expand) if err != nil { @@ -432,8 +432,8 @@ func (client LoadBalancersClient) ListAllComplete(ctx context.Context) (result L // UpdateTags updates a load balancer tags. // -// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. parameters -// is parameters supplied to update load balancer tags. +// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. +// parameters is parameters supplied to update load balancer tags. func (client LoadBalancersClient) UpdateTags(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters TagsObject) (result LoadBalancersUpdateTagsFuture, err error) { req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, loadBalancerName, parameters) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/localnetworkgateways.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/localnetworkgateways.go index 9c97cf52d3f8..47afe0b3cb3c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/localnetworkgateways.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/localnetworkgateways.go @@ -50,7 +50,7 @@ func (client LocalNetworkGatewaysClient) CreateOrUpdate(ctx context.Context, res Constraints: []validation.Constraint{{Target: "localNetworkGatewayName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.LocalNetworkGatewayPropertiesFormat", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "network.LocalNetworkGatewaysClient", "CreateOrUpdate") + return result, validation.NewError("network.LocalNetworkGatewaysClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, localNetworkGatewayName, parameters) @@ -127,7 +127,7 @@ func (client LocalNetworkGatewaysClient) Delete(ctx context.Context, resourceGro if err := validation.Validate([]validation.Validation{ {TargetValue: localNetworkGatewayName, Constraints: []validation.Constraint{{Target: "localNetworkGatewayName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "network.LocalNetworkGatewaysClient", "Delete") + return result, validation.NewError("network.LocalNetworkGatewaysClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, localNetworkGatewayName) @@ -201,7 +201,7 @@ func (client LocalNetworkGatewaysClient) Get(ctx context.Context, resourceGroupN if err := validation.Validate([]validation.Validation{ {TargetValue: localNetworkGatewayName, Constraints: []validation.Constraint{{Target: "localNetworkGatewayName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "network.LocalNetworkGatewaysClient", "Get") + return result, validation.NewError("network.LocalNetworkGatewaysClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, localNetworkGatewayName) @@ -367,7 +367,7 @@ func (client LocalNetworkGatewaysClient) UpdateTags(ctx context.Context, resourc if err := validation.Validate([]validation.Validation{ {TargetValue: localNetworkGatewayName, Constraints: []validation.Constraint{{Target: "localNetworkGatewayName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "network.LocalNetworkGatewaysClient", "UpdateTags") + return result, validation.NewError("network.LocalNetworkGatewaysClient", "UpdateTags", err.Error()) } req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, localNetworkGatewayName, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/models.go index 58bd57171496..97120dcb7ac1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/models.go @@ -36,8 +36,8 @@ const ( Deny Access = "Deny" ) -// ApplicationGatewayBackendHealthServerHealth enumerates the values for application gateway backend health server -// health. +// ApplicationGatewayBackendHealthServerHealth enumerates the values for application gateway backend health +// server health. type ApplicationGatewayBackendHealthServerHealth string const ( @@ -111,7 +111,8 @@ const ( Temporary ApplicationGatewayRedirectType = "Temporary" ) -// ApplicationGatewayRequestRoutingRuleType enumerates the values for application gateway request routing rule type. +// ApplicationGatewayRequestRoutingRuleType enumerates the values for application gateway request routing rule +// type. type ApplicationGatewayRequestRoutingRuleType string const ( @@ -365,8 +366,8 @@ const ( UDP EffectiveSecurityRuleProtocol = "Udp" ) -// ExpressRouteCircuitPeeringAdvertisedPublicPrefixState enumerates the values for express route circuit peering -// advertised public prefix state. +// ExpressRouteCircuitPeeringAdvertisedPublicPrefixState enumerates the values for express route circuit +// peering advertised public prefix state. type ExpressRouteCircuitPeeringAdvertisedPublicPrefixState string const ( @@ -914,7 +915,8 @@ const ( RouteBased VpnType = "RouteBased" ) -// AddressSpace addressSpace contains an array of IP address ranges that can be used by subnets of the virtual network. +// AddressSpace addressSpace contains an array of IP address ranges that can be used by subnets of the virtual +// network. type AddressSpace struct { // AddressPrefixes - A list of address blocks reserved for this virtual network in CIDR notation. AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` @@ -922,7 +924,10 @@ type AddressSpace struct { // ApplicationGateway application gateway resource type ApplicationGateway struct { - autorest.Response `json:"-"` + autorest.Response `json:"-"` + *ApplicationGatewayPropertiesFormat `json:"properties,omitempty"` + // Etag - A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. @@ -932,89 +937,109 @@ type ApplicationGateway struct { // Location - Resource location. Location *string `json:"location,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - *ApplicationGatewayPropertiesFormat `json:"properties,omitempty"` - // Etag - A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for ApplicationGateway struct. -func (ag *ApplicationGateway) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for ApplicationGateway. +func (ag ApplicationGateway) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ag.ApplicationGatewayPropertiesFormat != nil { + objectMap["properties"] = ag.ApplicationGatewayPropertiesFormat } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ApplicationGatewayPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - ag.ApplicationGatewayPropertiesFormat = &properties + if ag.Etag != nil { + objectMap["etag"] = ag.Etag } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - ag.Etag = &etag + if ag.ID != nil { + objectMap["id"] = ag.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - ag.ID = &ID + if ag.Name != nil { + objectMap["name"] = ag.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - ag.Name = &name + if ag.Type != nil { + objectMap["type"] = ag.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - ag.Type = &typeVar + if ag.Location != nil { + objectMap["location"] = ag.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - ag.Location = &location + if ag.Tags != nil { + objectMap["tags"] = ag.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for ApplicationGateway struct. +func (ag *ApplicationGateway) 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 "properties": + if v != nil { + var applicationGatewayPropertiesFormat ApplicationGatewayPropertiesFormat + err = json.Unmarshal(*v, &applicationGatewayPropertiesFormat) + if err != nil { + return err + } + ag.ApplicationGatewayPropertiesFormat = &applicationGatewayPropertiesFormat + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + ag.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ag.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ag.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ag.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ag.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ag.Tags = tags + } } - ag.Tags = &tags } return nil @@ -1022,8 +1047,6 @@ func (ag *ApplicationGateway) UnmarshalJSON(body []byte) error { // ApplicationGatewayAuthenticationCertificate authentication certificates of an application gateway. type ApplicationGatewayAuthenticationCertificate struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` *ApplicationGatewayAuthenticationCertificatePropertiesFormat `json:"properties,omitempty"` // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` @@ -1031,6 +1054,8 @@ type ApplicationGatewayAuthenticationCertificate struct { Etag *string `json:"etag,omitempty"` // Type - Type of the resource. Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ApplicationGatewayAuthenticationCertificate struct. @@ -1040,63 +1065,61 @@ func (agac *ApplicationGatewayAuthenticationCertificate) UnmarshalJSON(body []by if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ApplicationGatewayAuthenticationCertificatePropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - agac.ApplicationGatewayAuthenticationCertificatePropertiesFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - agac.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - agac.Etag = &etag - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - agac.Type = &typeVar - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - agac.ID = &ID - } - - return nil -} - -// ApplicationGatewayAuthenticationCertificatePropertiesFormat authentication certificates properties of an application -// gateway. + for k, v := range m { + switch k { + case "properties": + if v != nil { + var applicationGatewayAuthenticationCertificatePropertiesFormat ApplicationGatewayAuthenticationCertificatePropertiesFormat + err = json.Unmarshal(*v, &applicationGatewayAuthenticationCertificatePropertiesFormat) + if err != nil { + return err + } + agac.ApplicationGatewayAuthenticationCertificatePropertiesFormat = &applicationGatewayAuthenticationCertificatePropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + agac.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + agac.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + agac.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + agac.ID = &ID + } + } + } + + return nil +} + +// ApplicationGatewayAuthenticationCertificatePropertiesFormat authentication certificates properties of an +// application gateway. type ApplicationGatewayAuthenticationCertificatePropertiesFormat struct { // Data - Certificate public data. Data *string `json:"data,omitempty"` @@ -1106,7 +1129,8 @@ type ApplicationGatewayAuthenticationCertificatePropertiesFormat struct { // ApplicationGatewayAvailableSslOptions response for ApplicationGatewayAvailableSslOptions API service call. type ApplicationGatewayAvailableSslOptions struct { - autorest.Response `json:"-"` + autorest.Response `json:"-"` + *ApplicationGatewayAvailableSslOptionsPropertiesFormat `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. @@ -1116,77 +1140,97 @@ type ApplicationGatewayAvailableSslOptions struct { // Location - Resource location. Location *string `json:"location,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - *ApplicationGatewayAvailableSslOptionsPropertiesFormat `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayAvailableSslOptions struct. -func (agaso *ApplicationGatewayAvailableSslOptions) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for ApplicationGatewayAvailableSslOptions. +func (agaso ApplicationGatewayAvailableSslOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agaso.ApplicationGatewayAvailableSslOptionsPropertiesFormat != nil { + objectMap["properties"] = agaso.ApplicationGatewayAvailableSslOptionsPropertiesFormat } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ApplicationGatewayAvailableSslOptionsPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - agaso.ApplicationGatewayAvailableSslOptionsPropertiesFormat = &properties + if agaso.ID != nil { + objectMap["id"] = agaso.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - agaso.ID = &ID + if agaso.Name != nil { + objectMap["name"] = agaso.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - agaso.Name = &name + if agaso.Type != nil { + objectMap["type"] = agaso.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - agaso.Type = &typeVar + if agaso.Location != nil { + objectMap["location"] = agaso.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - agaso.Location = &location + if agaso.Tags != nil { + objectMap["tags"] = agaso.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayAvailableSslOptions struct. +func (agaso *ApplicationGatewayAvailableSslOptions) 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 "properties": + if v != nil { + var applicationGatewayAvailableSslOptionsPropertiesFormat ApplicationGatewayAvailableSslOptionsPropertiesFormat + err = json.Unmarshal(*v, &applicationGatewayAvailableSslOptionsPropertiesFormat) + if err != nil { + return err + } + agaso.ApplicationGatewayAvailableSslOptionsPropertiesFormat = &applicationGatewayAvailableSslOptionsPropertiesFormat + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + agaso.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + agaso.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + agaso.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + agaso.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + agaso.Tags = tags + } } - agaso.Tags = &tags } return nil @@ -1309,7 +1353,8 @@ func (page ApplicationGatewayAvailableSslPredefinedPoliciesPage) Values() []Appl return *page.agaspp.Value } -// ApplicationGatewayAvailableWafRuleSetsResult response for ApplicationGatewayAvailableWafRuleSets API service call. +// ApplicationGatewayAvailableWafRuleSetsResult response for ApplicationGatewayAvailableWafRuleSets API service +// call. type ApplicationGatewayAvailableWafRuleSetsResult struct { autorest.Response `json:"-"` // Value - The list of application gateway rule sets. @@ -1326,8 +1371,6 @@ type ApplicationGatewayBackendAddress struct { // ApplicationGatewayBackendAddressPool backend Address Pool of an application gateway. type ApplicationGatewayBackendAddressPool struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` // Name - Resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` @@ -1335,6 +1378,8 @@ type ApplicationGatewayBackendAddressPool struct { Etag *string `json:"etag,omitempty"` // Type - Type of the resource. Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ApplicationGatewayBackendAddressPool struct. @@ -1344,62 +1389,61 @@ func (agbap *ApplicationGatewayBackendAddressPool) UnmarshalJSON(body []byte) er if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ApplicationGatewayBackendAddressPoolPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - agbap.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - agbap.Etag = &etag - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - agbap.Type = &typeVar - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - agbap.ID = &ID - } - - return nil -} - -// ApplicationGatewayBackendAddressPoolPropertiesFormat properties of Backend Address Pool of an application gateway. + for k, v := range m { + switch k { + case "properties": + if v != nil { + var applicationGatewayBackendAddressPoolPropertiesFormat ApplicationGatewayBackendAddressPoolPropertiesFormat + err = json.Unmarshal(*v, &applicationGatewayBackendAddressPoolPropertiesFormat) + if err != nil { + return err + } + agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat = &applicationGatewayBackendAddressPoolPropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + agbap.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + agbap.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + agbap.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + agbap.ID = &ID + } + } + } + + return nil +} + +// ApplicationGatewayBackendAddressPoolPropertiesFormat properties of Backend Address Pool of an application +// gateway. type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { // BackendIPConfigurations - Collection of references to IPs defined in network interfaces. BackendIPConfigurations *[]InterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` @@ -1443,8 +1487,6 @@ type ApplicationGatewayBackendHealthServer struct { // ApplicationGatewayBackendHTTPSettings backend address pool settings of an application gateway. type ApplicationGatewayBackendHTTPSettings struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` *ApplicationGatewayBackendHTTPSettingsPropertiesFormat `json:"properties,omitempty"` // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` @@ -1452,6 +1494,8 @@ type ApplicationGatewayBackendHTTPSettings struct { Etag *string `json:"etag,omitempty"` // Type - Type of the resource. Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ApplicationGatewayBackendHTTPSettings struct. @@ -1461,63 +1505,61 @@ func (agbhs *ApplicationGatewayBackendHTTPSettings) UnmarshalJSON(body []byte) e if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ApplicationGatewayBackendHTTPSettingsPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - agbhs.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - agbhs.Etag = &etag - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - agbhs.Type = &typeVar - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - agbhs.ID = &ID - } - - return nil -} - -// ApplicationGatewayBackendHTTPSettingsPropertiesFormat properties of Backend address pool settings of an application -// gateway. + for k, v := range m { + switch k { + case "properties": + if v != nil { + var applicationGatewayBackendHTTPSettingsPropertiesFormat ApplicationGatewayBackendHTTPSettingsPropertiesFormat + err = json.Unmarshal(*v, &applicationGatewayBackendHTTPSettingsPropertiesFormat) + if err != nil { + return err + } + agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat = &applicationGatewayBackendHTTPSettingsPropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + agbhs.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + agbhs.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + agbhs.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + agbhs.ID = &ID + } + } + } + + return nil +} + +// ApplicationGatewayBackendHTTPSettingsPropertiesFormat properties of Backend address pool settings of an +// application gateway. type ApplicationGatewayBackendHTTPSettingsPropertiesFormat struct { // Port - Port Port *int32 `json:"port,omitempty"` @@ -1547,8 +1589,8 @@ type ApplicationGatewayBackendHTTPSettingsPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// ApplicationGatewayConnectionDraining connection draining allows open connections to a backend server to be active -// for a specified time after the backend server got removed from the configuration. +// ApplicationGatewayConnectionDraining connection draining allows open connections to a backend server to be +// active for a specified time after the backend server got removed from the configuration. type ApplicationGatewayConnectionDraining struct { // Enabled - Whether connection draining is enabled or not. Enabled *bool `json:"enabled,omitempty"` @@ -1584,6 +1626,7 @@ type ApplicationGatewayFirewallRuleGroup struct { // ApplicationGatewayFirewallRuleSet a web application firewall rule set. type ApplicationGatewayFirewallRuleSet struct { + *ApplicationGatewayFirewallRuleSetPropertiesFormat `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. @@ -1593,77 +1636,97 @@ type ApplicationGatewayFirewallRuleSet struct { // Location - Resource location. Location *string `json:"location,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - *ApplicationGatewayFirewallRuleSetPropertiesFormat `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayFirewallRuleSet struct. -func (agfrs *ApplicationGatewayFirewallRuleSet) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for ApplicationGatewayFirewallRuleSet. +func (agfrs ApplicationGatewayFirewallRuleSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agfrs.ApplicationGatewayFirewallRuleSetPropertiesFormat != nil { + objectMap["properties"] = agfrs.ApplicationGatewayFirewallRuleSetPropertiesFormat } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ApplicationGatewayFirewallRuleSetPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - agfrs.ApplicationGatewayFirewallRuleSetPropertiesFormat = &properties + if agfrs.ID != nil { + objectMap["id"] = agfrs.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - agfrs.ID = &ID + if agfrs.Name != nil { + objectMap["name"] = agfrs.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - agfrs.Name = &name + if agfrs.Type != nil { + objectMap["type"] = agfrs.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - agfrs.Type = &typeVar + if agfrs.Location != nil { + objectMap["location"] = agfrs.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - agfrs.Location = &location + if agfrs.Tags != nil { + objectMap["tags"] = agfrs.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayFirewallRuleSet struct. +func (agfrs *ApplicationGatewayFirewallRuleSet) 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 "properties": + if v != nil { + var applicationGatewayFirewallRuleSetPropertiesFormat ApplicationGatewayFirewallRuleSetPropertiesFormat + err = json.Unmarshal(*v, &applicationGatewayFirewallRuleSetPropertiesFormat) + if err != nil { + return err + } + agfrs.ApplicationGatewayFirewallRuleSetPropertiesFormat = &applicationGatewayFirewallRuleSetPropertiesFormat + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + agfrs.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + agfrs.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + agfrs.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + agfrs.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + agfrs.Tags = tags + } } - agfrs.Tags = &tags } return nil @@ -1683,8 +1746,6 @@ type ApplicationGatewayFirewallRuleSetPropertiesFormat struct { // ApplicationGatewayFrontendIPConfiguration frontend IP configuration of an application gateway. type ApplicationGatewayFrontendIPConfiguration struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` *ApplicationGatewayFrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` @@ -1692,6 +1753,8 @@ type ApplicationGatewayFrontendIPConfiguration struct { Etag *string `json:"etag,omitempty"` // Type - Type of the resource. Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ApplicationGatewayFrontendIPConfiguration struct. @@ -1701,63 +1764,61 @@ func (agfic *ApplicationGatewayFrontendIPConfiguration) UnmarshalJSON(body []byt if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ApplicationGatewayFrontendIPConfigurationPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - agfic.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - agfic.Etag = &etag - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - agfic.Type = &typeVar - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - agfic.ID = &ID - } - - return nil -} - -// ApplicationGatewayFrontendIPConfigurationPropertiesFormat properties of Frontend IP configuration of an application -// gateway. + for k, v := range m { + switch k { + case "properties": + if v != nil { + var applicationGatewayFrontendIPConfigurationPropertiesFormat ApplicationGatewayFrontendIPConfigurationPropertiesFormat + err = json.Unmarshal(*v, &applicationGatewayFrontendIPConfigurationPropertiesFormat) + if err != nil { + return err + } + agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat = &applicationGatewayFrontendIPConfigurationPropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + agfic.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + agfic.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + agfic.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + agfic.ID = &ID + } + } + } + + return nil +} + +// ApplicationGatewayFrontendIPConfigurationPropertiesFormat properties of Frontend IP configuration of an +// application gateway. type ApplicationGatewayFrontendIPConfigurationPropertiesFormat struct { // PrivateIPAddress - PrivateIPAddress of the network interface IP Configuration. PrivateIPAddress *string `json:"privateIPAddress,omitempty"` @@ -1773,8 +1834,6 @@ type ApplicationGatewayFrontendIPConfigurationPropertiesFormat struct { // ApplicationGatewayFrontendPort frontend port of an application gateway. type ApplicationGatewayFrontendPort struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` *ApplicationGatewayFrontendPortPropertiesFormat `json:"properties,omitempty"` // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` @@ -1782,6 +1841,8 @@ type ApplicationGatewayFrontendPort struct { Etag *string `json:"etag,omitempty"` // Type - Type of the resource. Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ApplicationGatewayFrontendPort struct. @@ -1791,56 +1852,54 @@ func (agfp *ApplicationGatewayFrontendPort) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ApplicationGatewayFrontendPortPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - agfp.ApplicationGatewayFrontendPortPropertiesFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - agfp.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - agfp.Etag = &etag - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var applicationGatewayFrontendPortPropertiesFormat ApplicationGatewayFrontendPortPropertiesFormat + err = json.Unmarshal(*v, &applicationGatewayFrontendPortPropertiesFormat) + if err != nil { + return err + } + agfp.ApplicationGatewayFrontendPortPropertiesFormat = &applicationGatewayFrontendPortPropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + agfp.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + agfp.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + agfp.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + agfp.ID = &ID + } } - agfp.Type = &typeVar - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - agfp.ID = &ID } return nil @@ -1856,8 +1915,6 @@ type ApplicationGatewayFrontendPortPropertiesFormat struct { // ApplicationGatewayHTTPListener http listener of an application gateway. type ApplicationGatewayHTTPListener struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` *ApplicationGatewayHTTPListenerPropertiesFormat `json:"properties,omitempty"` // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` @@ -1865,6 +1922,8 @@ type ApplicationGatewayHTTPListener struct { Etag *string `json:"etag,omitempty"` // Type - Type of the resource. Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ApplicationGatewayHTTPListener struct. @@ -1874,56 +1933,54 @@ func (aghl *ApplicationGatewayHTTPListener) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ApplicationGatewayHTTPListenerPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - aghl.ApplicationGatewayHTTPListenerPropertiesFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - aghl.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - aghl.Etag = &etag - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var applicationGatewayHTTPListenerPropertiesFormat ApplicationGatewayHTTPListenerPropertiesFormat + err = json.Unmarshal(*v, &applicationGatewayHTTPListenerPropertiesFormat) + if err != nil { + return err + } + aghl.ApplicationGatewayHTTPListenerPropertiesFormat = &applicationGatewayHTTPListenerPropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + aghl.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + aghl.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + aghl.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + aghl.ID = &ID + } } - aghl.Type = &typeVar - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - aghl.ID = &ID } return nil @@ -1947,11 +2004,9 @@ type ApplicationGatewayHTTPListenerPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// ApplicationGatewayIPConfiguration IP configuration of an application gateway. Currently 1 public and 1 private IP -// configuration is allowed. +// ApplicationGatewayIPConfiguration IP configuration of an application gateway. Currently 1 public and 1 private +// IP configuration is allowed. type ApplicationGatewayIPConfiguration struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` @@ -1959,6 +2014,8 @@ type ApplicationGatewayIPConfiguration struct { Etag *string `json:"etag,omitempty"` // Type - Type of the resource. Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ApplicationGatewayIPConfiguration struct. @@ -1968,56 +2025,54 @@ func (agic *ApplicationGatewayIPConfiguration) UnmarshalJSON(body []byte) error if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ApplicationGatewayIPConfigurationPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var applicationGatewayIPConfigurationPropertiesFormat ApplicationGatewayIPConfigurationPropertiesFormat + err = json.Unmarshal(*v, &applicationGatewayIPConfigurationPropertiesFormat) + if err != nil { + return err + } + agic.ApplicationGatewayIPConfigurationPropertiesFormat = &applicationGatewayIPConfigurationPropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + agic.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + agic.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + agic.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + agic.ID = &ID + } } - agic.ApplicationGatewayIPConfigurationPropertiesFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - agic.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - agic.Etag = &etag - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - agic.Type = &typeVar - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - agic.ID = &ID } return nil @@ -2135,8 +2190,6 @@ func (page ApplicationGatewayListResultPage) Values() []ApplicationGateway { // ApplicationGatewayPathRule path rule of URL path map of an application gateway. type ApplicationGatewayPathRule struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` *ApplicationGatewayPathRulePropertiesFormat `json:"properties,omitempty"` // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` @@ -2144,6 +2197,8 @@ type ApplicationGatewayPathRule struct { Etag *string `json:"etag,omitempty"` // Type - Type of the resource. Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ApplicationGatewayPathRule struct. @@ -2153,56 +2208,54 @@ func (agpr *ApplicationGatewayPathRule) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ApplicationGatewayPathRulePropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - agpr.ApplicationGatewayPathRulePropertiesFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - agpr.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var applicationGatewayPathRulePropertiesFormat ApplicationGatewayPathRulePropertiesFormat + err = json.Unmarshal(*v, &applicationGatewayPathRulePropertiesFormat) + if err != nil { + return err + } + agpr.ApplicationGatewayPathRulePropertiesFormat = &applicationGatewayPathRulePropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + agpr.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + agpr.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + agpr.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + agpr.ID = &ID + } } - agpr.Etag = &etag - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - agpr.Type = &typeVar - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - agpr.ID = &ID } return nil @@ -2224,8 +2277,6 @@ type ApplicationGatewayPathRulePropertiesFormat struct { // ApplicationGatewayProbe probe of the application gateway. type ApplicationGatewayProbe struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` *ApplicationGatewayProbePropertiesFormat `json:"properties,omitempty"` // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` @@ -2233,6 +2284,8 @@ type ApplicationGatewayProbe struct { Etag *string `json:"etag,omitempty"` // Type - Type of the resource. Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ApplicationGatewayProbe struct. @@ -2242,56 +2295,54 @@ func (agp *ApplicationGatewayProbe) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ApplicationGatewayProbePropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - agp.ApplicationGatewayProbePropertiesFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - agp.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - agp.Etag = &etag - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - agp.Type = &typeVar - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var applicationGatewayProbePropertiesFormat ApplicationGatewayProbePropertiesFormat + err = json.Unmarshal(*v, &applicationGatewayProbePropertiesFormat) + if err != nil { + return err + } + agp.ApplicationGatewayProbePropertiesFormat = &applicationGatewayProbePropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + agp.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + agp.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + agp.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + agp.ID = &ID + } } - agp.ID = &ID } return nil @@ -2371,8 +2422,6 @@ type ApplicationGatewayPropertiesFormat struct { // ApplicationGatewayRedirectConfiguration redirect configuration of an application gateway. type ApplicationGatewayRedirectConfiguration struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` *ApplicationGatewayRedirectConfigurationPropertiesFormat `json:"properties,omitempty"` // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` @@ -2380,6 +2429,8 @@ type ApplicationGatewayRedirectConfiguration struct { Etag *string `json:"etag,omitempty"` // Type - Type of the resource. Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ApplicationGatewayRedirectConfiguration struct. @@ -2389,56 +2440,54 @@ func (agrc *ApplicationGatewayRedirectConfiguration) UnmarshalJSON(body []byte) if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ApplicationGatewayRedirectConfigurationPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - agrc.ApplicationGatewayRedirectConfigurationPropertiesFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - agrc.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - agrc.Etag = &etag - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var applicationGatewayRedirectConfigurationPropertiesFormat ApplicationGatewayRedirectConfigurationPropertiesFormat + err = json.Unmarshal(*v, &applicationGatewayRedirectConfigurationPropertiesFormat) + if err != nil { + return err + } + agrc.ApplicationGatewayRedirectConfigurationPropertiesFormat = &applicationGatewayRedirectConfigurationPropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + agrc.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + agrc.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + agrc.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + agrc.ID = &ID + } } - agrc.Type = &typeVar - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - agrc.ID = &ID } return nil @@ -2467,8 +2516,6 @@ type ApplicationGatewayRedirectConfigurationPropertiesFormat struct { // ApplicationGatewayRequestRoutingRule request routing rule of an application gateway. type ApplicationGatewayRequestRoutingRule struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` *ApplicationGatewayRequestRoutingRulePropertiesFormat `json:"properties,omitempty"` // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` @@ -2476,6 +2523,8 @@ type ApplicationGatewayRequestRoutingRule struct { Etag *string `json:"etag,omitempty"` // Type - Type of the resource. Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ApplicationGatewayRequestRoutingRule struct. @@ -2485,62 +2534,61 @@ func (agrrr *ApplicationGatewayRequestRoutingRule) UnmarshalJSON(body []byte) er if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ApplicationGatewayRequestRoutingRulePropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - agrrr.ApplicationGatewayRequestRoutingRulePropertiesFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - agrrr.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - agrrr.Etag = &etag - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - agrrr.Type = &typeVar - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - agrrr.ID = &ID - } - - return nil -} - -// ApplicationGatewayRequestRoutingRulePropertiesFormat properties of request routing rule of the application gateway. + for k, v := range m { + switch k { + case "properties": + if v != nil { + var applicationGatewayRequestRoutingRulePropertiesFormat ApplicationGatewayRequestRoutingRulePropertiesFormat + err = json.Unmarshal(*v, &applicationGatewayRequestRoutingRulePropertiesFormat) + if err != nil { + return err + } + agrrr.ApplicationGatewayRequestRoutingRulePropertiesFormat = &applicationGatewayRequestRoutingRulePropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + agrrr.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + agrrr.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + agrrr.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + agrrr.ID = &ID + } + } + } + + return nil +} + +// ApplicationGatewayRequestRoutingRulePropertiesFormat properties of request routing rule of the application +// gateway. type ApplicationGatewayRequestRoutingRulePropertiesFormat struct { // RuleType - Rule type. Possible values include: 'Basic', 'PathBasedRouting' RuleType ApplicationGatewayRequestRoutingRuleType `json:"ruleType,omitempty"` @@ -2558,8 +2606,8 @@ type ApplicationGatewayRequestRoutingRulePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// ApplicationGatewaysBackendHealthFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// ApplicationGatewaysBackendHealthFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type ApplicationGatewaysBackendHealthFuture struct { azure.Future req *http.Request @@ -2571,27 +2619,44 @@ func (future ApplicationGatewaysBackendHealthFuture) Result(client ApplicationGa var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysBackendHealthFuture", "Result", future.Response(), "Polling failure") return } if !done { - return agbh, autorest.NewError("network.ApplicationGatewaysBackendHealthFuture", "Result", "asynchronous operation has not completed") + return agbh, azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysBackendHealthFuture") } if future.PollingMethod() == azure.PollingLocation { agbh, err = client.BackendHealthResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysBackendHealthFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysBackendHealthFuture", "Result", resp, "Failure sending request") return } agbh, err = client.BackendHealthResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysBackendHealthFuture", "Result", resp, "Failure responding to request") + } return } -// ApplicationGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// ApplicationGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type ApplicationGatewaysCreateOrUpdateFuture struct { azure.Future req *http.Request @@ -2603,22 +2668,39 @@ func (future ApplicationGatewaysCreateOrUpdateFuture) Result(client ApplicationG var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ag, autorest.NewError("network.ApplicationGatewaysCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return ag, azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { ag, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } ag, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -2635,22 +2717,39 @@ func (future ApplicationGatewaysDeleteFuture) Result(client ApplicationGatewaysC var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("network.ApplicationGatewaysDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -2666,8 +2765,6 @@ type ApplicationGatewaySku struct { // ApplicationGatewaySslCertificate SSL certificates of an application gateway. type ApplicationGatewaySslCertificate struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` *ApplicationGatewaySslCertificatePropertiesFormat `json:"properties,omitempty"` // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` @@ -2675,6 +2772,8 @@ type ApplicationGatewaySslCertificate struct { Etag *string `json:"etag,omitempty"` // Type - Type of the resource. Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ApplicationGatewaySslCertificate struct. @@ -2684,56 +2783,54 @@ func (agsc *ApplicationGatewaySslCertificate) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ApplicationGatewaySslCertificatePropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - agsc.ApplicationGatewaySslCertificatePropertiesFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - agsc.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - agsc.Etag = &etag - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - agsc.Type = &typeVar - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var applicationGatewaySslCertificatePropertiesFormat ApplicationGatewaySslCertificatePropertiesFormat + err = json.Unmarshal(*v, &applicationGatewaySslCertificatePropertiesFormat) + if err != nil { + return err + } + agsc.ApplicationGatewaySslCertificatePropertiesFormat = &applicationGatewaySslCertificatePropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + agsc.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + agsc.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + agsc.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + agsc.ID = &ID + } } - agsc.ID = &ID } return nil @@ -2768,11 +2865,11 @@ type ApplicationGatewaySslPolicy struct { // ApplicationGatewaySslPredefinedPolicy an Ssl predefined policy type ApplicationGatewaySslPredefinedPolicy struct { autorest.Response `json:"-"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` // Name - Name of Ssl predefined policy. Name *string `json:"name,omitempty"` *ApplicationGatewaySslPredefinedPolicyPropertiesFormat `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ApplicationGatewaySslPredefinedPolicy struct. @@ -2782,36 +2879,36 @@ func (agspp *ApplicationGatewaySslPredefinedPolicy) UnmarshalJSON(body []byte) e if err != nil { return err } - var v *json.RawMessage - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - 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 + } + agspp.Name = &name + } + case "properties": + if v != nil { + var applicationGatewaySslPredefinedPolicyPropertiesFormat ApplicationGatewaySslPredefinedPolicyPropertiesFormat + err = json.Unmarshal(*v, &applicationGatewaySslPredefinedPolicyPropertiesFormat) + if err != nil { + return err + } + agspp.ApplicationGatewaySslPredefinedPolicyPropertiesFormat = &applicationGatewaySslPredefinedPolicyPropertiesFormat + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + agspp.ID = &ID + } } - agspp.Name = &name - } - - v = m["properties"] - if v != nil { - var properties ApplicationGatewaySslPredefinedPolicyPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - agspp.ApplicationGatewaySslPredefinedPolicyPropertiesFormat = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - agspp.ID = &ID } return nil @@ -2825,7 +2922,8 @@ type ApplicationGatewaySslPredefinedPolicyPropertiesFormat struct { MinProtocolVersion ApplicationGatewaySslProtocol `json:"minProtocolVersion,omitempty"` } -// ApplicationGatewaysStartFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// ApplicationGatewaysStartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type ApplicationGatewaysStartFuture struct { azure.Future req *http.Request @@ -2837,26 +2935,44 @@ func (future ApplicationGatewaysStartFuture) Result(client ApplicationGatewaysCl var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysStartFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("network.ApplicationGatewaysStartFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysStartFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.StartResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysStartFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysStartFuture", "Result", resp, "Failure sending request") return } ar, err = client.StartResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysStartFuture", "Result", resp, "Failure responding to request") + } return } -// ApplicationGatewaysStopFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// ApplicationGatewaysStopFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type ApplicationGatewaysStopFuture struct { azure.Future req *http.Request @@ -2868,22 +2984,39 @@ func (future ApplicationGatewaysStopFuture) Result(client ApplicationGatewaysCli var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysStopFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("network.ApplicationGatewaysStopFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysStopFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.StopResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysStopFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysStopFuture", "Result", resp, "Failure sending request") return } ar, err = client.StopResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysStopFuture", "Result", resp, "Failure responding to request") + } return } @@ -2900,29 +3033,45 @@ func (future ApplicationGatewaysUpdateTagsFuture) Result(client ApplicationGatew var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysUpdateTagsFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ag, autorest.NewError("network.ApplicationGatewaysUpdateTagsFuture", "Result", "asynchronous operation has not completed") + return ag, azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysUpdateTagsFuture") } if future.PollingMethod() == azure.PollingLocation { ag, err = client.UpdateTagsResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysUpdateTagsFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysUpdateTagsFuture", "Result", resp, "Failure sending request") return } ag, err = client.UpdateTagsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysUpdateTagsFuture", "Result", resp, "Failure responding to request") + } return } -// ApplicationGatewayURLPathMap urlPathMaps give a url path to the backend mapping information for PathBasedRouting. +// ApplicationGatewayURLPathMap urlPathMaps give a url path to the backend mapping information for +// PathBasedRouting. type ApplicationGatewayURLPathMap struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` *ApplicationGatewayURLPathMapPropertiesFormat `json:"properties,omitempty"` // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` @@ -2930,6 +3079,8 @@ type ApplicationGatewayURLPathMap struct { Etag *string `json:"etag,omitempty"` // Type - Type of the resource. Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ApplicationGatewayURLPathMap struct. @@ -2939,56 +3090,54 @@ func (agupm *ApplicationGatewayURLPathMap) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ApplicationGatewayURLPathMapPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - agupm.ApplicationGatewayURLPathMapPropertiesFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - agupm.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - agupm.Etag = &etag - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - agupm.Type = &typeVar - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var applicationGatewayURLPathMapPropertiesFormat ApplicationGatewayURLPathMapPropertiesFormat + err = json.Unmarshal(*v, &applicationGatewayURLPathMapPropertiesFormat) + if err != nil { + return err + } + agupm.ApplicationGatewayURLPathMapPropertiesFormat = &applicationGatewayURLPathMapPropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + agupm.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + agupm.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + agupm.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + agupm.ID = &ID + } } - agupm.ID = &ID } return nil @@ -3008,7 +3157,8 @@ type ApplicationGatewayURLPathMapPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// ApplicationGatewayWebApplicationFirewallConfiguration application gateway web application firewall configuration. +// ApplicationGatewayWebApplicationFirewallConfiguration application gateway web application firewall +// configuration. type ApplicationGatewayWebApplicationFirewallConfiguration struct { // Enabled - Whether the web application firewall is enabled or not. Enabled *bool `json:"enabled,omitempty"` @@ -3025,6 +3175,10 @@ type ApplicationGatewayWebApplicationFirewallConfiguration struct { // ApplicationSecurityGroup an application security group in a resource group. type ApplicationSecurityGroup struct { autorest.Response `json:"-"` + // ApplicationSecurityGroupPropertiesFormat - Properties of the application security group. + *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` + // Etag - A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. @@ -3033,91 +3187,110 @@ type ApplicationSecurityGroup struct { Type *string `json:"type,omitempty"` // Location - Resource location. Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // ApplicationSecurityGroupPropertiesFormat - Properties of the application security group. - *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - // Etag - A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for ApplicationSecurityGroup struct. -func (asg *ApplicationSecurityGroup) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for ApplicationSecurityGroup. +func (asg ApplicationSecurityGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asg.ApplicationSecurityGroupPropertiesFormat != nil { + objectMap["properties"] = asg.ApplicationSecurityGroupPropertiesFormat } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ApplicationSecurityGroupPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - asg.ApplicationSecurityGroupPropertiesFormat = &properties + if asg.Etag != nil { + objectMap["etag"] = asg.Etag } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - asg.Etag = &etag + if asg.ID != nil { + objectMap["id"] = asg.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - asg.ID = &ID + if asg.Name != nil { + objectMap["name"] = asg.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - asg.Name = &name + if asg.Type != nil { + objectMap["type"] = asg.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - asg.Type = &typeVar + if asg.Location != nil { + objectMap["location"] = asg.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - asg.Location = &location + if asg.Tags != nil { + objectMap["tags"] = asg.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for ApplicationSecurityGroup struct. +func (asg *ApplicationSecurityGroup) 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 "properties": + if v != nil { + var applicationSecurityGroupPropertiesFormat ApplicationSecurityGroupPropertiesFormat + err = json.Unmarshal(*v, &applicationSecurityGroupPropertiesFormat) + if err != nil { + return err + } + asg.ApplicationSecurityGroupPropertiesFormat = &applicationSecurityGroupPropertiesFormat + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + asg.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + asg.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + asg.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + asg.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + asg.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + asg.Tags = tags + } } - asg.Tags = &tags } return nil @@ -3132,7 +3305,8 @@ type ApplicationSecurityGroupListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// ApplicationSecurityGroupListResultIterator provides access to a complete listing of ApplicationSecurityGroup values. +// ApplicationSecurityGroupListResultIterator provides access to a complete listing of ApplicationSecurityGroup +// values. type ApplicationSecurityGroupListResultIterator struct { i int page ApplicationSecurityGroupListResultPage @@ -3246,22 +3420,39 @@ func (future ApplicationSecurityGroupsCreateOrUpdateFuture) Result(client Applic var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return asg, autorest.NewError("network.ApplicationSecurityGroupsCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return asg, azure.NewAsyncOpIncompleteError("network.ApplicationSecurityGroupsCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { asg, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } asg, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -3278,27 +3469,44 @@ func (future ApplicationSecurityGroupsDeleteFuture) Result(client ApplicationSec var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("network.ApplicationSecurityGroupsDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("network.ApplicationSecurityGroupsDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsDeleteFuture", "Result", resp, "Failure responding to request") + } return } -// AuthorizationListResult response for ListAuthorizations API service call retrieves all authorizations that belongs -// to an ExpressRouteCircuit. +// AuthorizationListResult response for ListAuthorizations API service call retrieves all authorizations that +// belongs to an ExpressRouteCircuit. type AuthorizationListResult struct { autorest.Response `json:"-"` // Value - The authorizations in an ExpressRoute Circuit. @@ -3307,7 +3515,8 @@ type AuthorizationListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// AuthorizationListResultIterator provides access to a complete listing of ExpressRouteCircuitAuthorization values. +// AuthorizationListResultIterator provides access to a complete listing of ExpressRouteCircuitAuthorization +// values. type AuthorizationListResultIterator struct { i int page AuthorizationListResultPage @@ -3467,11 +3676,12 @@ type AvailableProvidersListState struct { Cities *[]AvailableProvidersListCity `json:"cities,omitempty"` } -// AzureAsyncOperationResult the response body contains the status of the specified asynchronous operation, indicating -// whether it has succeeded, is in progress, or has failed. Note that this status is distinct from the HTTP status code -// returned for the Get Operation Status operation itself. If the asynchronous operation succeeded, the response body -// includes the HTTP status code for the successful request. If the asynchronous operation failed, the response body -// includes the HTTP status code for the failed request and error information regarding the failure. +// AzureAsyncOperationResult the response body contains the status of the specified asynchronous operation, +// indicating whether it has succeeded, is in progress, or has failed. Note that this status is distinct from the +// HTTP status code returned for the Get Operation Status operation itself. If the asynchronous operation +// succeeded, the response body includes the HTTP status code for the successful request. If the asynchronous +// operation failed, the response body includes the HTTP status code for the failed request and error information +// regarding the failure. type AzureAsyncOperationResult struct { // Status - Status of the Azure async operation. Possible values are: 'InProgress', 'Succeeded', and 'Failed'. Possible values include: 'InProgress', 'Succeeded', 'Failed' Status OperationStatus `json:"status,omitempty"` @@ -3532,14 +3742,14 @@ type AzureReachabilityReportParameters struct { // BackendAddressPool pool of backend IP addresses. type BackendAddressPool struct { autorest.Response `json:"-"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` // BackendAddressPoolPropertiesFormat - Properties of load balancer backend address pool. *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` // Etag - A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for BackendAddressPool struct. @@ -3549,46 +3759,45 @@ func (bap *BackendAddressPool) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties BackendAddressPoolPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - bap.BackendAddressPoolPropertiesFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - bap.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - bap.Etag = &etag - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var backendAddressPoolPropertiesFormat BackendAddressPoolPropertiesFormat + err = json.Unmarshal(*v, &backendAddressPoolPropertiesFormat) + if err != nil { + return err + } + bap.BackendAddressPoolPropertiesFormat = &backendAddressPoolPropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + bap.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + bap.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + bap.ID = &ID + } } - bap.ID = &ID } return nil @@ -3651,6 +3860,7 @@ type BgpPeerStatusListResult struct { // BgpServiceCommunity service Community Properties. type BgpServiceCommunity struct { + *BgpServiceCommunityPropertiesFormat `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. @@ -3660,77 +3870,97 @@ type BgpServiceCommunity struct { // Location - Resource location. Location *string `json:"location,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - *BgpServiceCommunityPropertiesFormat `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for BgpServiceCommunity struct. -func (bsc *BgpServiceCommunity) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for BgpServiceCommunity. +func (bsc BgpServiceCommunity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if bsc.BgpServiceCommunityPropertiesFormat != nil { + objectMap["properties"] = bsc.BgpServiceCommunityPropertiesFormat } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties BgpServiceCommunityPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - bsc.BgpServiceCommunityPropertiesFormat = &properties + if bsc.ID != nil { + objectMap["id"] = bsc.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - bsc.ID = &ID + if bsc.Name != nil { + objectMap["name"] = bsc.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - bsc.Name = &name + if bsc.Type != nil { + objectMap["type"] = bsc.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - bsc.Type = &typeVar + if bsc.Location != nil { + objectMap["location"] = bsc.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - bsc.Location = &location + if bsc.Tags != nil { + objectMap["tags"] = bsc.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for BgpServiceCommunity struct. +func (bsc *BgpServiceCommunity) 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 "properties": + if v != nil { + var bgpServiceCommunityPropertiesFormat BgpServiceCommunityPropertiesFormat + err = json.Unmarshal(*v, &bgpServiceCommunityPropertiesFormat) + if err != nil { + return err + } + bsc.BgpServiceCommunityPropertiesFormat = &bgpServiceCommunityPropertiesFormat + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + bsc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + bsc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + bsc.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + bsc.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + bsc.Tags = tags + } } - bsc.Tags = &tags } return nil @@ -3941,8 +4171,8 @@ type ConnectivitySource struct { Port *int32 `json:"port,omitempty"` } -// DhcpOptions dhcpOptions contains an array of DNS servers available to VMs deployed in the virtual network. Standard -// DHCP option for a subnet overrides VNET DHCP options. +// DhcpOptions dhcpOptions contains an array of DNS servers available to VMs deployed in the virtual network. +// Standard DHCP option for a subnet overrides VNET DHCP options. type DhcpOptions struct { // DNSServers - The list of DNS servers IP addresses. DNSServers *[]string `json:"dnsServers,omitempty"` @@ -3974,7 +4204,25 @@ type EffectiveNetworkSecurityGroup struct { // EffectiveSecurityRules - A collection of effective security rules. EffectiveSecurityRules *[]EffectiveNetworkSecurityRule `json:"effectiveSecurityRules,omitempty"` // TagMap - Mapping of tags to list of IP Addresses included within the tag. - TagMap *map[string][]string `json:"tagMap,omitempty"` + TagMap map[string][]string `json:"tagMap"` +} + +// MarshalJSON is the custom marshaler for EffectiveNetworkSecurityGroup. +func (ensg EffectiveNetworkSecurityGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ensg.NetworkSecurityGroup != nil { + objectMap["networkSecurityGroup"] = ensg.NetworkSecurityGroup + } + if ensg.Association != nil { + objectMap["association"] = ensg.Association + } + if ensg.EffectiveSecurityRules != nil { + objectMap["effectiveSecurityRules"] = ensg.EffectiveSecurityRules + } + if ensg.TagMap != nil { + objectMap["tagMap"] = ensg.TagMap + } + return json.Marshal(objectMap) } // EffectiveNetworkSecurityGroupAssociation the effective network security group association. @@ -4055,12 +4303,12 @@ type EffectiveRouteListResult struct { // EndpointServiceResult endpoint service. type EndpointServiceResult struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` // Name - Name of the endpoint service. Name *string `json:"name,omitempty"` // Type - Type of the endpoint service. Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // EndpointServicesListResult response for the ListAvailableEndpointServices API service call. @@ -4184,6 +4432,11 @@ type ErrorDetails struct { // ExpressRouteCircuit expressRouteCircuit resource type ExpressRouteCircuit struct { autorest.Response `json:"-"` + // Sku - The SKU. + Sku *ExpressRouteCircuitSku `json:"sku,omitempty"` + *ExpressRouteCircuitPropertiesFormat `json:"properties,omitempty"` + // Etag - Gets a unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. @@ -4193,101 +4446,121 @@ type ExpressRouteCircuit struct { // Location - Resource location. Location *string `json:"location,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // Sku - The SKU. - Sku *ExpressRouteCircuitSku `json:"sku,omitempty"` - *ExpressRouteCircuitPropertiesFormat `json:"properties,omitempty"` - // Etag - Gets a unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for ExpressRouteCircuit struct. -func (erc *ExpressRouteCircuit) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for ExpressRouteCircuit. +func (erc ExpressRouteCircuit) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if erc.Sku != nil { + objectMap["sku"] = erc.Sku } - var v *json.RawMessage - - v = m["sku"] - if v != nil { - var sku ExpressRouteCircuitSku - err = json.Unmarshal(*m["sku"], &sku) - if err != nil { - return err - } - erc.Sku = &sku + if erc.ExpressRouteCircuitPropertiesFormat != nil { + objectMap["properties"] = erc.ExpressRouteCircuitPropertiesFormat } - - v = m["properties"] - if v != nil { - var properties ExpressRouteCircuitPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - erc.ExpressRouteCircuitPropertiesFormat = &properties + if erc.Etag != nil { + objectMap["etag"] = erc.Etag } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - erc.Etag = &etag + if erc.ID != nil { + objectMap["id"] = erc.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - erc.ID = &ID + if erc.Name != nil { + objectMap["name"] = erc.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - erc.Name = &name + if erc.Type != nil { + objectMap["type"] = erc.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - erc.Type = &typeVar + if erc.Location != nil { + objectMap["location"] = erc.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - erc.Location = &location + if erc.Tags != nil { + objectMap["tags"] = erc.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for ExpressRouteCircuit struct. +func (erc *ExpressRouteCircuit) 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 "sku": + if v != nil { + var sku ExpressRouteCircuitSku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + erc.Sku = &sku + } + case "properties": + if v != nil { + var expressRouteCircuitPropertiesFormat ExpressRouteCircuitPropertiesFormat + err = json.Unmarshal(*v, &expressRouteCircuitPropertiesFormat) + if err != nil { + return err + } + erc.ExpressRouteCircuitPropertiesFormat = &expressRouteCircuitPropertiesFormat + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + erc.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + erc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + erc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + erc.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + erc.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + erc.Tags = tags + } } - erc.Tags = &tags } return nil @@ -4307,14 +4580,14 @@ type ExpressRouteCircuitArpTable struct { // ExpressRouteCircuitAuthorization authorization in an ExpressRouteCircuit resource. type ExpressRouteCircuitAuthorization struct { - autorest.Response `json:"-"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` + autorest.Response `json:"-"` *AuthorizationPropertiesFormat `json:"properties,omitempty"` // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` // Etag - A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ExpressRouteCircuitAuthorization struct. @@ -4324,53 +4597,52 @@ func (erca *ExpressRouteCircuitAuthorization) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties AuthorizationPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - erca.AuthorizationPropertiesFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - erca.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - erca.Etag = &etag - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - erca.ID = &ID - } - - return nil -} - -// ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. + for k, v := range m { + switch k { + case "properties": + if v != nil { + var authorizationPropertiesFormat AuthorizationPropertiesFormat + err = json.Unmarshal(*v, &authorizationPropertiesFormat) + if err != nil { + return err + } + erca.AuthorizationPropertiesFormat = &authorizationPropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + erca.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + erca.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + erca.ID = &ID + } + } + } + + return nil +} + +// ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. type ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture struct { azure.Future req *http.Request @@ -4382,22 +4654,39 @@ func (future ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture) Result(clien var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return erca, autorest.NewError("network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return erca, azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { erca, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } erca, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -4414,22 +4703,39 @@ func (future ExpressRouteCircuitAuthorizationsDeleteFuture) Result(client Expres var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("network.ExpressRouteCircuitAuthorizationsDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitAuthorizationsDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -4537,14 +4843,14 @@ func (page ExpressRouteCircuitListResultPage) Values() []ExpressRouteCircuit { // ExpressRouteCircuitPeering peering in an ExpressRouteCircuit resource. type ExpressRouteCircuitPeering struct { - autorest.Response `json:"-"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` + autorest.Response `json:"-"` *ExpressRouteCircuitPeeringPropertiesFormat `json:"properties,omitempty"` // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` // Etag - A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ExpressRouteCircuitPeering struct. @@ -4554,46 +4860,45 @@ func (ercp *ExpressRouteCircuitPeering) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ExpressRouteCircuitPeeringPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - ercp.ExpressRouteCircuitPeeringPropertiesFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - ercp.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - ercp.Etag = &etag - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var expressRouteCircuitPeeringPropertiesFormat ExpressRouteCircuitPeeringPropertiesFormat + err = json.Unmarshal(*v, &expressRouteCircuitPeeringPropertiesFormat) + if err != nil { + return err + } + ercp.ExpressRouteCircuitPeeringPropertiesFormat = &expressRouteCircuitPeeringPropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ercp.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + ercp.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ercp.ID = &ID + } } - ercp.ID = &ID } return nil @@ -4615,8 +4920,8 @@ type ExpressRouteCircuitPeeringConfig struct { RoutingRegistryName *string `json:"routingRegistryName,omitempty"` } -// ExpressRouteCircuitPeeringListResult response for ListPeering API service call retrieves all peerings that belong to -// an ExpressRouteCircuit. +// ExpressRouteCircuitPeeringListResult response for ListPeering API service call retrieves all peerings that +// belong to an ExpressRouteCircuit. type ExpressRouteCircuitPeeringListResult struct { autorest.Response `json:"-"` // Value - The peerings in an express route circuit. @@ -4770,27 +5075,44 @@ func (future ExpressRouteCircuitPeeringsCreateOrUpdateFuture) Result(client Expr var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ercp, autorest.NewError("network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return ercp, azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { ercp, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } ercp, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } -// ExpressRouteCircuitPeeringsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// ExpressRouteCircuitPeeringsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type ExpressRouteCircuitPeeringsDeleteFuture struct { azure.Future req *http.Request @@ -4802,22 +5124,39 @@ func (future ExpressRouteCircuitPeeringsDeleteFuture) Result(client ExpressRoute var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("network.ExpressRouteCircuitPeeringsDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitPeeringsDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -4882,8 +5221,8 @@ type ExpressRouteCircuitsArpTableListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// ExpressRouteCircuitsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// ExpressRouteCircuitsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type ExpressRouteCircuitsCreateOrUpdateFuture struct { azure.Future req *http.Request @@ -4895,22 +5234,39 @@ func (future ExpressRouteCircuitsCreateOrUpdateFuture) Result(client ExpressRout var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return erc, autorest.NewError("network.ExpressRouteCircuitsCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return erc, azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { erc, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } erc, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -4927,22 +5283,39 @@ func (future ExpressRouteCircuitsDeleteFuture) Result(client ExpressRouteCircuit var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("network.ExpressRouteCircuitsDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -4966,8 +5339,8 @@ type ExpressRouteCircuitSku struct { Family ExpressRouteCircuitSkuFamily `json:"family,omitempty"` } -// ExpressRouteCircuitsListArpTableFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// ExpressRouteCircuitsListArpTableFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type ExpressRouteCircuitsListArpTableFuture struct { azure.Future req *http.Request @@ -4979,27 +5352,44 @@ func (future ExpressRouteCircuitsListArpTableFuture) Result(client ExpressRouteC var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListArpTableFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ercatlr, autorest.NewError("network.ExpressRouteCircuitsListArpTableFuture", "Result", "asynchronous operation has not completed") + return ercatlr, azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsListArpTableFuture") } if future.PollingMethod() == azure.PollingLocation { ercatlr, err = client.ListArpTableResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListArpTableFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListArpTableFuture", "Result", resp, "Failure sending request") return } ercatlr, err = client.ListArpTableResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListArpTableFuture", "Result", resp, "Failure responding to request") + } return } -// ExpressRouteCircuitsListRoutesTableFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// ExpressRouteCircuitsListRoutesTableFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type ExpressRouteCircuitsListRoutesTableFuture struct { azure.Future req *http.Request @@ -5011,22 +5401,39 @@ func (future ExpressRouteCircuitsListRoutesTableFuture) Result(client ExpressRou var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ercrtlr, autorest.NewError("network.ExpressRouteCircuitsListRoutesTableFuture", "Result", "asynchronous operation has not completed") + return ercrtlr, azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsListRoutesTableFuture") } if future.PollingMethod() == azure.PollingLocation { ercrtlr, err = client.ListRoutesTableResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableFuture", "Result", resp, "Failure sending request") return } ercrtlr, err = client.ListRoutesTableResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableFuture", "Result", resp, "Failure responding to request") + } return } @@ -5043,27 +5450,44 @@ func (future ExpressRouteCircuitsListRoutesTableSummaryFuture) Result(client Exp var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableSummaryFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ercrtslr, autorest.NewError("network.ExpressRouteCircuitsListRoutesTableSummaryFuture", "Result", "asynchronous operation has not completed") + return ercrtslr, azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsListRoutesTableSummaryFuture") } if future.PollingMethod() == azure.PollingLocation { ercrtslr, err = client.ListRoutesTableSummaryResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableSummaryFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableSummaryFuture", "Result", resp, "Failure sending request") return } ercrtslr, err = client.ListRoutesTableSummaryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableSummaryFuture", "Result", resp, "Failure responding to request") + } return } -// ExpressRouteCircuitsRoutesTableListResult response for ListRoutesTable associated with the Express Route Circuits -// API. +// ExpressRouteCircuitsRoutesTableListResult response for ListRoutesTable associated with the Express Route +// Circuits API. type ExpressRouteCircuitsRoutesTableListResult struct { autorest.Response `json:"-"` // Value - The list of routes table. @@ -5108,27 +5532,45 @@ func (future ExpressRouteCircuitsUpdateTagsFuture) Result(client ExpressRouteCir var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsUpdateTagsFuture", "Result", future.Response(), "Polling failure") return } if !done { - return erc, autorest.NewError("network.ExpressRouteCircuitsUpdateTagsFuture", "Result", "asynchronous operation has not completed") + return erc, azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsUpdateTagsFuture") } if future.PollingMethod() == azure.PollingLocation { erc, err = client.UpdateTagsResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsUpdateTagsFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsUpdateTagsFuture", "Result", resp, "Failure sending request") return } erc, err = client.UpdateTagsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsUpdateTagsFuture", "Result", resp, "Failure responding to request") + } return } // ExpressRouteServiceProvider a ExpressRouteResourceProvider object. type ExpressRouteServiceProvider struct { + *ExpressRouteServiceProviderPropertiesFormat `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. @@ -5138,83 +5580,104 @@ type ExpressRouteServiceProvider struct { // Location - Resource location. Location *string `json:"location,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - *ExpressRouteServiceProviderPropertiesFormat `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for ExpressRouteServiceProvider struct. -func (ersp *ExpressRouteServiceProvider) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ExpressRouteServiceProviderPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - ersp.ExpressRouteServiceProviderPropertiesFormat = &properties +// MarshalJSON is the custom marshaler for ExpressRouteServiceProvider. +func (ersp ExpressRouteServiceProvider) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ersp.ExpressRouteServiceProviderPropertiesFormat != nil { + objectMap["properties"] = ersp.ExpressRouteServiceProviderPropertiesFormat } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - ersp.ID = &ID + if ersp.ID != nil { + objectMap["id"] = ersp.ID } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - ersp.Name = &name + if ersp.Name != nil { + objectMap["name"] = ersp.Name } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - ersp.Type = &typeVar + if ersp.Type != nil { + objectMap["type"] = ersp.Type } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - ersp.Location = &location + if ersp.Location != nil { + objectMap["location"] = ersp.Location } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - ersp.Tags = &tags + if ersp.Tags != nil { + objectMap["tags"] = ersp.Tags } - - return nil + return json.Marshal(objectMap) } -// ExpressRouteServiceProviderBandwidthsOffered contains bandwidths offered in ExpressRouteServiceProvider resources. +// UnmarshalJSON is the custom unmarshaler for ExpressRouteServiceProvider struct. +func (ersp *ExpressRouteServiceProvider) 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 "properties": + if v != nil { + var expressRouteServiceProviderPropertiesFormat ExpressRouteServiceProviderPropertiesFormat + err = json.Unmarshal(*v, &expressRouteServiceProviderPropertiesFormat) + if err != nil { + return err + } + ersp.ExpressRouteServiceProviderPropertiesFormat = &expressRouteServiceProviderPropertiesFormat + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ersp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ersp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ersp.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ersp.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ersp.Tags = tags + } + } + } + + return nil +} + +// ExpressRouteServiceProviderBandwidthsOffered contains bandwidths offered in ExpressRouteServiceProvider +// resources. type ExpressRouteServiceProviderBandwidthsOffered struct { // OfferName - The OfferName. OfferName *string `json:"offerName,omitempty"` @@ -5231,8 +5694,8 @@ type ExpressRouteServiceProviderListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// ExpressRouteServiceProviderListResultIterator provides access to a complete listing of ExpressRouteServiceProvider -// values. +// ExpressRouteServiceProviderListResultIterator provides access to a complete listing of +// ExpressRouteServiceProvider values. type ExpressRouteServiceProviderListResultIterator struct { i int page ExpressRouteServiceProviderListResultPage @@ -5350,26 +5813,27 @@ func (fli *FlowLogInformation) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["targetResourceId"] - if v != nil { - var targetResourceID string - err = json.Unmarshal(*m["targetResourceId"], &targetResourceID) - if err != nil { - return err - } - fli.TargetResourceID = &targetResourceID - } - - v = m["properties"] - if v != nil { - var properties FlowLogProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "targetResourceId": + if v != nil { + var targetResourceID string + err = json.Unmarshal(*v, &targetResourceID) + if err != nil { + return err + } + fli.TargetResourceID = &targetResourceID + } + case "properties": + if v != nil { + var flowLogProperties FlowLogProperties + err = json.Unmarshal(*v, &flowLogProperties) + if err != nil { + return err + } + fli.FlowLogProperties = &flowLogProperties + } } - fli.FlowLogProperties = &properties } return nil @@ -5393,8 +5857,6 @@ type FlowLogStatusParameters struct { // FrontendIPConfiguration frontend IP address of the load balancer. type FrontendIPConfiguration struct { autorest.Response `json:"-"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` // FrontendIPConfigurationPropertiesFormat - Properties of the load balancer probe. *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. @@ -5403,6 +5865,8 @@ type FrontendIPConfiguration struct { Etag *string `json:"etag,omitempty"` // Zones - A list of availability zones denoting the IP allocated for the resource needs to come from. Zones *[]string `json:"zones,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for FrontendIPConfiguration struct. @@ -5412,56 +5876,54 @@ func (fic *FrontendIPConfiguration) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties FrontendIPConfigurationPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - fic.FrontendIPConfigurationPropertiesFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - fic.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - fic.Etag = &etag - } - - v = m["zones"] - if v != nil { - var zones []string - err = json.Unmarshal(*m["zones"], &zones) - if err != nil { - return err - } - fic.Zones = &zones - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var frontendIPConfigurationPropertiesFormat FrontendIPConfigurationPropertiesFormat + err = json.Unmarshal(*v, &frontendIPConfigurationPropertiesFormat) + if err != nil { + return err + } + fic.FrontendIPConfigurationPropertiesFormat = &frontendIPConfigurationPropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + fic.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + fic.Etag = &etag + } + case "zones": + if v != nil { + var zones []string + err = json.Unmarshal(*v, &zones) + if err != nil { + return err + } + fic.Zones = &zones + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + fic.ID = &ID + } } - fic.ID = &ID } return nil @@ -5516,14 +5978,14 @@ type GatewayRouteListResult struct { // InboundNatPool inbound NAT pool of the load balancer. type InboundNatPool struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` // InboundNatPoolPropertiesFormat - Properties of load balancer inbound nat pool. *InboundNatPoolPropertiesFormat `json:"properties,omitempty"` // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` // Etag - A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for InboundNatPool struct. @@ -5533,46 +5995,45 @@ func (inp *InboundNatPool) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties InboundNatPoolPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - inp.InboundNatPoolPropertiesFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - inp.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - inp.Etag = &etag - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var inboundNatPoolPropertiesFormat InboundNatPoolPropertiesFormat + err = json.Unmarshal(*v, &inboundNatPoolPropertiesFormat) + if err != nil { + return err + } + inp.InboundNatPoolPropertiesFormat = &inboundNatPoolPropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + inp.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + inp.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + inp.ID = &ID + } } - inp.ID = &ID } return nil @@ -5597,14 +6058,14 @@ type InboundNatPoolPropertiesFormat struct { // InboundNatRule inbound NAT rule of the load balancer. type InboundNatRule struct { autorest.Response `json:"-"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` // InboundNatRulePropertiesFormat - Properties of load balancer inbound nat rule. *InboundNatRulePropertiesFormat `json:"properties,omitempty"` // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` // Etag - A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for InboundNatRule struct. @@ -5614,46 +6075,45 @@ func (inr *InboundNatRule) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties InboundNatRulePropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - inr.InboundNatRulePropertiesFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - inr.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - inr.Etag = &etag - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var inboundNatRulePropertiesFormat InboundNatRulePropertiesFormat + err = json.Unmarshal(*v, &inboundNatRulePropertiesFormat) + if err != nil { + return err + } + inr.InboundNatRulePropertiesFormat = &inboundNatRulePropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + inr.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + inr.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + inr.ID = &ID + } } - inr.ID = &ID } return nil @@ -5794,26 +6254,44 @@ func (future InboundNatRulesCreateOrUpdateFuture) Result(client InboundNatRulesC var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.InboundNatRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return inr, autorest.NewError("network.InboundNatRulesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return inr, azure.NewAsyncOpIncompleteError("network.InboundNatRulesCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { inr, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.InboundNatRulesCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.InboundNatRulesCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } inr, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.InboundNatRulesCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } -// InboundNatRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// InboundNatRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type InboundNatRulesDeleteFuture struct { azure.Future req *http.Request @@ -5825,28 +6303,49 @@ func (future InboundNatRulesDeleteFuture) Result(client InboundNatRulesClient) ( var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.InboundNatRulesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("network.InboundNatRulesDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("network.InboundNatRulesDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.InboundNatRulesDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.InboundNatRulesDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.InboundNatRulesDeleteFuture", "Result", resp, "Failure responding to request") + } return } // Interface a network interface in a resource group. type Interface struct { autorest.Response `json:"-"` + // InterfacePropertiesFormat - Properties of the network interface. + *InterfacePropertiesFormat `json:"properties,omitempty"` + // Etag - A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. @@ -5856,90 +6355,109 @@ type Interface struct { // Location - Resource location. Location *string `json:"location,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // InterfacePropertiesFormat - Properties of the network interface. - *InterfacePropertiesFormat `json:"properties,omitempty"` - // Etag - A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for Interface struct. -func (i *Interface) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for Interface. +func (i Interface) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if i.InterfacePropertiesFormat != nil { + objectMap["properties"] = i.InterfacePropertiesFormat } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties InterfacePropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - i.InterfacePropertiesFormat = &properties + if i.Etag != nil { + objectMap["etag"] = i.Etag } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - i.Etag = &etag + if i.ID != nil { + objectMap["id"] = i.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - i.ID = &ID + if i.Name != nil { + objectMap["name"] = i.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - i.Name = &name + if i.Type != nil { + objectMap["type"] = i.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - i.Type = &typeVar + if i.Location != nil { + objectMap["location"] = i.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - i.Location = &location + if i.Tags != nil { + objectMap["tags"] = i.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for Interface struct. +func (i *Interface) 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 "properties": + if v != nil { + var interfacePropertiesFormat InterfacePropertiesFormat + err = json.Unmarshal(*v, &interfacePropertiesFormat) + if err != nil { + return err + } + i.InterfacePropertiesFormat = &interfacePropertiesFormat + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + i.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + i.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + i.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + i.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + i.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + i.Tags = tags + } } - i.Tags = &tags } return nil @@ -5970,14 +6488,14 @@ type InterfaceDNSSettings struct { // InterfaceIPConfiguration iPConfiguration in a network interface. type InterfaceIPConfiguration struct { autorest.Response `json:"-"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` // InterfaceIPConfigurationPropertiesFormat - Network interface IP configuration properties. *InterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` // Etag - A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for InterfaceIPConfiguration struct. @@ -5987,46 +6505,45 @@ func (iic *InterfaceIPConfiguration) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties InterfaceIPConfigurationPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - iic.InterfaceIPConfigurationPropertiesFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - iic.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - iic.Etag = &etag - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var interfaceIPConfigurationPropertiesFormat InterfaceIPConfigurationPropertiesFormat + err = json.Unmarshal(*v, &interfaceIPConfigurationPropertiesFormat) + if err != nil { + return err + } + iic.InterfaceIPConfigurationPropertiesFormat = &interfaceIPConfigurationPropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + iic.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + iic.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + iic.ID = &ID + } } - iic.ID = &ID } return nil @@ -6041,7 +6558,8 @@ type InterfaceIPConfigurationListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// InterfaceIPConfigurationListResultIterator provides access to a complete listing of InterfaceIPConfiguration values. +// InterfaceIPConfigurationListResultIterator provides access to a complete listing of InterfaceIPConfiguration +// values. type InterfaceIPConfigurationListResultIterator struct { i int page InterfaceIPConfigurationListResultPage @@ -6388,7 +6906,8 @@ type InterfacePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// InterfacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// InterfacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type InterfacesCreateOrUpdateFuture struct { azure.Future req *http.Request @@ -6400,22 +6919,39 @@ func (future InterfacesCreateOrUpdateFuture) Result(client InterfacesClient) (i var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.InterfacesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return i, autorest.NewError("network.InterfacesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return i, azure.NewAsyncOpIncompleteError("network.InterfacesCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { i, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.InterfacesCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.InterfacesCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } i, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.InterfacesCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -6431,27 +6967,44 @@ func (future InterfacesDeleteFuture) Result(client InterfacesClient) (ar autores var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.InterfacesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("network.InterfacesDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("network.InterfacesDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.InterfacesDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.InterfacesDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.InterfacesDeleteFuture", "Result", resp, "Failure responding to request") + } return } -// InterfacesGetEffectiveRouteTableFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// InterfacesGetEffectiveRouteTableFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type InterfacesGetEffectiveRouteTableFuture struct { azure.Future req *http.Request @@ -6463,22 +7016,39 @@ func (future InterfacesGetEffectiveRouteTableFuture) Result(client InterfacesCli var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.InterfacesGetEffectiveRouteTableFuture", "Result", future.Response(), "Polling failure") return } if !done { - return erlr, autorest.NewError("network.InterfacesGetEffectiveRouteTableFuture", "Result", "asynchronous operation has not completed") + return erlr, azure.NewAsyncOpIncompleteError("network.InterfacesGetEffectiveRouteTableFuture") } if future.PollingMethod() == azure.PollingLocation { erlr, err = client.GetEffectiveRouteTableResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.InterfacesGetEffectiveRouteTableFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.InterfacesGetEffectiveRouteTableFuture", "Result", resp, "Failure sending request") return } erlr, err = client.GetEffectiveRouteTableResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.InterfacesGetEffectiveRouteTableFuture", "Result", resp, "Failure responding to request") + } return } @@ -6495,22 +7065,39 @@ func (future InterfacesListEffectiveNetworkSecurityGroupsFuture) Result(client I var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.InterfacesListEffectiveNetworkSecurityGroupsFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ensglr, autorest.NewError("network.InterfacesListEffectiveNetworkSecurityGroupsFuture", "Result", "asynchronous operation has not completed") + return ensglr, azure.NewAsyncOpIncompleteError("network.InterfacesListEffectiveNetworkSecurityGroupsFuture") } if future.PollingMethod() == azure.PollingLocation { ensglr, err = client.ListEffectiveNetworkSecurityGroupsResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.InterfacesListEffectiveNetworkSecurityGroupsFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.InterfacesListEffectiveNetworkSecurityGroupsFuture", "Result", resp, "Failure sending request") return } ensglr, err = client.ListEffectiveNetworkSecurityGroupsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.InterfacesListEffectiveNetworkSecurityGroupsFuture", "Result", resp, "Failure responding to request") + } return } @@ -6526,22 +7113,39 @@ func (future InterfacesUpdateTagsFuture) Result(client InterfacesClient) (i Inte var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.InterfacesUpdateTagsFuture", "Result", future.Response(), "Polling failure") return } if !done { - return i, autorest.NewError("network.InterfacesUpdateTagsFuture", "Result", "asynchronous operation has not completed") + return i, azure.NewAsyncOpIncompleteError("network.InterfacesUpdateTagsFuture") } if future.PollingMethod() == azure.PollingLocation { i, err = client.UpdateTagsResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.InterfacesUpdateTagsFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.InterfacesUpdateTagsFuture", "Result", resp, "Failure sending request") return } i, err = client.UpdateTagsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.InterfacesUpdateTagsFuture", "Result", resp, "Failure responding to request") + } return } @@ -6556,14 +7160,14 @@ type IPAddressAvailabilityResult struct { // IPConfiguration IP configuration type IPConfiguration struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` // IPConfigurationPropertiesFormat - Properties of the IP configuration *IPConfigurationPropertiesFormat `json:"properties,omitempty"` // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` // Etag - A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for IPConfiguration struct. @@ -6573,46 +7177,45 @@ func (ic *IPConfiguration) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties IPConfigurationPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - ic.IPConfigurationPropertiesFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - ic.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - ic.Etag = &etag - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var IPConfigurationPropertiesFormat IPConfigurationPropertiesFormat + err = json.Unmarshal(*v, &IPConfigurationPropertiesFormat) + if err != nil { + return err + } + ic.IPConfigurationPropertiesFormat = &IPConfigurationPropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ic.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + ic.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ic.ID = &ID + } } - ic.ID = &ID } return nil @@ -6669,6 +7272,12 @@ type Ipv6ExpressRouteCircuitPeeringConfig struct { // LoadBalancer loadBalancer resource type LoadBalancer struct { autorest.Response `json:"-"` + // Sku - The load balancer SKU. + Sku *LoadBalancerSku `json:"sku,omitempty"` + // LoadBalancerPropertiesFormat - Properties of load balancer. + *LoadBalancerPropertiesFormat `json:"properties,omitempty"` + // Etag - A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. @@ -6678,102 +7287,121 @@ type LoadBalancer struct { // Location - Resource location. Location *string `json:"location,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // Sku - The load balancer SKU. - Sku *LoadBalancerSku `json:"sku,omitempty"` - // LoadBalancerPropertiesFormat - Properties of load balancer. - *LoadBalancerPropertiesFormat `json:"properties,omitempty"` - // Etag - A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for LoadBalancer struct. -func (lb *LoadBalancer) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for LoadBalancer. +func (lb LoadBalancer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lb.Sku != nil { + objectMap["sku"] = lb.Sku } - var v *json.RawMessage - - v = m["sku"] - if v != nil { - var sku LoadBalancerSku - err = json.Unmarshal(*m["sku"], &sku) - if err != nil { - return err - } - lb.Sku = &sku + if lb.LoadBalancerPropertiesFormat != nil { + objectMap["properties"] = lb.LoadBalancerPropertiesFormat } - - v = m["properties"] - if v != nil { - var properties LoadBalancerPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - lb.LoadBalancerPropertiesFormat = &properties + if lb.Etag != nil { + objectMap["etag"] = lb.Etag } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - lb.Etag = &etag + if lb.ID != nil { + objectMap["id"] = lb.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - lb.ID = &ID + if lb.Name != nil { + objectMap["name"] = lb.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - lb.Name = &name + if lb.Type != nil { + objectMap["type"] = lb.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - lb.Type = &typeVar + if lb.Location != nil { + objectMap["location"] = lb.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - lb.Location = &location + if lb.Tags != nil { + objectMap["tags"] = lb.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for LoadBalancer struct. +func (lb *LoadBalancer) 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 "sku": + if v != nil { + var sku LoadBalancerSku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + lb.Sku = &sku + } + case "properties": + if v != nil { + var loadBalancerPropertiesFormat LoadBalancerPropertiesFormat + err = json.Unmarshal(*v, &loadBalancerPropertiesFormat) + if err != nil { + return err + } + lb.LoadBalancerPropertiesFormat = &loadBalancerPropertiesFormat + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + lb.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + lb.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + lb.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + lb.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + lb.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + lb.Tags = tags + } } - lb.Tags = &tags } return nil @@ -6788,7 +7416,8 @@ type LoadBalancerBackendAddressPoolListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// LoadBalancerBackendAddressPoolListResultIterator provides access to a complete listing of BackendAddressPool values. +// LoadBalancerBackendAddressPoolListResultIterator provides access to a complete listing of BackendAddressPool +// values. type LoadBalancerBackendAddressPoolListResultIterator struct { i int page LoadBalancerBackendAddressPoolListResultPage @@ -7095,7 +7724,8 @@ type LoadBalancerLoadBalancingRuleListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// LoadBalancerLoadBalancingRuleListResultIterator provides access to a complete listing of LoadBalancingRule values. +// LoadBalancerLoadBalancingRuleListResultIterator provides access to a complete listing of LoadBalancingRule +// values. type LoadBalancerLoadBalancingRuleListResultIterator struct { i int page LoadBalancerLoadBalancingRuleListResultPage @@ -7325,22 +7955,39 @@ func (future LoadBalancersCreateOrUpdateFuture) Result(client LoadBalancersClien var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return lb, autorest.NewError("network.LoadBalancersCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return lb, azure.NewAsyncOpIncompleteError("network.LoadBalancersCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { lb, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancersCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancersCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } lb, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancersCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -7356,22 +8003,39 @@ func (future LoadBalancersDeleteFuture) Result(client LoadBalancersClient) (ar a var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancersDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("network.LoadBalancersDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("network.LoadBalancersDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancersDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancersDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancersDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -7381,7 +8045,8 @@ type LoadBalancerSku struct { Name LoadBalancerSkuName `json:"name,omitempty"` } -// LoadBalancersUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// LoadBalancersUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type LoadBalancersUpdateTagsFuture struct { azure.Future req *http.Request @@ -7393,36 +8058,53 @@ func (future LoadBalancersUpdateTagsFuture) Result(client LoadBalancersClient) ( var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancersUpdateTagsFuture", "Result", future.Response(), "Polling failure") return } if !done { - return lb, autorest.NewError("network.LoadBalancersUpdateTagsFuture", "Result", "asynchronous operation has not completed") + return lb, azure.NewAsyncOpIncompleteError("network.LoadBalancersUpdateTagsFuture") } if future.PollingMethod() == azure.PollingLocation { lb, err = client.UpdateTagsResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancersUpdateTagsFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancersUpdateTagsFuture", "Result", resp, "Failure sending request") return } lb, err = client.UpdateTagsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancersUpdateTagsFuture", "Result", resp, "Failure responding to request") + } return } // LoadBalancingRule a load balancing rule for a load balancer. type LoadBalancingRule struct { autorest.Response `json:"-"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` // LoadBalancingRulePropertiesFormat - Properties of load balancer load balancing rule. *LoadBalancingRulePropertiesFormat `json:"properties,omitempty"` // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` // Etag - A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for LoadBalancingRule struct. @@ -7432,46 +8114,45 @@ func (lbr *LoadBalancingRule) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties LoadBalancingRulePropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - lbr.LoadBalancingRulePropertiesFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - lbr.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - lbr.Etag = &etag - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var loadBalancingRulePropertiesFormat LoadBalancingRulePropertiesFormat + err = json.Unmarshal(*v, &loadBalancingRulePropertiesFormat) + if err != nil { + return err + } + lbr.LoadBalancingRulePropertiesFormat = &loadBalancingRulePropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + lbr.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + lbr.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + lbr.ID = &ID + } } - lbr.ID = &ID } return nil @@ -7506,6 +8187,10 @@ type LoadBalancingRulePropertiesFormat struct { // LocalNetworkGateway a common class for general resource information type LocalNetworkGateway struct { autorest.Response `json:"-"` + // LocalNetworkGatewayPropertiesFormat - Properties of the local network gateway. + *LocalNetworkGatewayPropertiesFormat `json:"properties,omitempty"` + // Etag - A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. @@ -7515,90 +8200,109 @@ type LocalNetworkGateway struct { // Location - Resource location. Location *string `json:"location,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // LocalNetworkGatewayPropertiesFormat - Properties of the local network gateway. - *LocalNetworkGatewayPropertiesFormat `json:"properties,omitempty"` - // Etag - A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for LocalNetworkGateway struct. -func (lng *LocalNetworkGateway) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for LocalNetworkGateway. +func (lng LocalNetworkGateway) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lng.LocalNetworkGatewayPropertiesFormat != nil { + objectMap["properties"] = lng.LocalNetworkGatewayPropertiesFormat } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties LocalNetworkGatewayPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - lng.LocalNetworkGatewayPropertiesFormat = &properties + if lng.Etag != nil { + objectMap["etag"] = lng.Etag } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - lng.Etag = &etag + if lng.ID != nil { + objectMap["id"] = lng.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - lng.ID = &ID + if lng.Name != nil { + objectMap["name"] = lng.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - lng.Name = &name + if lng.Type != nil { + objectMap["type"] = lng.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - lng.Type = &typeVar + if lng.Location != nil { + objectMap["location"] = lng.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - lng.Location = &location + if lng.Tags != nil { + objectMap["tags"] = lng.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for LocalNetworkGateway struct. +func (lng *LocalNetworkGateway) 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 "properties": + if v != nil { + var localNetworkGatewayPropertiesFormat LocalNetworkGatewayPropertiesFormat + err = json.Unmarshal(*v, &localNetworkGatewayPropertiesFormat) + if err != nil { + return err + } + lng.LocalNetworkGatewayPropertiesFormat = &localNetworkGatewayPropertiesFormat + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + lng.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + lng.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + lng.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + lng.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + lng.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + lng.Tags = tags + } } - lng.Tags = &tags } return nil @@ -7720,8 +8424,8 @@ type LocalNetworkGatewayPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// LocalNetworkGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// LocalNetworkGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type LocalNetworkGatewaysCreateOrUpdateFuture struct { azure.Future req *http.Request @@ -7733,22 +8437,39 @@ func (future LocalNetworkGatewaysCreateOrUpdateFuture) Result(client LocalNetwor var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return lng, autorest.NewError("network.LocalNetworkGatewaysCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return lng, azure.NewAsyncOpIncompleteError("network.LocalNetworkGatewaysCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { lng, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } lng, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -7765,22 +8486,39 @@ func (future LocalNetworkGatewaysDeleteFuture) Result(client LocalNetworkGateway var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("network.LocalNetworkGatewaysDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("network.LocalNetworkGatewaysDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -7797,22 +8535,39 @@ func (future LocalNetworkGatewaysUpdateTagsFuture) Result(client LocalNetworkGat var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysUpdateTagsFuture", "Result", future.Response(), "Polling failure") return } if !done { - return lng, autorest.NewError("network.LocalNetworkGatewaysUpdateTagsFuture", "Result", "asynchronous operation has not completed") + return lng, azure.NewAsyncOpIncompleteError("network.LocalNetworkGatewaysUpdateTagsFuture") } if future.PollingMethod() == azure.PollingLocation { lng, err = client.UpdateTagsResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysUpdateTagsFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysUpdateTagsFuture", "Result", resp, "Failure sending request") return } lng, err = client.UpdateTagsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysUpdateTagsFuture", "Result", resp, "Failure responding to request") + } return } @@ -7900,46 +8655,45 @@ func (o *Operation) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - o.Name = &name - } - - v = m["display"] - if v != nil { - var display OperationDisplay - err = json.Unmarshal(*m["display"], &display) - if err != nil { - return err - } - o.Display = &display - } - - v = m["origin"] - if v != nil { - var origin string - err = json.Unmarshal(*m["origin"], &origin) - if err != nil { - return err - } - o.Origin = &origin - } - - v = m["properties"] - if v != nil { - var properties OperationPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - 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 + } + o.Name = &name + } + case "display": + if v != nil { + var display OperationDisplay + err = json.Unmarshal(*v, &display) + if err != nil { + return err + } + o.Display = &display + } + case "origin": + if v != nil { + var origin string + err = json.Unmarshal(*v, &origin) + if err != nil { + return err + } + o.Origin = &origin + } + case "properties": + if v != nil { + var operationPropertiesFormat OperationPropertiesFormat + err = json.Unmarshal(*v, &operationPropertiesFormat) + if err != nil { + return err + } + o.OperationPropertiesFormat = &operationPropertiesFormat + } } - o.OperationPropertiesFormat = &properties } return nil @@ -8076,14 +8830,14 @@ type OperationPropertiesFormatServiceSpecification struct { // OutboundNatRule outbound NAT pool of the load balancer. type OutboundNatRule struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` // OutboundNatRulePropertiesFormat - Properties of load balancer outbound nat rule. *OutboundNatRulePropertiesFormat `json:"properties,omitempty"` // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` // Etag - A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for OutboundNatRule struct. @@ -8093,46 +8847,45 @@ func (onr *OutboundNatRule) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties OutboundNatRulePropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - onr.OutboundNatRulePropertiesFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - onr.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - onr.Etag = &etag - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var outboundNatRulePropertiesFormat OutboundNatRulePropertiesFormat + err = json.Unmarshal(*v, &outboundNatRulePropertiesFormat) + if err != nil { + return err + } + onr.OutboundNatRulePropertiesFormat = &outboundNatRulePropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + onr.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + onr.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + onr.ID = &ID + } } - onr.ID = &ID } return nil @@ -8162,16 +8915,18 @@ func (pc *PacketCapture) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties PacketCaptureParameters - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var packetCaptureParameters PacketCaptureParameters + err = json.Unmarshal(*v, &packetCaptureParameters) + if err != nil { + return err + } + pc.PacketCaptureParameters = &packetCaptureParameters + } } - pc.PacketCaptureParameters = &properties } return nil @@ -8247,46 +9002,45 @@ func (pcr *PacketCaptureResult) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - pcr.Name = &name - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - pcr.ID = &ID - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - pcr.Etag = &etag - } - - v = m["properties"] - if v != nil { - var properties PacketCaptureResultProperties - err = json.Unmarshal(*m["properties"], &properties) - 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 + } + pcr.Name = &name + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pcr.ID = &ID + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + pcr.Etag = &etag + } + case "properties": + if v != nil { + var packetCaptureResultProperties PacketCaptureResultProperties + err = json.Unmarshal(*v, &packetCaptureResultProperties) + if err != nil { + return err + } + pcr.PacketCaptureResultProperties = &packetCaptureResultProperties + } } - pcr.PacketCaptureResultProperties = &properties } return nil @@ -8294,6 +9048,8 @@ func (pcr *PacketCaptureResult) UnmarshalJSON(body []byte) error { // PacketCaptureResultProperties describes the properties of a packet capture session. type PacketCaptureResultProperties struct { + // ProvisioningState - The provisioning state of the packet capture session. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // Target - The ID of the targeted resource, only VM is currently supported. Target *string `json:"target,omitempty"` // BytesToCapturePerPacket - Number of bytes captured per packet, the remaining bytes are truncated. @@ -8304,8 +9060,6 @@ type PacketCaptureResultProperties struct { TimeLimitInSeconds *int32 `json:"timeLimitInSeconds,omitempty"` StorageLocation *PacketCaptureStorageLocation `json:"storageLocation,omitempty"` Filters *[]PacketCaptureFilter `json:"filters,omitempty"` - // ProvisioningState - The provisioning state of the packet capture session. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } // PacketCapturesCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. @@ -8320,22 +9074,39 @@ func (future PacketCapturesCreateFuture) Result(client PacketCapturesClient) (pc var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.PacketCapturesCreateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return pcr, autorest.NewError("network.PacketCapturesCreateFuture", "Result", "asynchronous operation has not completed") + return pcr, azure.NewAsyncOpIncompleteError("network.PacketCapturesCreateFuture") } if future.PollingMethod() == azure.PollingLocation { pcr, err = client.CreateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.PacketCapturesCreateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.PacketCapturesCreateFuture", "Result", resp, "Failure sending request") return } pcr, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.PacketCapturesCreateFuture", "Result", resp, "Failure responding to request") + } return } @@ -8351,26 +9122,44 @@ func (future PacketCapturesDeleteFuture) Result(client PacketCapturesClient) (ar var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.PacketCapturesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("network.PacketCapturesDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("network.PacketCapturesDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.PacketCapturesDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.PacketCapturesDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.PacketCapturesDeleteFuture", "Result", resp, "Failure responding to request") + } return } -// PacketCapturesGetStatusFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// PacketCapturesGetStatusFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type PacketCapturesGetStatusFuture struct { azure.Future req *http.Request @@ -8382,22 +9171,39 @@ func (future PacketCapturesGetStatusFuture) Result(client PacketCapturesClient) var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.PacketCapturesGetStatusFuture", "Result", future.Response(), "Polling failure") return } if !done { - return pcqsr, autorest.NewError("network.PacketCapturesGetStatusFuture", "Result", "asynchronous operation has not completed") + return pcqsr, azure.NewAsyncOpIncompleteError("network.PacketCapturesGetStatusFuture") } if future.PollingMethod() == azure.PollingLocation { pcqsr, err = client.GetStatusResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.PacketCapturesGetStatusFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.PacketCapturesGetStatusFuture", "Result", resp, "Failure sending request") return } pcqsr, err = client.GetStatusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.PacketCapturesGetStatusFuture", "Result", resp, "Failure responding to request") + } return } @@ -8413,22 +9219,39 @@ func (future PacketCapturesStopFuture) Result(client PacketCapturesClient) (ar a var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.PacketCapturesStopFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("network.PacketCapturesStopFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("network.PacketCapturesStopFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.StopResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.PacketCapturesStopFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.PacketCapturesStopFuture", "Result", resp, "Failure sending request") return } ar, err = client.StopResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.PacketCapturesStopFuture", "Result", resp, "Failure responding to request") + } return } @@ -8444,8 +9267,6 @@ type PacketCaptureStorageLocation struct { // PatchRouteFilter route Filter Resource. type PatchRouteFilter struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` *RouteFilterPropertiesFormat `json:"properties,omitempty"` // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` @@ -8454,76 +9275,99 @@ type PatchRouteFilter struct { // Type - Resource type. Type *string `json:"type,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for PatchRouteFilter struct. -func (prf *PatchRouteFilter) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for PatchRouteFilter. +func (prf PatchRouteFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if prf.RouteFilterPropertiesFormat != nil { + objectMap["properties"] = prf.RouteFilterPropertiesFormat } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties RouteFilterPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - prf.RouteFilterPropertiesFormat = &properties + if prf.Name != nil { + objectMap["name"] = prf.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - prf.Name = &name + if prf.Etag != nil { + objectMap["etag"] = prf.Etag } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - prf.Etag = &etag + if prf.Type != nil { + objectMap["type"] = prf.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - prf.Type = &typeVar + if prf.Tags != nil { + objectMap["tags"] = prf.Tags + } + if prf.ID != nil { + objectMap["id"] = prf.ID } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - prf.Tags = &tags +// UnmarshalJSON is the custom unmarshaler for PatchRouteFilter struct. +func (prf *PatchRouteFilter) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var routeFilterPropertiesFormat RouteFilterPropertiesFormat + err = json.Unmarshal(*v, &routeFilterPropertiesFormat) + if err != nil { + return err + } + prf.RouteFilterPropertiesFormat = &routeFilterPropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + prf.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + prf.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + prf.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + prf.Tags = tags + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + prf.ID = &ID + } } - prf.ID = &ID } return nil @@ -8531,15 +9375,36 @@ func (prf *PatchRouteFilter) UnmarshalJSON(body []byte) error { // PatchRouteFilterRule route Filter Rule Resource type PatchRouteFilterRule struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` *RouteFilterRulePropertiesFormat `json:"properties,omitempty"` // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` // Etag - A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for PatchRouteFilterRule. +func (prfr PatchRouteFilterRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if prfr.RouteFilterRulePropertiesFormat != nil { + objectMap["properties"] = prfr.RouteFilterRulePropertiesFormat + } + if prfr.Name != nil { + objectMap["name"] = prfr.Name + } + if prfr.Etag != nil { + objectMap["etag"] = prfr.Etag + } + if prfr.Tags != nil { + objectMap["tags"] = prfr.Tags + } + if prfr.ID != nil { + objectMap["id"] = prfr.ID + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for PatchRouteFilterRule struct. @@ -8549,56 +9414,54 @@ func (prfr *PatchRouteFilterRule) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties RouteFilterRulePropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - prfr.RouteFilterRulePropertiesFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - prfr.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - prfr.Etag = &etag - } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - prfr.Tags = &tags - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var routeFilterRulePropertiesFormat RouteFilterRulePropertiesFormat + err = json.Unmarshal(*v, &routeFilterRulePropertiesFormat) + if err != nil { + return err + } + prfr.RouteFilterRulePropertiesFormat = &routeFilterRulePropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + prfr.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + prfr.Etag = &etag + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + prfr.Tags = tags + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + prfr.ID = &ID + } } - prfr.ID = &ID } return nil @@ -8607,14 +9470,14 @@ func (prfr *PatchRouteFilterRule) UnmarshalJSON(body []byte) error { // Probe a load balancer probe. type Probe struct { autorest.Response `json:"-"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` // ProbePropertiesFormat - Properties of load balancer probe. *ProbePropertiesFormat `json:"properties,omitempty"` // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` // Etag - A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for Probe struct. @@ -8624,46 +9487,45 @@ func (p *Probe) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ProbePropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - p.ProbePropertiesFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - p.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - p.Etag = &etag - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var probePropertiesFormat ProbePropertiesFormat + err = json.Unmarshal(*v, &probePropertiesFormat) + if err != nil { + return err + } + p.ProbePropertiesFormat = &probePropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + p.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + p.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + p.ID = &ID + } } - p.ID = &ID } return nil @@ -8690,6 +9552,14 @@ type ProbePropertiesFormat struct { // PublicIPAddress public IP address resource. type PublicIPAddress struct { autorest.Response `json:"-"` + // Sku - The public IP address SKU. + Sku *PublicIPAddressSku `json:"sku,omitempty"` + // PublicIPAddressPropertiesFormat - Public IP address properties. + *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` + // Etag - A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // Zones - A list of availability zones denoting the IP allocated for the resource needs to come from. + Zones *[]string `json:"zones,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. @@ -8699,114 +9569,133 @@ type PublicIPAddress struct { // Location - Resource location. Location *string `json:"location,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // Sku - The public IP address SKU. - Sku *PublicIPAddressSku `json:"sku,omitempty"` - // PublicIPAddressPropertiesFormat - Public IP address properties. - *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - // Etag - A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Zones - A list of availability zones denoting the IP allocated for the resource needs to come from. - Zones *[]string `json:"zones,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for PublicIPAddress struct. -func (pia *PublicIPAddress) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for PublicIPAddress. +func (pia PublicIPAddress) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pia.Sku != nil { + objectMap["sku"] = pia.Sku } - var v *json.RawMessage - - v = m["sku"] - if v != nil { - var sku PublicIPAddressSku - err = json.Unmarshal(*m["sku"], &sku) - if err != nil { - return err - } - pia.Sku = &sku + if pia.PublicIPAddressPropertiesFormat != nil { + objectMap["properties"] = pia.PublicIPAddressPropertiesFormat } - - v = m["properties"] - if v != nil { - var properties PublicIPAddressPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - pia.PublicIPAddressPropertiesFormat = &properties + if pia.Etag != nil { + objectMap["etag"] = pia.Etag } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - pia.Etag = &etag + if pia.Zones != nil { + objectMap["zones"] = pia.Zones } - - v = m["zones"] - if v != nil { - var zones []string - err = json.Unmarshal(*m["zones"], &zones) - if err != nil { - return err - } - pia.Zones = &zones + if pia.ID != nil { + objectMap["id"] = pia.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - pia.ID = &ID + if pia.Name != nil { + objectMap["name"] = pia.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - pia.Name = &name + if pia.Type != nil { + objectMap["type"] = pia.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - pia.Type = &typeVar + if pia.Location != nil { + objectMap["location"] = pia.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - pia.Location = &location + if pia.Tags != nil { + objectMap["tags"] = pia.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for PublicIPAddress struct. +func (pia *PublicIPAddress) 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 "sku": + if v != nil { + var sku PublicIPAddressSku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + pia.Sku = &sku + } + case "properties": + if v != nil { + var publicIPAddressPropertiesFormat PublicIPAddressPropertiesFormat + err = json.Unmarshal(*v, &publicIPAddressPropertiesFormat) + if err != nil { + return err + } + pia.PublicIPAddressPropertiesFormat = &publicIPAddressPropertiesFormat + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + pia.Etag = &etag + } + case "zones": + if v != nil { + var zones []string + err = json.Unmarshal(*v, &zones) + if err != nil { + return err + } + pia.Zones = &zones + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pia.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pia.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pia.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + pia.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + pia.Tags = tags + } } - pia.Tags = &tags } return nil @@ -8835,26 +9724,44 @@ func (future PublicIPAddressesCreateOrUpdateFuture) Result(client PublicIPAddres var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.PublicIPAddressesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return pia, autorest.NewError("network.PublicIPAddressesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return pia, azure.NewAsyncOpIncompleteError("network.PublicIPAddressesCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { pia, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.PublicIPAddressesCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.PublicIPAddressesCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } pia, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.PublicIPAddressesCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } -// PublicIPAddressesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// PublicIPAddressesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type PublicIPAddressesDeleteFuture struct { azure.Future req *http.Request @@ -8866,22 +9773,39 @@ func (future PublicIPAddressesDeleteFuture) Result(client PublicIPAddressesClien var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.PublicIPAddressesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("network.PublicIPAddressesDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("network.PublicIPAddressesDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.PublicIPAddressesDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.PublicIPAddressesDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.PublicIPAddressesDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -8898,22 +9822,39 @@ func (future PublicIPAddressesUpdateTagsFuture) Result(client PublicIPAddressesC var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.PublicIPAddressesUpdateTagsFuture", "Result", future.Response(), "Polling failure") return } if !done { - return pia, autorest.NewError("network.PublicIPAddressesUpdateTagsFuture", "Result", "asynchronous operation has not completed") + return pia, azure.NewAsyncOpIncompleteError("network.PublicIPAddressesUpdateTagsFuture") } if future.PollingMethod() == azure.PollingLocation { pia, err = client.UpdateTagsResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.PublicIPAddressesUpdateTagsFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.PublicIPAddressesUpdateTagsFuture", "Result", resp, "Failure sending request") return } pia, err = client.UpdateTagsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.PublicIPAddressesUpdateTagsFuture", "Result", resp, "Failure responding to request") + } return } @@ -9062,19 +10003,40 @@ type Resource struct { // Location - Resource location. Location *string `json:"location,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.ID != nil { + objectMap["id"] = r.ID + } + if r.Name != nil { + objectMap["name"] = r.Name + } + if r.Type != nil { + objectMap["type"] = r.Type + } + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) } // ResourceNavigationLink resourceNavigationLink resource. type ResourceNavigationLink struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` // ResourceNavigationLinkFormat - Resource navigation link properties format. *ResourceNavigationLinkFormat `json:"properties,omitempty"` // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` // Etag - A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ResourceNavigationLink struct. @@ -9084,46 +10046,45 @@ func (rnl *ResourceNavigationLink) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ResourceNavigationLinkFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - rnl.ResourceNavigationLinkFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - rnl.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - rnl.Etag = &etag - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var resourceNavigationLinkFormat ResourceNavigationLinkFormat + err = json.Unmarshal(*v, &resourceNavigationLinkFormat) + if err != nil { + return err + } + rnl.ResourceNavigationLinkFormat = &resourceNavigationLinkFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rnl.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + rnl.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rnl.ID = &ID + } } - rnl.ID = &ID } return nil @@ -9150,14 +10111,14 @@ type RetentionPolicyParameters struct { // Route route resource type Route struct { autorest.Response `json:"-"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` // RoutePropertiesFormat - Properties of the route. *RoutePropertiesFormat `json:"properties,omitempty"` // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` // Etag - A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for Route struct. @@ -9167,46 +10128,45 @@ func (r *Route) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties RoutePropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - r.RoutePropertiesFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - r.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - r.Etag = &etag - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var routePropertiesFormat RoutePropertiesFormat + err = json.Unmarshal(*v, &routePropertiesFormat) + if err != nil { + return err + } + r.RoutePropertiesFormat = &routePropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + r.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + r.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + r.ID = &ID + } } - r.ID = &ID } return nil @@ -9214,7 +10174,10 @@ func (r *Route) UnmarshalJSON(body []byte) error { // RouteFilter route Filter Resource. type RouteFilter struct { - autorest.Response `json:"-"` + autorest.Response `json:"-"` + *RouteFilterPropertiesFormat `json:"properties,omitempty"` + // Etag - Gets a unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. @@ -9224,89 +10187,109 @@ type RouteFilter struct { // Location - Resource location. Location *string `json:"location,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - *RouteFilterPropertiesFormat `json:"properties,omitempty"` - // Etag - Gets a unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for RouteFilter struct. -func (rf *RouteFilter) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for RouteFilter. +func (rf RouteFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rf.RouteFilterPropertiesFormat != nil { + objectMap["properties"] = rf.RouteFilterPropertiesFormat } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties RouteFilterPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - rf.RouteFilterPropertiesFormat = &properties + if rf.Etag != nil { + objectMap["etag"] = rf.Etag } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - rf.Etag = &etag + if rf.ID != nil { + objectMap["id"] = rf.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - rf.ID = &ID + if rf.Name != nil { + objectMap["name"] = rf.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - rf.Name = &name + if rf.Type != nil { + objectMap["type"] = rf.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - rf.Type = &typeVar + if rf.Location != nil { + objectMap["location"] = rf.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - rf.Location = &location + if rf.Tags != nil { + objectMap["tags"] = rf.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for RouteFilter struct. +func (rf *RouteFilter) 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 "properties": + if v != nil { + var routeFilterPropertiesFormat RouteFilterPropertiesFormat + err = json.Unmarshal(*v, &routeFilterPropertiesFormat) + if err != nil { + return err + } + rf.RouteFilterPropertiesFormat = &routeFilterPropertiesFormat + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + rf.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rf.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rf.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rf.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rf.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + rf.Tags = tags + } } - rf.Tags = &tags } return nil @@ -9426,9 +10409,7 @@ type RouteFilterPropertiesFormat struct { // RouteFilterRule route Filter Rule Resource type RouteFilterRule struct { - autorest.Response `json:"-"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` + autorest.Response `json:"-"` *RouteFilterRulePropertiesFormat `json:"properties,omitempty"` // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` @@ -9437,76 +10418,99 @@ type RouteFilterRule struct { // Etag - A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for RouteFilterRule struct. -func (rfr *RouteFilterRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for RouteFilterRule. +func (rfr RouteFilterRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rfr.RouteFilterRulePropertiesFormat != nil { + objectMap["properties"] = rfr.RouteFilterRulePropertiesFormat } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties RouteFilterRulePropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - rfr.RouteFilterRulePropertiesFormat = &properties + if rfr.Name != nil { + objectMap["name"] = rfr.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - rfr.Name = &name + if rfr.Location != nil { + objectMap["location"] = rfr.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - rfr.Location = &location + if rfr.Etag != nil { + objectMap["etag"] = rfr.Etag } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - rfr.Etag = &etag + if rfr.Tags != nil { + objectMap["tags"] = rfr.Tags } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - rfr.Tags = &tags + if rfr.ID != nil { + objectMap["id"] = rfr.ID } + return json.Marshal(objectMap) +} - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for RouteFilterRule struct. +func (rfr *RouteFilterRule) 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 "properties": + if v != nil { + var routeFilterRulePropertiesFormat RouteFilterRulePropertiesFormat + err = json.Unmarshal(*v, &routeFilterRulePropertiesFormat) + if err != nil { + return err + } + rfr.RouteFilterRulePropertiesFormat = &routeFilterRulePropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rfr.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rfr.Location = &location + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + rfr.Etag = &etag + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + rfr.Tags = tags + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rfr.ID = &ID + } } - rfr.ID = &ID } return nil @@ -9639,26 +10643,44 @@ func (future RouteFilterRulesCreateOrUpdateFuture) Result(client RouteFilterRule var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteFilterRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return rfr, autorest.NewError("network.RouteFilterRulesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return rfr, azure.NewAsyncOpIncompleteError("network.RouteFilterRulesCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { rfr, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteFilterRulesCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } - var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + var req *http.Request + var resp *http.Response + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteFilterRulesCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } rfr, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteFilterRulesCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } -// RouteFilterRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// RouteFilterRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type RouteFilterRulesDeleteFuture struct { azure.Future req *http.Request @@ -9670,26 +10692,44 @@ func (future RouteFilterRulesDeleteFuture) Result(client RouteFilterRulesClient) var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteFilterRulesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("network.RouteFilterRulesDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("network.RouteFilterRulesDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteFilterRulesDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteFilterRulesDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteFilterRulesDeleteFuture", "Result", resp, "Failure responding to request") + } return } -// RouteFilterRulesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// RouteFilterRulesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type RouteFilterRulesUpdateFuture struct { azure.Future req *http.Request @@ -9701,22 +10741,39 @@ func (future RouteFilterRulesUpdateFuture) Result(client RouteFilterRulesClient) var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteFilterRulesUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return rfr, autorest.NewError("network.RouteFilterRulesUpdateFuture", "Result", "asynchronous operation has not completed") + return rfr, azure.NewAsyncOpIncompleteError("network.RouteFilterRulesUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { rfr, err = client.UpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteFilterRulesUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteFilterRulesUpdateFuture", "Result", resp, "Failure sending request") return } rfr, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteFilterRulesUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -9733,22 +10790,39 @@ func (future RouteFiltersCreateOrUpdateFuture) Result(client RouteFiltersClient) var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteFiltersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return rf, autorest.NewError("network.RouteFiltersCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return rf, azure.NewAsyncOpIncompleteError("network.RouteFiltersCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { rf, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteFiltersCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteFiltersCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } rf, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteFiltersCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -9764,22 +10838,39 @@ func (future RouteFiltersDeleteFuture) Result(client RouteFiltersClient) (ar aut var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteFiltersDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("network.RouteFiltersDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("network.RouteFiltersDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteFiltersDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteFiltersDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteFiltersDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -9795,22 +10886,39 @@ func (future RouteFiltersUpdateFuture) Result(client RouteFiltersClient) (rf Rou var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteFiltersUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return rf, autorest.NewError("network.RouteFiltersUpdateFuture", "Result", "asynchronous operation has not completed") + return rf, azure.NewAsyncOpIncompleteError("network.RouteFiltersUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { rf, err = client.UpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteFiltersUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteFiltersUpdateFuture", "Result", resp, "Failure sending request") return } rf, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteFiltersUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -9940,22 +11048,39 @@ func (future RoutesCreateOrUpdateFuture) Result(client RoutesClient) (r Route, e var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.RoutesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return r, autorest.NewError("network.RoutesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return r, azure.NewAsyncOpIncompleteError("network.RoutesCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { r, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RoutesCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.RoutesCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } r, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RoutesCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -9971,28 +11096,49 @@ func (future RoutesDeleteFuture) Result(client RoutesClient) (ar autorest.Respon var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.RoutesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("network.RoutesDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("network.RoutesDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RoutesDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.RoutesDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RoutesDeleteFuture", "Result", resp, "Failure responding to request") + } return } // RouteTable route table resource. type RouteTable struct { autorest.Response `json:"-"` + // RouteTablePropertiesFormat - Properties of the route table. + *RouteTablePropertiesFormat `json:"properties,omitempty"` + // Etag - Gets a unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. @@ -10002,90 +11148,109 @@ type RouteTable struct { // Location - Resource location. Location *string `json:"location,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // RouteTablePropertiesFormat - Properties of the route table. - *RouteTablePropertiesFormat `json:"properties,omitempty"` - // Etag - Gets a unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for RouteTable struct. -func (rt *RouteTable) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for RouteTable. +func (rt RouteTable) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rt.RouteTablePropertiesFormat != nil { + objectMap["properties"] = rt.RouteTablePropertiesFormat } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties RouteTablePropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - rt.RouteTablePropertiesFormat = &properties + if rt.Etag != nil { + objectMap["etag"] = rt.Etag } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - rt.Etag = &etag + if rt.ID != nil { + objectMap["id"] = rt.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - rt.ID = &ID + if rt.Name != nil { + objectMap["name"] = rt.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - rt.Name = &name + if rt.Type != nil { + objectMap["type"] = rt.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - rt.Type = &typeVar + if rt.Location != nil { + objectMap["location"] = rt.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - rt.Location = &location + if rt.Tags != nil { + objectMap["tags"] = rt.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for RouteTable struct. +func (rt *RouteTable) 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 "properties": + if v != nil { + var routeTablePropertiesFormat RouteTablePropertiesFormat + err = json.Unmarshal(*v, &routeTablePropertiesFormat) + if err != nil { + return err + } + rt.RouteTablePropertiesFormat = &routeTablePropertiesFormat + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + rt.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rt.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rt.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rt.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rt.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + rt.Tags = tags + } } - rt.Tags = &tags } return nil @@ -10216,22 +11381,39 @@ func (future RouteTablesCreateOrUpdateFuture) Result(client RouteTablesClient) ( var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteTablesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return rt, autorest.NewError("network.RouteTablesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return rt, azure.NewAsyncOpIncompleteError("network.RouteTablesCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { rt, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteTablesCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteTablesCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } rt, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteTablesCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -10247,26 +11429,44 @@ func (future RouteTablesDeleteFuture) Result(client RouteTablesClient) (ar autor var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteTablesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("network.RouteTablesDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("network.RouteTablesDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteTablesDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteTablesDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteTablesDeleteFuture", "Result", resp, "Failure responding to request") + } return } -// RouteTablesUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// RouteTablesUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type RouteTablesUpdateTagsFuture struct { azure.Future req *http.Request @@ -10278,28 +11478,49 @@ func (future RouteTablesUpdateTagsFuture) Result(client RouteTablesClient) (rt R var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteTablesUpdateTagsFuture", "Result", future.Response(), "Polling failure") return } if !done { - return rt, autorest.NewError("network.RouteTablesUpdateTagsFuture", "Result", "asynchronous operation has not completed") + return rt, azure.NewAsyncOpIncompleteError("network.RouteTablesUpdateTagsFuture") } if future.PollingMethod() == azure.PollingLocation { rt, err = client.UpdateTagsResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteTablesUpdateTagsFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteTablesUpdateTagsFuture", "Result", resp, "Failure sending request") return } rt, err = client.UpdateTagsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteTablesUpdateTagsFuture", "Result", resp, "Failure responding to request") + } return } // SecurityGroup networkSecurityGroup resource. type SecurityGroup struct { autorest.Response `json:"-"` + // SecurityGroupPropertiesFormat - Properties of the network security group + *SecurityGroupPropertiesFormat `json:"properties,omitempty"` + // Etag - A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. @@ -10309,90 +11530,109 @@ type SecurityGroup struct { // Location - Resource location. Location *string `json:"location,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // SecurityGroupPropertiesFormat - Properties of the network security group - *SecurityGroupPropertiesFormat `json:"properties,omitempty"` - // Etag - A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for SecurityGroup struct. -func (sg *SecurityGroup) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for SecurityGroup. +func (sg SecurityGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sg.SecurityGroupPropertiesFormat != nil { + objectMap["properties"] = sg.SecurityGroupPropertiesFormat } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties SecurityGroupPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - sg.SecurityGroupPropertiesFormat = &properties + if sg.Etag != nil { + objectMap["etag"] = sg.Etag } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - sg.Etag = &etag + if sg.ID != nil { + objectMap["id"] = sg.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - sg.ID = &ID + if sg.Name != nil { + objectMap["name"] = sg.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - sg.Name = &name + if sg.Type != nil { + objectMap["type"] = sg.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - sg.Type = &typeVar + if sg.Location != nil { + objectMap["location"] = sg.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - sg.Location = &location + if sg.Tags != nil { + objectMap["tags"] = sg.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for SecurityGroup struct. +func (sg *SecurityGroup) 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 "properties": + if v != nil { + var securityGroupPropertiesFormat SecurityGroupPropertiesFormat + err = json.Unmarshal(*v, &securityGroupPropertiesFormat) + if err != nil { + return err + } + sg.SecurityGroupPropertiesFormat = &securityGroupPropertiesFormat + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + sg.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sg.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sg.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sg.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + sg.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + sg.Tags = tags + } } - sg.Tags = &tags } return nil @@ -10536,22 +11776,39 @@ func (future SecurityGroupsCreateOrUpdateFuture) Result(client SecurityGroupsCli var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.SecurityGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return sg, autorest.NewError("network.SecurityGroupsCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return sg, azure.NewAsyncOpIncompleteError("network.SecurityGroupsCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { sg, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SecurityGroupsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.SecurityGroupsCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } sg, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SecurityGroupsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -10567,26 +11824,44 @@ func (future SecurityGroupsDeleteFuture) Result(client SecurityGroupsClient) (ar var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.SecurityGroupsDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("network.SecurityGroupsDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("network.SecurityGroupsDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SecurityGroupsDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.SecurityGroupsDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SecurityGroupsDeleteFuture", "Result", resp, "Failure responding to request") + } return } -// SecurityGroupsUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// SecurityGroupsUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type SecurityGroupsUpdateTagsFuture struct { azure.Future req *http.Request @@ -10598,22 +11873,39 @@ func (future SecurityGroupsUpdateTagsFuture) Result(client SecurityGroupsClient) var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.SecurityGroupsUpdateTagsFuture", "Result", future.Response(), "Polling failure") return } if !done { - return sg, autorest.NewError("network.SecurityGroupsUpdateTagsFuture", "Result", "asynchronous operation has not completed") + return sg, azure.NewAsyncOpIncompleteError("network.SecurityGroupsUpdateTagsFuture") } if future.PollingMethod() == azure.PollingLocation { sg, err = client.UpdateTagsResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SecurityGroupsUpdateTagsFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.SecurityGroupsUpdateTagsFuture", "Result", resp, "Failure sending request") return } sg, err = client.UpdateTagsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SecurityGroupsUpdateTagsFuture", "Result", resp, "Failure responding to request") + } return } @@ -10633,14 +11925,14 @@ type SecurityGroupViewResult struct { // SecurityRule network security rule. type SecurityRule struct { autorest.Response `json:"-"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` // SecurityRulePropertiesFormat - Properties of the security rule *SecurityRulePropertiesFormat `json:"properties,omitempty"` // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` // Etag - A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for SecurityRule struct. @@ -10650,46 +11942,45 @@ func (sr *SecurityRule) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties SecurityRulePropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - sr.SecurityRulePropertiesFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - sr.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - sr.Etag = &etag - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var securityRulePropertiesFormat SecurityRulePropertiesFormat + err = json.Unmarshal(*v, &securityRulePropertiesFormat) + if err != nil { + return err + } + sr.SecurityRulePropertiesFormat = &securityRulePropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sr.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + sr.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sr.ID = &ID + } } - sr.ID = &ID } return nil @@ -10705,8 +11996,8 @@ type SecurityRuleAssociations struct { EffectiveSecurityRules *[]EffectiveNetworkSecurityRule `json:"effectiveSecurityRules,omitempty"` } -// SecurityRuleListResult response for ListSecurityRule API service call. Retrieves all security rules that belongs to -// a network security group. +// SecurityRuleListResult response for ListSecurityRule API service call. Retrieves all security rules that belongs +// to a network security group. type SecurityRuleListResult struct { autorest.Response `json:"-"` // Value - The security rules in a network security group. @@ -10857,22 +12148,39 @@ func (future SecurityRulesCreateOrUpdateFuture) Result(client SecurityRulesClien var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.SecurityRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return sr, autorest.NewError("network.SecurityRulesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return sr, azure.NewAsyncOpIncompleteError("network.SecurityRulesCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { sr, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SecurityRulesCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.SecurityRulesCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } sr, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SecurityRulesCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -10888,22 +12196,39 @@ func (future SecurityRulesDeleteFuture) Result(client SecurityRulesClient) (ar a var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.SecurityRulesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("network.SecurityRulesDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("network.SecurityRulesDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SecurityRulesDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.SecurityRulesDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SecurityRulesDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -10926,14 +12251,14 @@ type String struct { // Subnet subnet in a virtual network resource. type Subnet struct { autorest.Response `json:"-"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` // SubnetPropertiesFormat - Properties of the subnet. *SubnetPropertiesFormat `json:"properties,omitempty"` // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` // Etag - A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for Subnet struct. @@ -10943,46 +12268,45 @@ func (s *Subnet) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties SubnetPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - s.SubnetPropertiesFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - s.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - s.Etag = &etag - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var subnetPropertiesFormat SubnetPropertiesFormat + err = json.Unmarshal(*v, &subnetPropertiesFormat) + if err != nil { + return err + } + s.SubnetPropertiesFormat = &subnetPropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + s.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + s.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + s.ID = &ID + } } - s.ID = &ID } return nil @@ -11116,7 +12440,8 @@ type SubnetPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// SubnetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// SubnetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type SubnetsCreateOrUpdateFuture struct { azure.Future req *http.Request @@ -11128,22 +12453,39 @@ func (future SubnetsCreateOrUpdateFuture) Result(client SubnetsClient) (s Subnet var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.SubnetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return s, autorest.NewError("network.SubnetsCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return s, azure.NewAsyncOpIncompleteError("network.SubnetsCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { s, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SubnetsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.SubnetsCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } s, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SubnetsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -11159,22 +12501,39 @@ func (future SubnetsDeleteFuture) Result(client SubnetsClient) (ar autorest.Resp var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.SubnetsDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("network.SubnetsDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("network.SubnetsDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SubnetsDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.SubnetsDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SubnetsDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -11187,7 +12546,16 @@ type SubResource struct { // TagsObject tags object for patch operations. type TagsObject struct { // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for TagsObject. +func (toVar TagsObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if toVar.Tags != nil { + objectMap["tags"] = toVar.Tags + } + return json.Marshal(objectMap) } // Topology topology of the specified resource group. @@ -11258,26 +12626,27 @@ func (tp *TroubleshootingParameters) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["targetResourceId"] - if v != nil { - var targetResourceID string - err = json.Unmarshal(*m["targetResourceId"], &targetResourceID) - if err != nil { - return err - } - tp.TargetResourceID = &targetResourceID - } - - v = m["properties"] - if v != nil { - var properties TroubleshootingProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "targetResourceId": + if v != nil { + var targetResourceID string + err = json.Unmarshal(*v, &targetResourceID) + if err != nil { + return err + } + tp.TargetResourceID = &targetResourceID + } + case "properties": + if v != nil { + var troubleshootingProperties TroubleshootingProperties + err = json.Unmarshal(*v, &troubleshootingProperties) + if err != nil { + return err + } + tp.TroubleshootingProperties = &troubleshootingProperties + } } - tp.TroubleshootingProperties = &properties } return nil @@ -11486,6 +12855,10 @@ type VerificationIPFlowResult struct { // VirtualNetwork virtual Network resource. type VirtualNetwork struct { autorest.Response `json:"-"` + // VirtualNetworkPropertiesFormat - Properties of the virtual network. + *VirtualNetworkPropertiesFormat `json:"properties,omitempty"` + // Etag - Gets a unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. @@ -11495,90 +12868,109 @@ type VirtualNetwork struct { // Location - Resource location. Location *string `json:"location,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // VirtualNetworkPropertiesFormat - Properties of the virtual network. - *VirtualNetworkPropertiesFormat `json:"properties,omitempty"` - // Etag - Gets a unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for VirtualNetwork struct. -func (vn *VirtualNetwork) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for VirtualNetwork. +func (vn VirtualNetwork) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vn.VirtualNetworkPropertiesFormat != nil { + objectMap["properties"] = vn.VirtualNetworkPropertiesFormat } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties VirtualNetworkPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - vn.VirtualNetworkPropertiesFormat = &properties + if vn.Etag != nil { + objectMap["etag"] = vn.Etag } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - vn.Etag = &etag + if vn.ID != nil { + objectMap["id"] = vn.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - vn.ID = &ID + if vn.Name != nil { + objectMap["name"] = vn.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - vn.Name = &name + if vn.Type != nil { + objectMap["type"] = vn.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - vn.Type = &typeVar + if vn.Location != nil { + objectMap["location"] = vn.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - vn.Location = &location + if vn.Tags != nil { + objectMap["tags"] = vn.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for VirtualNetwork struct. +func (vn *VirtualNetwork) 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 "properties": + if v != nil { + var virtualNetworkPropertiesFormat VirtualNetworkPropertiesFormat + err = json.Unmarshal(*v, &virtualNetworkPropertiesFormat) + if err != nil { + return err + } + vn.VirtualNetworkPropertiesFormat = &virtualNetworkPropertiesFormat + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + vn.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vn.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vn.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vn.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + vn.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vn.Tags = tags + } } - vn.Tags = &tags } return nil @@ -11593,6 +12985,10 @@ type VirtualNetworkConnectionGatewayReference struct { // VirtualNetworkGateway a common class for general resource information type VirtualNetworkGateway struct { autorest.Response `json:"-"` + // VirtualNetworkGatewayPropertiesFormat - Properties of the virtual network gateway. + *VirtualNetworkGatewayPropertiesFormat `json:"properties,omitempty"` + // Etag - Gets a unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. @@ -11602,90 +12998,109 @@ type VirtualNetworkGateway struct { // Location - Resource location. Location *string `json:"location,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // VirtualNetworkGatewayPropertiesFormat - Properties of the virtual network gateway. - *VirtualNetworkGatewayPropertiesFormat `json:"properties,omitempty"` - // Etag - Gets a unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGateway struct. -func (vng *VirtualNetworkGateway) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for VirtualNetworkGateway. +func (vng VirtualNetworkGateway) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vng.VirtualNetworkGatewayPropertiesFormat != nil { + objectMap["properties"] = vng.VirtualNetworkGatewayPropertiesFormat } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties VirtualNetworkGatewayPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - vng.VirtualNetworkGatewayPropertiesFormat = &properties + if vng.Etag != nil { + objectMap["etag"] = vng.Etag } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - vng.Etag = &etag + if vng.ID != nil { + objectMap["id"] = vng.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - vng.ID = &ID + if vng.Name != nil { + objectMap["name"] = vng.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - vng.Name = &name + if vng.Type != nil { + objectMap["type"] = vng.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - vng.Type = &typeVar + if vng.Location != nil { + objectMap["location"] = vng.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - vng.Location = &location + if vng.Tags != nil { + objectMap["tags"] = vng.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGateway struct. +func (vng *VirtualNetworkGateway) 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 "properties": + if v != nil { + var virtualNetworkGatewayPropertiesFormat VirtualNetworkGatewayPropertiesFormat + err = json.Unmarshal(*v, &virtualNetworkGatewayPropertiesFormat) + if err != nil { + return err + } + vng.VirtualNetworkGatewayPropertiesFormat = &virtualNetworkGatewayPropertiesFormat + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + vng.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vng.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vng.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vng.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + vng.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vng.Tags = tags + } } - vng.Tags = &tags } return nil @@ -11694,6 +13109,10 @@ func (vng *VirtualNetworkGateway) UnmarshalJSON(body []byte) error { // VirtualNetworkGatewayConnection a common class for general resource information type VirtualNetworkGatewayConnection struct { autorest.Response `json:"-"` + // VirtualNetworkGatewayConnectionPropertiesFormat - Properties of the virtual network gateway connection. + *VirtualNetworkGatewayConnectionPropertiesFormat `json:"properties,omitempty"` + // Etag - Gets a unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. @@ -11703,90 +13122,109 @@ type VirtualNetworkGatewayConnection struct { // Location - Resource location. Location *string `json:"location,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // VirtualNetworkGatewayConnectionPropertiesFormat - Properties of the virtual network gateway connection. - *VirtualNetworkGatewayConnectionPropertiesFormat `json:"properties,omitempty"` - // Etag - Gets a unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGatewayConnection struct. -func (vngc *VirtualNetworkGatewayConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for VirtualNetworkGatewayConnection. +func (vngc VirtualNetworkGatewayConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vngc.VirtualNetworkGatewayConnectionPropertiesFormat != nil { + objectMap["properties"] = vngc.VirtualNetworkGatewayConnectionPropertiesFormat } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties VirtualNetworkGatewayConnectionPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - vngc.VirtualNetworkGatewayConnectionPropertiesFormat = &properties + if vngc.Etag != nil { + objectMap["etag"] = vngc.Etag } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - vngc.Etag = &etag + if vngc.ID != nil { + objectMap["id"] = vngc.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - vngc.ID = &ID + if vngc.Name != nil { + objectMap["name"] = vngc.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - vngc.Name = &name + if vngc.Type != nil { + objectMap["type"] = vngc.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - vngc.Type = &typeVar + if vngc.Location != nil { + objectMap["location"] = vngc.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - vngc.Location = &location + if vngc.Tags != nil { + objectMap["tags"] = vngc.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGatewayConnection struct. +func (vngc *VirtualNetworkGatewayConnection) 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 "properties": + if v != nil { + var virtualNetworkGatewayConnectionPropertiesFormat VirtualNetworkGatewayConnectionPropertiesFormat + err = json.Unmarshal(*v, &virtualNetworkGatewayConnectionPropertiesFormat) + if err != nil { + return err + } + vngc.VirtualNetworkGatewayConnectionPropertiesFormat = &virtualNetworkGatewayConnectionPropertiesFormat + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + vngc.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vngc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vngc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vngc.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + vngc.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vngc.Tags = tags + } } - vngc.Tags = &tags } return nil @@ -11795,6 +13233,10 @@ func (vngc *VirtualNetworkGatewayConnection) UnmarshalJSON(body []byte) error { // VirtualNetworkGatewayConnectionListEntity a common class for general resource information type VirtualNetworkGatewayConnectionListEntity struct { autorest.Response `json:"-"` + // VirtualNetworkGatewayConnectionListEntityPropertiesFormat - Properties of the virtual network gateway connection. + *VirtualNetworkGatewayConnectionListEntityPropertiesFormat `json:"properties,omitempty"` + // Etag - Gets a unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. @@ -11804,90 +13246,109 @@ type VirtualNetworkGatewayConnectionListEntity struct { // Location - Resource location. Location *string `json:"location,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // VirtualNetworkGatewayConnectionListEntityPropertiesFormat - Properties of the virtual network gateway connection. - *VirtualNetworkGatewayConnectionListEntityPropertiesFormat `json:"properties,omitempty"` - // Etag - Gets a unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGatewayConnectionListEntity struct. -func (vngcle *VirtualNetworkGatewayConnectionListEntity) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for VirtualNetworkGatewayConnectionListEntity. +func (vngcle VirtualNetworkGatewayConnectionListEntity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vngcle.VirtualNetworkGatewayConnectionListEntityPropertiesFormat != nil { + objectMap["properties"] = vngcle.VirtualNetworkGatewayConnectionListEntityPropertiesFormat } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties VirtualNetworkGatewayConnectionListEntityPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - vngcle.VirtualNetworkGatewayConnectionListEntityPropertiesFormat = &properties + if vngcle.Etag != nil { + objectMap["etag"] = vngcle.Etag } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - vngcle.Etag = &etag + if vngcle.ID != nil { + objectMap["id"] = vngcle.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - vngcle.ID = &ID + if vngcle.Name != nil { + objectMap["name"] = vngcle.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - vngcle.Name = &name + if vngcle.Type != nil { + objectMap["type"] = vngcle.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - vngcle.Type = &typeVar + if vngcle.Location != nil { + objectMap["location"] = vngcle.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - vngcle.Location = &location + if vngcle.Tags != nil { + objectMap["tags"] = vngcle.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGatewayConnectionListEntity struct. +func (vngcle *VirtualNetworkGatewayConnectionListEntity) 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 "properties": + if v != nil { + var virtualNetworkGatewayConnectionListEntityPropertiesFormat VirtualNetworkGatewayConnectionListEntityPropertiesFormat + err = json.Unmarshal(*v, &virtualNetworkGatewayConnectionListEntityPropertiesFormat) + if err != nil { + return err + } + vngcle.VirtualNetworkGatewayConnectionListEntityPropertiesFormat = &virtualNetworkGatewayConnectionListEntityPropertiesFormat + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + vngcle.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vngcle.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vngcle.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vngcle.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + vngcle.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vngcle.Tags = tags + } } - vngcle.Tags = &tags } return nil @@ -12072,8 +13533,8 @@ type VirtualNetworkGatewayConnectionPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// VirtualNetworkGatewayConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// VirtualNetworkGatewayConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. type VirtualNetworkGatewayConnectionsCreateOrUpdateFuture struct { azure.Future req *http.Request @@ -12085,22 +13546,39 @@ func (future VirtualNetworkGatewayConnectionsCreateOrUpdateFuture) Result(client var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return vngc, autorest.NewError("network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return vngc, azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { vngc, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } vngc, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -12117,27 +13595,44 @@ func (future VirtualNetworkGatewayConnectionsDeleteFuture) Result(client Virtual var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("network.VirtualNetworkGatewayConnectionsDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsDeleteFuture", "Result", resp, "Failure responding to request") + } return } -// VirtualNetworkGatewayConnectionsResetSharedKeyFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// VirtualNetworkGatewayConnectionsResetSharedKeyFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. type VirtualNetworkGatewayConnectionsResetSharedKeyFuture struct { azure.Future req *http.Request @@ -12149,22 +13644,39 @@ func (future VirtualNetworkGatewayConnectionsResetSharedKeyFuture) Result(client var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture", "Result", future.Response(), "Polling failure") return } if !done { - return crsk, autorest.NewError("network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture", "Result", "asynchronous operation has not completed") + return crsk, azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture") } if future.PollingMethod() == azure.PollingLocation { crsk, err = client.ResetSharedKeyResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture", "Result", resp, "Failure sending request") return } crsk, err = client.ResetSharedKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture", "Result", resp, "Failure responding to request") + } return } @@ -12181,22 +13693,39 @@ func (future VirtualNetworkGatewayConnectionsSetSharedKeyFuture) Result(client V var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture", "Result", future.Response(), "Polling failure") return } if !done { - return csk, autorest.NewError("network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture", "Result", "asynchronous operation has not completed") + return csk, azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture") } if future.PollingMethod() == azure.PollingLocation { csk, err = client.SetSharedKeyResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture", "Result", resp, "Failure sending request") return } csk, err = client.SetSharedKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture", "Result", resp, "Failure responding to request") + } return } @@ -12213,35 +13742,52 @@ func (future VirtualNetworkGatewayConnectionsUpdateTagsFuture) Result(client Vir var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsUpdateTagsFuture", "Result", future.Response(), "Polling failure") return } if !done { - return vngcle, autorest.NewError("network.VirtualNetworkGatewayConnectionsUpdateTagsFuture", "Result", "asynchronous operation has not completed") + return vngcle, azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsUpdateTagsFuture") } if future.PollingMethod() == azure.PollingLocation { vngcle, err = client.UpdateTagsResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsUpdateTagsFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsUpdateTagsFuture", "Result", resp, "Failure sending request") return } vngcle, err = client.UpdateTagsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsUpdateTagsFuture", "Result", resp, "Failure responding to request") + } return } // VirtualNetworkGatewayIPConfiguration IP configuration for virtual network gateway type VirtualNetworkGatewayIPConfiguration struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` // VirtualNetworkGatewayIPConfigurationPropertiesFormat - Properties of the virtual network gateway ip configuration. *VirtualNetworkGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` // Etag - A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for VirtualNetworkGatewayIPConfiguration struct. @@ -12251,46 +13797,45 @@ func (vngic *VirtualNetworkGatewayIPConfiguration) UnmarshalJSON(body []byte) er if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties VirtualNetworkGatewayIPConfigurationPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - vngic.VirtualNetworkGatewayIPConfigurationPropertiesFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - vngic.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - vngic.Etag = &etag - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var virtualNetworkGatewayIPConfigurationPropertiesFormat VirtualNetworkGatewayIPConfigurationPropertiesFormat + err = json.Unmarshal(*v, &virtualNetworkGatewayIPConfigurationPropertiesFormat) + if err != nil { + return err + } + vngic.VirtualNetworkGatewayIPConfigurationPropertiesFormat = &virtualNetworkGatewayIPConfigurationPropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vngic.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + vngic.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vngic.ID = &ID + } } - vngic.ID = &ID } return nil @@ -12308,7 +13853,8 @@ type VirtualNetworkGatewayIPConfigurationPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// VirtualNetworkGatewayListConnectionsResult response for the VirtualNetworkGatewayListConnections API service call +// VirtualNetworkGatewayListConnectionsResult response for the VirtualNetworkGatewayListConnections API service +// call type VirtualNetworkGatewayListConnectionsResult struct { autorest.Response `json:"-"` // Value - Gets a list of VirtualNetworkGatewayConnection resources that exists in a resource group. @@ -12376,7 +13922,8 @@ func (vnglcr VirtualNetworkGatewayListConnectionsResult) virtualNetworkGatewayLi autorest.WithBaseURL(to.String(vnglcr.NextLink))) } -// VirtualNetworkGatewayListConnectionsResultPage contains a page of VirtualNetworkGatewayConnectionListEntity values. +// VirtualNetworkGatewayListConnectionsResultPage contains a page of VirtualNetworkGatewayConnectionListEntity +// values. type VirtualNetworkGatewayListConnectionsResultPage struct { fn func(VirtualNetworkGatewayListConnectionsResult) (VirtualNetworkGatewayListConnectionsResult, error) vnglcr VirtualNetworkGatewayListConnectionsResult @@ -12552,22 +14099,39 @@ func (future VirtualNetworkGatewaysCreateOrUpdateFuture) Result(client VirtualNe var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return vng, autorest.NewError("network.VirtualNetworkGatewaysCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return vng, azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { vng, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } vng, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -12584,27 +14148,44 @@ func (future VirtualNetworkGatewaysDeleteFuture) Result(client VirtualNetworkGat var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("network.VirtualNetworkGatewaysDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysDeleteFuture", "Result", resp, "Failure responding to request") + } return } -// VirtualNetworkGatewaysGeneratevpnclientpackageFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// VirtualNetworkGatewaysGeneratevpnclientpackageFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. type VirtualNetworkGatewaysGeneratevpnclientpackageFuture struct { azure.Future req *http.Request @@ -12616,22 +14197,39 @@ func (future VirtualNetworkGatewaysGeneratevpnclientpackageFuture) Result(client var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGeneratevpnclientpackageFuture", "Result", future.Response(), "Polling failure") return } if !done { - return s, autorest.NewError("network.VirtualNetworkGatewaysGeneratevpnclientpackageFuture", "Result", "asynchronous operation has not completed") + return s, azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGeneratevpnclientpackageFuture") } if future.PollingMethod() == azure.PollingLocation { s, err = client.GeneratevpnclientpackageResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGeneratevpnclientpackageFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGeneratevpnclientpackageFuture", "Result", resp, "Failure sending request") return } s, err = client.GeneratevpnclientpackageResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGeneratevpnclientpackageFuture", "Result", resp, "Failure responding to request") + } return } @@ -12648,22 +14246,39 @@ func (future VirtualNetworkGatewaysGenerateVpnProfileFuture) Result(client Virtu var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGenerateVpnProfileFuture", "Result", future.Response(), "Polling failure") return } if !done { - return s, autorest.NewError("network.VirtualNetworkGatewaysGenerateVpnProfileFuture", "Result", "asynchronous operation has not completed") + return s, azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGenerateVpnProfileFuture") } if future.PollingMethod() == azure.PollingLocation { s, err = client.GenerateVpnProfileResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGenerateVpnProfileFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGenerateVpnProfileFuture", "Result", resp, "Failure sending request") return } s, err = client.GenerateVpnProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGenerateVpnProfileFuture", "Result", resp, "Failure responding to request") + } return } @@ -12680,22 +14295,39 @@ func (future VirtualNetworkGatewaysGetAdvertisedRoutesFuture) Result(client Virt var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetAdvertisedRoutesFuture", "Result", future.Response(), "Polling failure") return } if !done { - return grlr, autorest.NewError("network.VirtualNetworkGatewaysGetAdvertisedRoutesFuture", "Result", "asynchronous operation has not completed") + return grlr, azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetAdvertisedRoutesFuture") } if future.PollingMethod() == azure.PollingLocation { grlr, err = client.GetAdvertisedRoutesResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetAdvertisedRoutesFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetAdvertisedRoutesFuture", "Result", resp, "Failure sending request") return } - grlr, err = client.GetAdvertisedRoutesResponder(resp) + grlr, err = client.GetAdvertisedRoutesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetAdvertisedRoutesFuture", "Result", resp, "Failure responding to request") + } return } @@ -12712,22 +14344,39 @@ func (future VirtualNetworkGatewaysGetBgpPeerStatusFuture) Result(client Virtual var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetBgpPeerStatusFuture", "Result", future.Response(), "Polling failure") return } if !done { - return bpslr, autorest.NewError("network.VirtualNetworkGatewaysGetBgpPeerStatusFuture", "Result", "asynchronous operation has not completed") + return bpslr, azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetBgpPeerStatusFuture") } if future.PollingMethod() == azure.PollingLocation { bpslr, err = client.GetBgpPeerStatusResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetBgpPeerStatusFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetBgpPeerStatusFuture", "Result", resp, "Failure sending request") return } bpslr, err = client.GetBgpPeerStatusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetBgpPeerStatusFuture", "Result", resp, "Failure responding to request") + } return } @@ -12744,27 +14393,44 @@ func (future VirtualNetworkGatewaysGetLearnedRoutesFuture) Result(client Virtual var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetLearnedRoutesFuture", "Result", future.Response(), "Polling failure") return } if !done { - return grlr, autorest.NewError("network.VirtualNetworkGatewaysGetLearnedRoutesFuture", "Result", "asynchronous operation has not completed") + return grlr, azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetLearnedRoutesFuture") } if future.PollingMethod() == azure.PollingLocation { grlr, err = client.GetLearnedRoutesResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetLearnedRoutesFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetLearnedRoutesFuture", "Result", resp, "Failure sending request") return } grlr, err = client.GetLearnedRoutesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetLearnedRoutesFuture", "Result", resp, "Failure responding to request") + } return } -// VirtualNetworkGatewaysGetVpnProfilePackageURLFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// VirtualNetworkGatewaysGetVpnProfilePackageURLFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. type VirtualNetworkGatewaysGetVpnProfilePackageURLFuture struct { azure.Future req *http.Request @@ -12776,22 +14442,39 @@ func (future VirtualNetworkGatewaysGetVpnProfilePackageURLFuture) Result(client var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetVpnProfilePackageURLFuture", "Result", future.Response(), "Polling failure") return } if !done { - return s, autorest.NewError("network.VirtualNetworkGatewaysGetVpnProfilePackageURLFuture", "Result", "asynchronous operation has not completed") + return s, azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetVpnProfilePackageURLFuture") } if future.PollingMethod() == azure.PollingLocation { s, err = client.GetVpnProfilePackageURLResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetVpnProfilePackageURLFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetVpnProfilePackageURLFuture", "Result", resp, "Failure sending request") return } s, err = client.GetVpnProfilePackageURLResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetVpnProfilePackageURLFuture", "Result", resp, "Failure responding to request") + } return } @@ -12818,27 +14501,44 @@ func (future VirtualNetworkGatewaysResetFuture) Result(client VirtualNetworkGate var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysResetFuture", "Result", future.Response(), "Polling failure") return } if !done { - return vng, autorest.NewError("network.VirtualNetworkGatewaysResetFuture", "Result", "asynchronous operation has not completed") + return vng, azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysResetFuture") } if future.PollingMethod() == azure.PollingLocation { vng, err = client.ResetResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysResetFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysResetFuture", "Result", resp, "Failure sending request") return } vng, err = client.ResetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysResetFuture", "Result", resp, "Failure responding to request") + } return } -// VirtualNetworkGatewaysUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// VirtualNetworkGatewaysUpdateTagsFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type VirtualNetworkGatewaysUpdateTagsFuture struct { azure.Future req *http.Request @@ -12850,22 +14550,39 @@ func (future VirtualNetworkGatewaysUpdateTagsFuture) Result(client VirtualNetwor var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysUpdateTagsFuture", "Result", future.Response(), "Polling failure") return } if !done { - return vng, autorest.NewError("network.VirtualNetworkGatewaysUpdateTagsFuture", "Result", "asynchronous operation has not completed") + return vng, azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysUpdateTagsFuture") } if future.PollingMethod() == azure.PollingLocation { vng, err = client.UpdateTagsResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysUpdateTagsFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysUpdateTagsFuture", "Result", resp, "Failure sending request") return } vng, err = client.UpdateTagsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysUpdateTagsFuture", "Result", resp, "Failure responding to request") + } return } @@ -13076,14 +14793,14 @@ func (page VirtualNetworkListUsageResultPage) Values() []VirtualNetworkUsage { // VirtualNetworkPeering peerings in a virtual network resource. type VirtualNetworkPeering struct { autorest.Response `json:"-"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` // VirtualNetworkPeeringPropertiesFormat - Properties of the virtual network peering. *VirtualNetworkPeeringPropertiesFormat `json:"properties,omitempty"` // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` // Etag - A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for VirtualNetworkPeering struct. @@ -13093,53 +14810,52 @@ func (vnp *VirtualNetworkPeering) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties VirtualNetworkPeeringPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - vnp.VirtualNetworkPeeringPropertiesFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - vnp.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - vnp.Etag = &etag - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - vnp.ID = &ID - } - - return nil -} - -// VirtualNetworkPeeringListResult response for ListSubnets API service call. Retrieves all subnets that belong to a -// virtual network. + for k, v := range m { + switch k { + case "properties": + if v != nil { + var virtualNetworkPeeringPropertiesFormat VirtualNetworkPeeringPropertiesFormat + err = json.Unmarshal(*v, &virtualNetworkPeeringPropertiesFormat) + if err != nil { + return err + } + vnp.VirtualNetworkPeeringPropertiesFormat = &virtualNetworkPeeringPropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vnp.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + vnp.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vnp.ID = &ID + } + } + } + + return nil +} + +// VirtualNetworkPeeringListResult response for ListSubnets API service call. Retrieves all subnets that belong to +// a virtual network. type VirtualNetworkPeeringListResult struct { autorest.Response `json:"-"` // Value - The peerings in a virtual network. @@ -13274,22 +14990,39 @@ func (future VirtualNetworkPeeringsCreateOrUpdateFuture) Result(client VirtualNe var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return vnp, autorest.NewError("network.VirtualNetworkPeeringsCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return vnp, azure.NewAsyncOpIncompleteError("network.VirtualNetworkPeeringsCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { vnp, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } vnp, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -13306,22 +15039,39 @@ func (future VirtualNetworkPeeringsDeleteFuture) Result(client VirtualNetworkPee var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("network.VirtualNetworkPeeringsDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("network.VirtualNetworkPeeringsDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -13358,26 +15108,44 @@ func (future VirtualNetworksCreateOrUpdateFuture) Result(client VirtualNetworksC var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return vn, autorest.NewError("network.VirtualNetworksCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return vn, azure.NewAsyncOpIncompleteError("network.VirtualNetworksCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { vn, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworksCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworksCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } vn, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworksCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } -// VirtualNetworksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// VirtualNetworksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type VirtualNetworksDeleteFuture struct { azure.Future req *http.Request @@ -13389,22 +15157,39 @@ func (future VirtualNetworksDeleteFuture) Result(client VirtualNetworksClient) ( var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworksDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("network.VirtualNetworksDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("network.VirtualNetworksDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworksDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworksDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworksDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -13421,22 +15206,39 @@ func (future VirtualNetworksUpdateTagsFuture) Result(client VirtualNetworksClien var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworksUpdateTagsFuture", "Result", future.Response(), "Polling failure") return } if !done { - return vn, autorest.NewError("network.VirtualNetworksUpdateTagsFuture", "Result", "asynchronous operation has not completed") + return vn, azure.NewAsyncOpIncompleteError("network.VirtualNetworksUpdateTagsFuture") } if future.PollingMethod() == azure.PollingLocation { vn, err = client.UpdateTagsResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworksUpdateTagsFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworksUpdateTagsFuture", "Result", resp, "Failure sending request") return } vn, err = client.UpdateTagsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworksUpdateTagsFuture", "Result", resp, "Failure responding to request") + } return } @@ -13492,14 +15294,14 @@ type VpnClientParameters struct { // VpnClientRevokedCertificate VPN client revoked certificate of virtual network gateway. type VpnClientRevokedCertificate struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` // VpnClientRevokedCertificatePropertiesFormat - Properties of the vpn client revoked certificate. *VpnClientRevokedCertificatePropertiesFormat `json:"properties,omitempty"` // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` // Etag - A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for VpnClientRevokedCertificate struct. @@ -13509,46 +15311,45 @@ func (vcrc *VpnClientRevokedCertificate) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties VpnClientRevokedCertificatePropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - vcrc.VpnClientRevokedCertificatePropertiesFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - vcrc.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - vcrc.Etag = &etag - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var vpnClientRevokedCertificatePropertiesFormat VpnClientRevokedCertificatePropertiesFormat + err = json.Unmarshal(*v, &vpnClientRevokedCertificatePropertiesFormat) + if err != nil { + return err + } + vcrc.VpnClientRevokedCertificatePropertiesFormat = &vpnClientRevokedCertificatePropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vcrc.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + vcrc.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vcrc.ID = &ID + } } - vcrc.ID = &ID } return nil @@ -13565,14 +15366,14 @@ type VpnClientRevokedCertificatePropertiesFormat struct { // VpnClientRootCertificate VPN client root certificate of virtual network gateway type VpnClientRootCertificate struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` // VpnClientRootCertificatePropertiesFormat - Properties of the vpn client root certificate. *VpnClientRootCertificatePropertiesFormat `json:"properties,omitempty"` // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` // Etag - A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } // UnmarshalJSON is the custom unmarshaler for VpnClientRootCertificate struct. @@ -13582,46 +15383,45 @@ func (vcrc *VpnClientRootCertificate) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties VpnClientRootCertificatePropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - vcrc.VpnClientRootCertificatePropertiesFormat = &properties - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - vcrc.Name = &name - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - vcrc.Etag = &etag - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var vpnClientRootCertificatePropertiesFormat VpnClientRootCertificatePropertiesFormat + err = json.Unmarshal(*v, &vpnClientRootCertificatePropertiesFormat) + if err != nil { + return err + } + vcrc.VpnClientRootCertificatePropertiesFormat = &vpnClientRootCertificatePropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vcrc.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + vcrc.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vcrc.ID = &ID + } } - vcrc.ID = &ID } return nil @@ -13648,6 +15448,9 @@ type VpnDeviceScriptParameters struct { // Watcher network watcher in a resource group. type Watcher struct { autorest.Response `json:"-"` + // Etag - A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + *WatcherPropertiesFormat `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. @@ -13657,89 +15460,109 @@ type Watcher struct { // Location - Resource location. Location *string `json:"location,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // Etag - A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - *WatcherPropertiesFormat `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for Watcher struct. -func (w *Watcher) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for Watcher. +func (w Watcher) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if w.Etag != nil { + objectMap["etag"] = w.Etag } - var v *json.RawMessage - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - w.Etag = &etag + if w.WatcherPropertiesFormat != nil { + objectMap["properties"] = w.WatcherPropertiesFormat } - - v = m["properties"] - if v != nil { - var properties WatcherPropertiesFormat - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - w.WatcherPropertiesFormat = &properties + if w.ID != nil { + objectMap["id"] = w.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - w.ID = &ID + if w.Name != nil { + objectMap["name"] = w.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - w.Name = &name + if w.Type != nil { + objectMap["type"] = w.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - w.Type = &typeVar + if w.Location != nil { + objectMap["location"] = w.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - w.Location = &location + if w.Tags != nil { + objectMap["tags"] = w.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for Watcher struct. +func (w *Watcher) 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 "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + w.Etag = &etag + } + case "properties": + if v != nil { + var watcherPropertiesFormat WatcherPropertiesFormat + err = json.Unmarshal(*v, &watcherPropertiesFormat) + if err != nil { + return err + } + w.WatcherPropertiesFormat = &watcherPropertiesFormat + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + w.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + w.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + w.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + w.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + w.Tags = tags + } } - w.Tags = &tags } return nil @@ -13770,22 +15593,39 @@ func (future WatchersCheckConnectivityFuture) Result(client WatchersClient) (ci var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersCheckConnectivityFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ci, autorest.NewError("network.WatchersCheckConnectivityFuture", "Result", "asynchronous operation has not completed") + return ci, azure.NewAsyncOpIncompleteError("network.WatchersCheckConnectivityFuture") } if future.PollingMethod() == azure.PollingLocation { ci, err = client.CheckConnectivityResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersCheckConnectivityFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersCheckConnectivityFuture", "Result", resp, "Failure sending request") return } ci, err = client.CheckConnectivityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersCheckConnectivityFuture", "Result", resp, "Failure responding to request") + } return } @@ -13801,27 +15641,44 @@ func (future WatchersDeleteFuture) Result(client WatchersClient) (ar autorest.Re var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("network.WatchersDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("network.WatchersDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersDeleteFuture", "Result", resp, "Failure responding to request") + } return } -// WatchersGetAzureReachabilityReportFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// WatchersGetAzureReachabilityReportFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type WatchersGetAzureReachabilityReportFuture struct { azure.Future req *http.Request @@ -13833,26 +15690,44 @@ func (future WatchersGetAzureReachabilityReportFuture) Result(client WatchersCli var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersGetAzureReachabilityReportFuture", "Result", future.Response(), "Polling failure") return } if !done { - return arr, autorest.NewError("network.WatchersGetAzureReachabilityReportFuture", "Result", "asynchronous operation has not completed") + return arr, azure.NewAsyncOpIncompleteError("network.WatchersGetAzureReachabilityReportFuture") } if future.PollingMethod() == azure.PollingLocation { arr, err = client.GetAzureReachabilityReportResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersGetAzureReachabilityReportFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersGetAzureReachabilityReportFuture", "Result", resp, "Failure sending request") return } arr, err = client.GetAzureReachabilityReportResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersGetAzureReachabilityReportFuture", "Result", resp, "Failure responding to request") + } return } -// WatchersGetFlowLogStatusFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// WatchersGetFlowLogStatusFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type WatchersGetFlowLogStatusFuture struct { azure.Future req *http.Request @@ -13864,22 +15739,39 @@ func (future WatchersGetFlowLogStatusFuture) Result(client WatchersClient) (fli var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersGetFlowLogStatusFuture", "Result", future.Response(), "Polling failure") return } if !done { - return fli, autorest.NewError("network.WatchersGetFlowLogStatusFuture", "Result", "asynchronous operation has not completed") + return fli, azure.NewAsyncOpIncompleteError("network.WatchersGetFlowLogStatusFuture") } if future.PollingMethod() == azure.PollingLocation { fli, err = client.GetFlowLogStatusResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersGetFlowLogStatusFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersGetFlowLogStatusFuture", "Result", resp, "Failure sending request") return } fli, err = client.GetFlowLogStatusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersGetFlowLogStatusFuture", "Result", resp, "Failure responding to request") + } return } @@ -13895,22 +15787,39 @@ func (future WatchersGetNextHopFuture) Result(client WatchersClient) (nhr NextHo var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersGetNextHopFuture", "Result", future.Response(), "Polling failure") return } if !done { - return nhr, autorest.NewError("network.WatchersGetNextHopFuture", "Result", "asynchronous operation has not completed") + return nhr, azure.NewAsyncOpIncompleteError("network.WatchersGetNextHopFuture") } if future.PollingMethod() == azure.PollingLocation { nhr, err = client.GetNextHopResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersGetNextHopFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersGetNextHopFuture", "Result", resp, "Failure sending request") return } nhr, err = client.GetNextHopResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersGetNextHopFuture", "Result", resp, "Failure responding to request") + } return } @@ -13927,27 +15836,44 @@ func (future WatchersGetTroubleshootingFuture) Result(client WatchersClient) (tr var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingFuture", "Result", future.Response(), "Polling failure") return } if !done { - return tr, autorest.NewError("network.WatchersGetTroubleshootingFuture", "Result", "asynchronous operation has not completed") + return tr, azure.NewAsyncOpIncompleteError("network.WatchersGetTroubleshootingFuture") } if future.PollingMethod() == azure.PollingLocation { tr, err = client.GetTroubleshootingResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingFuture", "Result", resp, "Failure sending request") return } tr, err = client.GetTroubleshootingResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingFuture", "Result", resp, "Failure responding to request") + } return } -// WatchersGetTroubleshootingResultFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// WatchersGetTroubleshootingResultFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type WatchersGetTroubleshootingResultFuture struct { azure.Future req *http.Request @@ -13959,22 +15885,39 @@ func (future WatchersGetTroubleshootingResultFuture) Result(client WatchersClien var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingResultFuture", "Result", future.Response(), "Polling failure") return } if !done { - return tr, autorest.NewError("network.WatchersGetTroubleshootingResultFuture", "Result", "asynchronous operation has not completed") + return tr, azure.NewAsyncOpIncompleteError("network.WatchersGetTroubleshootingResultFuture") } if future.PollingMethod() == azure.PollingLocation { tr, err = client.GetTroubleshootingResultResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingResultFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingResultFuture", "Result", resp, "Failure sending request") return } tr, err = client.GetTroubleshootingResultResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingResultFuture", "Result", resp, "Failure responding to request") + } return } @@ -13991,22 +15934,39 @@ func (future WatchersGetVMSecurityRulesFuture) Result(client WatchersClient) (sg var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersGetVMSecurityRulesFuture", "Result", future.Response(), "Polling failure") return } if !done { - return sgvr, autorest.NewError("network.WatchersGetVMSecurityRulesFuture", "Result", "asynchronous operation has not completed") + return sgvr, azure.NewAsyncOpIncompleteError("network.WatchersGetVMSecurityRulesFuture") } if future.PollingMethod() == azure.PollingLocation { sgvr, err = client.GetVMSecurityRulesResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersGetVMSecurityRulesFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersGetVMSecurityRulesFuture", "Result", resp, "Failure sending request") return } sgvr, err = client.GetVMSecurityRulesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersGetVMSecurityRulesFuture", "Result", resp, "Failure responding to request") + } return } @@ -14023,22 +15983,39 @@ func (future WatchersListAvailableProvidersFuture) Result(client WatchersClient) var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersListAvailableProvidersFuture", "Result", future.Response(), "Polling failure") return } if !done { - return apl, autorest.NewError("network.WatchersListAvailableProvidersFuture", "Result", "asynchronous operation has not completed") + return apl, azure.NewAsyncOpIncompleteError("network.WatchersListAvailableProvidersFuture") } if future.PollingMethod() == azure.PollingLocation { apl, err = client.ListAvailableProvidersResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersListAvailableProvidersFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersListAvailableProvidersFuture", "Result", resp, "Failure sending request") return } apl, err = client.ListAvailableProvidersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersListAvailableProvidersFuture", "Result", resp, "Failure responding to request") + } return } @@ -14055,22 +16032,39 @@ func (future WatchersSetFlowLogConfigurationFuture) Result(client WatchersClient var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersSetFlowLogConfigurationFuture", "Result", future.Response(), "Polling failure") return } if !done { - return fli, autorest.NewError("network.WatchersSetFlowLogConfigurationFuture", "Result", "asynchronous operation has not completed") + return fli, azure.NewAsyncOpIncompleteError("network.WatchersSetFlowLogConfigurationFuture") } if future.PollingMethod() == azure.PollingLocation { fli, err = client.SetFlowLogConfigurationResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersSetFlowLogConfigurationFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersSetFlowLogConfigurationFuture", "Result", resp, "Failure sending request") return } fli, err = client.SetFlowLogConfigurationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersSetFlowLogConfigurationFuture", "Result", resp, "Failure responding to request") + } return } @@ -14086,21 +16080,38 @@ func (future WatchersVerifyIPFlowFuture) Result(client WatchersClient) (vifr Ver var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersVerifyIPFlowFuture", "Result", future.Response(), "Polling failure") return } if !done { - return vifr, autorest.NewError("network.WatchersVerifyIPFlowFuture", "Result", "asynchronous operation has not completed") + return vifr, azure.NewAsyncOpIncompleteError("network.WatchersVerifyIPFlowFuture") } if future.PollingMethod() == azure.PollingLocation { vifr, err = client.VerifyIPFlowResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersVerifyIPFlowFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersVerifyIPFlowFuture", "Result", resp, "Failure sending request") return } vifr, err = client.VerifyIPFlowResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersVerifyIPFlowFuture", "Result", resp, "Failure responding to request") + } return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/packetcaptures.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/packetcaptures.go index fb3ff772b1b2..251cc53a6251 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/packetcaptures.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/packetcaptures.go @@ -43,8 +43,8 @@ func NewPacketCapturesClientWithBaseURI(baseURI string, subscriptionID string) P // Create create and start a packet capture on the specified VM. // // resourceGroupName is the name of the resource group. networkWatcherName is the name of the network watcher. -// packetCaptureName is the name of the packet capture session. parameters is parameters that define the create packet -// capture operation. +// packetCaptureName is the name of the packet capture session. parameters is parameters that define the create +// packet capture operation. func (client PacketCapturesClient) Create(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, parameters PacketCapture) (result PacketCapturesCreateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -52,7 +52,7 @@ func (client PacketCapturesClient) Create(ctx context.Context, resourceGroupName Chain: []validation.Constraint{{Target: "parameters.PacketCaptureParameters.Target", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.PacketCaptureParameters.StorageLocation", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "network.PacketCapturesClient", "Create") + return result, validation.NewError("network.PacketCapturesClient", "Create", err.Error()) } req, err := client.CreatePreparer(ctx, resourceGroupName, networkWatcherName, packetCaptureName, parameters) @@ -261,8 +261,8 @@ func (client PacketCapturesClient) GetResponder(resp *http.Response) (result Pac // GetStatus query the status of a running packet capture session. // -// resourceGroupName is the name of the resource group. networkWatcherName is the name of the Network Watcher resource. -// packetCaptureName is the name given to the packet capture session. +// resourceGroupName is the name of the resource group. networkWatcherName is the name of the Network Watcher +// resource. packetCaptureName is the name given to the packet capture session. func (client PacketCapturesClient) GetStatus(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string) (result PacketCapturesGetStatusFuture, err error) { req, err := client.GetStatusPreparer(ctx, resourceGroupName, networkWatcherName, packetCaptureName) if err != nil { @@ -331,7 +331,8 @@ func (client PacketCapturesClient) GetStatusResponder(resp *http.Response) (resu // List lists all packet capture sessions within the specified resource group. // -// resourceGroupName is the name of the resource group. networkWatcherName is the name of the Network Watcher resource. +// resourceGroupName is the name of the resource group. networkWatcherName is the name of the Network Watcher +// resource. func (client PacketCapturesClient) List(ctx context.Context, resourceGroupName string, networkWatcherName string) (result PacketCaptureListResult, err error) { req, err := client.ListPreparer(ctx, resourceGroupName, networkWatcherName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/publicipaddresses.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/publicipaddresses.go index af49c3e633bf..c1ed81ffc9a6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/publicipaddresses.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/publicipaddresses.go @@ -53,7 +53,7 @@ func (client PublicIPAddressesClient) CreateOrUpdate(ctx context.Context, resour Chain: []validation.Constraint{{Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.PublicIPAddress", Name: validation.Null, Rule: false, Chain: nil}}}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "network.PublicIPAddressesClient", "CreateOrUpdate") + return result, validation.NewError("network.PublicIPAddressesClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, publicIPAddressName, parameters) @@ -261,10 +261,10 @@ func (client PublicIPAddressesClient) GetResponder(resp *http.Response) (result // GetVirtualMachineScaleSetPublicIPAddress get the specified public IP address in a virtual machine scale set. // -// resourceGroupName is the name of the resource group. virtualMachineScaleSetName is the name of the virtual machine -// scale set. virtualmachineIndex is the virtual machine index. networkInterfaceName is the name of the network -// interface. IPConfigurationName is the name of the IP configuration. publicIPAddressName is the name of the public IP -// Address. expand is expands referenced resources. +// resourceGroupName is the name of the resource group. virtualMachineScaleSetName is the name of the virtual +// machine scale set. virtualmachineIndex is the virtual machine index. networkInterfaceName is the name of the +// network interface. IPConfigurationName is the name of the IP configuration. publicIPAddressName is the name of +// the public IP Address. expand is expands referenced resources. func (client PublicIPAddressesClient) GetVirtualMachineScaleSetPublicIPAddress(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, IPConfigurationName string, publicIPAddressName string, expand string) (result PublicIPAddress, err error) { req, err := client.GetVirtualMachineScaleSetPublicIPAddressPreparer(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, IPConfigurationName, publicIPAddressName, expand) if err != nil { @@ -521,8 +521,8 @@ func (client PublicIPAddressesClient) ListAllComplete(ctx context.Context) (resu // ListVirtualMachineScaleSetPublicIPAddresses gets information about all public IP addresses on a virtual machine // scale set level. // -// resourceGroupName is the name of the resource group. virtualMachineScaleSetName is the name of the virtual machine -// scale set. +// resourceGroupName is the name of the resource group. virtualMachineScaleSetName is the name of the virtual +// machine scale set. func (client PublicIPAddressesClient) ListVirtualMachineScaleSetPublicIPAddresses(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string) (result PublicIPAddressListResultPage, err error) { result.fn = client.listVirtualMachineScaleSetPublicIPAddressesNextResults req, err := client.ListVirtualMachineScaleSetPublicIPAddressesPreparer(ctx, resourceGroupName, virtualMachineScaleSetName) @@ -617,9 +617,9 @@ func (client PublicIPAddressesClient) ListVirtualMachineScaleSetPublicIPAddresse // ListVirtualMachineScaleSetVMPublicIPAddresses gets information about all public IP addresses in a virtual machine IP // configuration in a virtual machine scale set. // -// resourceGroupName is the name of the resource group. virtualMachineScaleSetName is the name of the virtual machine -// scale set. virtualmachineIndex is the virtual machine index. networkInterfaceName is the network interface name. -// IPConfigurationName is the IP configuration name. +// resourceGroupName is the name of the resource group. virtualMachineScaleSetName is the name of the virtual +// machine scale set. virtualmachineIndex is the virtual machine index. networkInterfaceName is the network +// interface name. IPConfigurationName is the IP configuration name. func (client PublicIPAddressesClient) ListVirtualMachineScaleSetVMPublicIPAddresses(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, IPConfigurationName string) (result PublicIPAddressListResultPage, err error) { result.fn = client.listVirtualMachineScaleSetVMPublicIPAddressesNextResults req, err := client.ListVirtualMachineScaleSetVMPublicIPAddressesPreparer(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, IPConfigurationName) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/routefilterrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/routefilterrules.go index 7999f8de3d6b..ee226709f133 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/routefilterrules.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/routefilterrules.go @@ -42,9 +42,9 @@ func NewRouteFilterRulesClientWithBaseURI(baseURI string, subscriptionID string) // CreateOrUpdate creates or updates a route in the specified route filter. // -// resourceGroupName is the name of the resource group. routeFilterName is the name of the route filter. ruleName is -// the name of the route filter rule. routeFilterRuleParameters is parameters supplied to the create or update route -// filter rule operation. +// resourceGroupName is the name of the resource group. routeFilterName is the name of the route filter. ruleName +// is the name of the route filter rule. routeFilterRuleParameters is parameters supplied to the create or update +// route filter rule operation. func (client RouteFilterRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, routeFilterRuleParameters RouteFilterRule) (result RouteFilterRulesCreateOrUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: routeFilterRuleParameters, @@ -52,7 +52,7 @@ func (client RouteFilterRulesClient) CreateOrUpdate(ctx context.Context, resourc Chain: []validation.Constraint{{Target: "routeFilterRuleParameters.RouteFilterRulePropertiesFormat.RouteFilterRuleType", Name: validation.Null, Rule: true, Chain: nil}, {Target: "routeFilterRuleParameters.RouteFilterRulePropertiesFormat.Communities", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "network.RouteFilterRulesClient", "CreateOrUpdate") + return result, validation.NewError("network.RouteFilterRulesClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters) @@ -124,8 +124,8 @@ func (client RouteFilterRulesClient) CreateOrUpdateResponder(resp *http.Response // Delete deletes the specified rule from a route filter. // -// resourceGroupName is the name of the resource group. routeFilterName is the name of the route filter. ruleName is -// the name of the rule. +// resourceGroupName is the name of the resource group. routeFilterName is the name of the route filter. ruleName +// is the name of the rule. func (client RouteFilterRulesClient) Delete(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string) (result RouteFilterRulesDeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, routeFilterName, ruleName) if err != nil { @@ -193,8 +193,8 @@ func (client RouteFilterRulesClient) DeleteResponder(resp *http.Response) (resul // Get gets the specified rule from a route filter. // -// resourceGroupName is the name of the resource group. routeFilterName is the name of the route filter. ruleName is -// the name of the rule. +// resourceGroupName is the name of the resource group. routeFilterName is the name of the route filter. ruleName +// is the name of the rule. func (client RouteFilterRulesClient) Get(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string) (result RouteFilterRule, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, routeFilterName, ruleName) if err != nil { @@ -355,9 +355,9 @@ func (client RouteFilterRulesClient) ListByRouteFilterComplete(ctx context.Conte // Update updates a route in the specified route filter. // -// resourceGroupName is the name of the resource group. routeFilterName is the name of the route filter. ruleName is -// the name of the route filter rule. routeFilterRuleParameters is parameters supplied to the update route filter rule -// operation. +// resourceGroupName is the name of the resource group. routeFilterName is the name of the route filter. ruleName +// is the name of the route filter rule. routeFilterRuleParameters is parameters supplied to the update route +// filter rule operation. func (client RouteFilterRulesClient) Update(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, routeFilterRuleParameters PatchRouteFilterRule) (result RouteFilterRulesUpdateFuture, err error) { req, err := client.UpdatePreparer(ctx, resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/routes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/routes.go index 126b85c549aa..d1d2fc928d54 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/routes.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/routes.go @@ -41,8 +41,8 @@ func NewRoutesClientWithBaseURI(baseURI string, subscriptionID string) RoutesCli // CreateOrUpdate creates or updates a route in the specified route table. // -// resourceGroupName is the name of the resource group. routeTableName is the name of the route table. routeName is the -// name of the route. routeParameters is parameters supplied to the create or update route operation. +// resourceGroupName is the name of the resource group. routeTableName is the name of the route table. routeName is +// the name of the route. routeParameters is parameters supplied to the create or update route operation. func (client RoutesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, routeTableName string, routeName string, routeParameters Route) (result RoutesCreateOrUpdateFuture, err error) { req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, routeTableName, routeName, routeParameters) if err != nil { @@ -113,8 +113,8 @@ func (client RoutesClient) CreateOrUpdateResponder(resp *http.Response) (result // Delete deletes the specified route from a route table. // -// resourceGroupName is the name of the resource group. routeTableName is the name of the route table. routeName is the -// name of the route. +// resourceGroupName is the name of the resource group. routeTableName is the name of the route table. routeName is +// the name of the route. func (client RoutesClient) Delete(ctx context.Context, resourceGroupName string, routeTableName string, routeName string) (result RoutesDeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, routeTableName, routeName) if err != nil { @@ -182,8 +182,8 @@ func (client RoutesClient) DeleteResponder(resp *http.Response) (result autorest // Get gets the specified route from a route table. // -// resourceGroupName is the name of the resource group. routeTableName is the name of the route table. routeName is the -// name of the route. +// resourceGroupName is the name of the resource group. routeTableName is the name of the route table. routeName is +// the name of the route. func (client RoutesClient) Get(ctx context.Context, resourceGroupName string, routeTableName string, routeName string) (result Route, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, routeTableName, routeName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/routetables.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/routetables.go index 9a30a7980370..ec10e23455fa 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/routetables.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/routetables.go @@ -41,8 +41,8 @@ func NewRouteTablesClientWithBaseURI(baseURI string, subscriptionID string) Rout // CreateOrUpdate create or updates a route table in a specified resource group. // -// resourceGroupName is the name of the resource group. routeTableName is the name of the route table. parameters is -// parameters supplied to the create or update route table operation. +// resourceGroupName is the name of the resource group. routeTableName is the name of the route table. parameters +// is parameters supplied to the create or update route table operation. func (client RouteTablesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, routeTableName string, parameters RouteTable) (result RouteTablesCreateOrUpdateFuture, err error) { req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, routeTableName, parameters) if err != nil { @@ -432,8 +432,8 @@ func (client RouteTablesClient) ListAllComplete(ctx context.Context) (result Rou // UpdateTags updates a route table tags. // -// resourceGroupName is the name of the resource group. routeTableName is the name of the route table. parameters is -// parameters supplied to update route table tags. +// resourceGroupName is the name of the resource group. routeTableName is the name of the route table. parameters +// is parameters supplied to update route table tags. func (client RouteTablesClient) UpdateTags(ctx context.Context, resourceGroupName string, routeTableName string, parameters TagsObject) (result RouteTablesUpdateTagsFuture, err error) { req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, routeTableName, parameters) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/securitygroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/securitygroups.go index d6c728dacac1..4fc86116a7e2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/securitygroups.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/securitygroups.go @@ -41,8 +41,8 @@ func NewSecurityGroupsClientWithBaseURI(baseURI string, subscriptionID string) S // CreateOrUpdate creates or updates a network security group in the specified resource group. // -// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network security -// group. parameters is parameters supplied to the create or update network security group operation. +// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network +// security group. parameters is parameters supplied to the create or update network security group operation. func (client SecurityGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, parameters SecurityGroup) (result SecurityGroupsCreateOrUpdateFuture, err error) { req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, networkSecurityGroupName, parameters) if err != nil { @@ -112,8 +112,8 @@ func (client SecurityGroupsClient) CreateOrUpdateResponder(resp *http.Response) // Delete deletes the specified network security group. // -// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network security -// group. +// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network +// security group. func (client SecurityGroupsClient) Delete(ctx context.Context, resourceGroupName string, networkSecurityGroupName string) (result SecurityGroupsDeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, networkSecurityGroupName) if err != nil { @@ -180,8 +180,8 @@ func (client SecurityGroupsClient) DeleteResponder(resp *http.Response) (result // Get gets the specified network security group. // -// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network security -// group. expand is expands referenced resources. +// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network +// security group. expand is expands referenced resources. func (client SecurityGroupsClient) Get(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, expand string) (result SecurityGroup, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, networkSecurityGroupName, expand) if err != nil { @@ -433,8 +433,8 @@ func (client SecurityGroupsClient) ListAllComplete(ctx context.Context) (result // UpdateTags updates a network security group tags. // -// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network security -// group. parameters is parameters supplied to update network security group tags. +// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network +// security group. parameters is parameters supplied to update network security group tags. func (client SecurityGroupsClient) UpdateTags(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, parameters TagsObject) (result SecurityGroupsUpdateTagsFuture, err error) { req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, networkSecurityGroupName, parameters) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/securityrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/securityrules.go index ae6d0fdd36cb..caf0436dea26 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/securityrules.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/securityrules.go @@ -41,9 +41,9 @@ func NewSecurityRulesClientWithBaseURI(baseURI string, subscriptionID string) Se // CreateOrUpdate creates or updates a security rule in the specified network security group. // -// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network security -// group. securityRuleName is the name of the security rule. securityRuleParameters is parameters supplied to the -// create or update network security rule operation. +// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network +// security group. securityRuleName is the name of the security rule. securityRuleParameters is parameters supplied +// to the create or update network security rule operation. func (client SecurityRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string, securityRuleParameters SecurityRule) (result SecurityRulesCreateOrUpdateFuture, err error) { req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters) if err != nil { @@ -114,8 +114,8 @@ func (client SecurityRulesClient) CreateOrUpdateResponder(resp *http.Response) ( // Delete deletes the specified network security rule. // -// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network security -// group. securityRuleName is the name of the security rule. +// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network +// security group. securityRuleName is the name of the security rule. func (client SecurityRulesClient) Delete(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string) (result SecurityRulesDeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, networkSecurityGroupName, securityRuleName) if err != nil { @@ -183,8 +183,8 @@ func (client SecurityRulesClient) DeleteResponder(resp *http.Response) (result a // Get get the specified network security rule. // -// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network security -// group. securityRuleName is the name of the security rule. +// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network +// security group. securityRuleName is the name of the security rule. func (client SecurityRulesClient) Get(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string) (result SecurityRule, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, networkSecurityGroupName, securityRuleName) if err != nil { @@ -251,8 +251,8 @@ func (client SecurityRulesClient) GetResponder(resp *http.Response) (result Secu // List gets all security rules in a network security group. // -// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network security -// group. +// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network +// security group. func (client SecurityRulesClient) List(ctx context.Context, resourceGroupName string, networkSecurityGroupName string) (result SecurityRuleListResultPage, err error) { result.fn = client.listNextResults req, err := client.ListPreparer(ctx, resourceGroupName, networkSecurityGroupName) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/usages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/usages.go index c41e0b11d671..0fb38cab0629 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/usages.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/usages.go @@ -47,7 +47,7 @@ func (client UsagesClient) List(ctx context.Context, location string) (result Us if err := validation.Validate([]validation.Validation{ {TargetValue: location, Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._ ]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "network.UsagesClient", "List") + return result, validation.NewError("network.UsagesClient", "List", err.Error()) } result.fn = client.listNextResults diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/version.go index 150fb8fb5f69..e1fe174ca4f6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/version.go @@ -1,5 +1,7 @@ package network +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package network // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta services" + return "Azure-SDK-For-Go/" + version.Number + " network/2017-09-01" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/virtualnetworkgatewayconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/virtualnetworkgatewayconnections.go index 35794eb276d6..7a4706c95abe 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/virtualnetworkgatewayconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/virtualnetworkgatewayconnections.go @@ -43,9 +43,9 @@ func NewVirtualNetworkGatewayConnectionsClientWithBaseURI(baseURI string, subscr // CreateOrUpdate creates or updates a virtual network gateway connection in the specified resource group. // -// resourceGroupName is the name of the resource group. virtualNetworkGatewayConnectionName is the name of the virtual -// network gateway connection. parameters is parameters supplied to the create or update virtual network gateway -// connection operation. +// resourceGroupName is the name of the resource group. virtualNetworkGatewayConnectionName is the name of the +// virtual network gateway connection. parameters is parameters supplied to the create or update virtual network +// gateway connection operation. func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VirtualNetworkGatewayConnection) (result VirtualNetworkGatewayConnectionsCreateOrUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -57,7 +57,7 @@ func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdate(ctx context. {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.LocalNetworkGateway2", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.LocalNetworkGateway2.LocalNetworkGatewayPropertiesFormat", Name: validation.Null, Rule: true, Chain: nil}}}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "network.VirtualNetworkGatewayConnectionsClient", "CreateOrUpdate") + return result, validation.NewError("network.VirtualNetworkGatewayConnectionsClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters) @@ -128,8 +128,8 @@ func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdateResponder(res // Delete deletes the specified virtual network Gateway connection. // -// resourceGroupName is the name of the resource group. virtualNetworkGatewayConnectionName is the name of the virtual -// network gateway connection. +// resourceGroupName is the name of the resource group. virtualNetworkGatewayConnectionName is the name of the +// virtual network gateway connection. func (client VirtualNetworkGatewayConnectionsClient) Delete(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string) (result VirtualNetworkGatewayConnectionsDeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName) if err != nil { @@ -196,8 +196,8 @@ func (client VirtualNetworkGatewayConnectionsClient) DeleteResponder(resp *http. // Get gets the specified virtual network gateway connection by resource group. // -// resourceGroupName is the name of the resource group. virtualNetworkGatewayConnectionName is the name of the virtual -// network gateway connection. +// resourceGroupName is the name of the resource group. virtualNetworkGatewayConnectionName is the name of the +// virtual network gateway connection. func (client VirtualNetworkGatewayConnectionsClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string) (result VirtualNetworkGatewayConnection, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName) if err != nil { @@ -437,7 +437,7 @@ func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKey(ctx context. Chain: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.InclusiveMaximum, Rule: 128, Chain: nil}, {Target: "parameters.KeyLength", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "network.VirtualNetworkGatewayConnectionsClient", "ResetSharedKey") + return result, validation.NewError("network.VirtualNetworkGatewayConnectionsClient", "ResetSharedKey", err.Error()) } req, err := client.ResetSharedKeyPreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters) @@ -517,7 +517,7 @@ func (client VirtualNetworkGatewayConnectionsClient) SetSharedKey(ctx context.Co if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Value", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "network.VirtualNetworkGatewayConnectionsClient", "SetSharedKey") + return result, validation.NewError("network.VirtualNetworkGatewayConnectionsClient", "SetSharedKey", err.Error()) } req, err := client.SetSharedKeyPreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters) @@ -588,8 +588,9 @@ func (client VirtualNetworkGatewayConnectionsClient) SetSharedKeyResponder(resp // UpdateTags updates a virtual network gateway connection tags. // -// resourceGroupName is the name of the resource group. virtualNetworkGatewayConnectionName is the name of the virtual -// network gateway connection. parameters is parameters supplied to update virtual network gateway connection tags. +// resourceGroupName is the name of the resource group. virtualNetworkGatewayConnectionName is the name of the +// virtual network gateway connection. parameters is parameters supplied to update virtual network gateway +// connection tags. func (client VirtualNetworkGatewayConnectionsClient) UpdateTags(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters TagsObject) (result VirtualNetworkGatewayConnectionsUpdateTagsFuture, err error) { req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/virtualnetworkgateways.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/virtualnetworkgateways.go index 636d0f86ff39..8bac8e007d8d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/virtualnetworkgateways.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/virtualnetworkgateways.go @@ -42,13 +42,13 @@ func NewVirtualNetworkGatewaysClientWithBaseURI(baseURI string, subscriptionID s // CreateOrUpdate creates or updates a virtual network gateway in the specified resource group. // -// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual network -// gateway. parameters is parameters supplied to create or update virtual network gateway operation. +// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual +// network gateway. parameters is parameters supplied to create or update virtual network gateway operation. func (client VirtualNetworkGatewaysClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway) (result VirtualNetworkGatewaysCreateOrUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayPropertiesFormat", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "network.VirtualNetworkGatewaysClient", "CreateOrUpdate") + return result, validation.NewError("network.VirtualNetworkGatewaysClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualNetworkGatewayName, parameters) @@ -119,8 +119,8 @@ func (client VirtualNetworkGatewaysClient) CreateOrUpdateResponder(resp *http.Re // Delete deletes the specified virtual network gateway. // -// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual network -// gateway. +// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual +// network gateway. func (client VirtualNetworkGatewaysClient) Delete(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGatewaysDeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, virtualNetworkGatewayName) if err != nil { @@ -188,8 +188,9 @@ func (client VirtualNetworkGatewaysClient) DeleteResponder(resp *http.Response) // Generatevpnclientpackage generates VPN client package for P2S client of the virtual network gateway in the specified // resource group. // -// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual network -// gateway. parameters is parameters supplied to the generate virtual network gateway VPN client package operation. +// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual +// network gateway. parameters is parameters supplied to the generate virtual network gateway VPN client package +// operation. func (client VirtualNetworkGatewaysClient) Generatevpnclientpackage(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VpnClientParameters) (result VirtualNetworkGatewaysGeneratevpnclientpackageFuture, err error) { req, err := client.GeneratevpnclientpackagePreparer(ctx, resourceGroupName, virtualNetworkGatewayName, parameters) if err != nil { @@ -260,8 +261,9 @@ func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackageResponder(res // GenerateVpnProfile generates VPN profile for P2S client of the virtual network gateway in the specified resource // group. Used for IKEV2 and radius based authentication. // -// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual network -// gateway. parameters is parameters supplied to the generate virtual network gateway VPN client package operation. +// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual +// network gateway. parameters is parameters supplied to the generate virtual network gateway VPN client package +// operation. func (client VirtualNetworkGatewaysClient) GenerateVpnProfile(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VpnClientParameters) (result VirtualNetworkGatewaysGenerateVpnProfileFuture, err error) { req, err := client.GenerateVpnProfilePreparer(ctx, resourceGroupName, virtualNetworkGatewayName, parameters) if err != nil { @@ -331,8 +333,8 @@ func (client VirtualNetworkGatewaysClient) GenerateVpnProfileResponder(resp *htt // Get gets the specified virtual network gateway by resource group. // -// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual network -// gateway. +// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual +// network gateway. func (client VirtualNetworkGatewaysClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGateway, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, virtualNetworkGatewayName) if err != nil { @@ -399,8 +401,8 @@ func (client VirtualNetworkGatewaysClient) GetResponder(resp *http.Response) (re // GetAdvertisedRoutes this operation retrieves a list of routes the virtual network gateway is advertising to the // specified peer. // -// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual network -// gateway. peer is the IP address of the peer +// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual +// network gateway. peer is the IP address of the peer func (client VirtualNetworkGatewaysClient) GetAdvertisedRoutes(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, peer string) (result VirtualNetworkGatewaysGetAdvertisedRoutesFuture, err error) { req, err := client.GetAdvertisedRoutesPreparer(ctx, resourceGroupName, virtualNetworkGatewayName, peer) if err != nil { @@ -469,8 +471,8 @@ func (client VirtualNetworkGatewaysClient) GetAdvertisedRoutesResponder(resp *ht // GetBgpPeerStatus the GetBgpPeerStatus operation retrieves the status of all BGP peers. // -// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual network -// gateway. peer is the IP address of the peer to retrieve the status of. +// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual +// network gateway. peer is the IP address of the peer to retrieve the status of. func (client VirtualNetworkGatewaysClient) GetBgpPeerStatus(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, peer string) (result VirtualNetworkGatewaysGetBgpPeerStatusFuture, err error) { req, err := client.GetBgpPeerStatusPreparer(ctx, resourceGroupName, virtualNetworkGatewayName, peer) if err != nil { @@ -542,8 +544,8 @@ func (client VirtualNetworkGatewaysClient) GetBgpPeerStatusResponder(resp *http. // GetLearnedRoutes this operation retrieves a list of routes the virtual network gateway has learned, including routes // learned from BGP peers. // -// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual network -// gateway. +// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual +// network gateway. func (client VirtualNetworkGatewaysClient) GetLearnedRoutes(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGatewaysGetLearnedRoutesFuture, err error) { req, err := client.GetLearnedRoutesPreparer(ctx, resourceGroupName, virtualNetworkGatewayName) if err != nil { @@ -612,8 +614,8 @@ func (client VirtualNetworkGatewaysClient) GetLearnedRoutesResponder(resp *http. // GetVpnProfilePackageURL gets pre-generated VPN profile for P2S client of the virtual network gateway in the // specified resource group. The profile needs to be generated first using generateVpnProfile. // -// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual network -// gateway. +// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual +// network gateway. func (client VirtualNetworkGatewaysClient) GetVpnProfilePackageURL(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGatewaysGetVpnProfilePackageURLFuture, err error) { req, err := client.GetVpnProfilePackageURLPreparer(ctx, resourceGroupName, virtualNetworkGatewayName) if err != nil { @@ -774,8 +776,8 @@ func (client VirtualNetworkGatewaysClient) ListComplete(ctx context.Context, res // ListConnections gets all the connections in a virtual network gateway. // -// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual network -// gateway. +// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual +// network gateway. func (client VirtualNetworkGatewaysClient) ListConnections(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGatewayListConnectionsResultPage, err error) { result.fn = client.listConnectionsNextResults req, err := client.ListConnectionsPreparer(ctx, resourceGroupName, virtualNetworkGatewayName) @@ -869,9 +871,9 @@ func (client VirtualNetworkGatewaysClient) ListConnectionsComplete(ctx context.C // Reset resets the primary of the virtual network gateway in the specified resource group. // -// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual network -// gateway. gatewayVip is virtual network gateway vip address supplied to the begin reset of the active-active feature -// enabled gateway. +// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual +// network gateway. gatewayVip is virtual network gateway vip address supplied to the begin reset of the +// active-active feature enabled gateway. func (client VirtualNetworkGatewaysClient) Reset(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, gatewayVip string) (result VirtualNetworkGatewaysResetFuture, err error) { req, err := client.ResetPreparer(ctx, resourceGroupName, virtualNetworkGatewayName, gatewayVip) if err != nil { @@ -942,8 +944,8 @@ func (client VirtualNetworkGatewaysClient) ResetResponder(resp *http.Response) ( // SupportedVpnDevices gets a xml format representation for supported vpn devices. // -// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual network -// gateway. +// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual +// network gateway. func (client VirtualNetworkGatewaysClient) SupportedVpnDevices(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result String, err error) { req, err := client.SupportedVpnDevicesPreparer(ctx, resourceGroupName, virtualNetworkGatewayName) if err != nil { @@ -1009,8 +1011,8 @@ func (client VirtualNetworkGatewaysClient) SupportedVpnDevicesResponder(resp *ht // UpdateTags updates a virtual network gateway tags. // -// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual network -// gateway. parameters is parameters supplied to update virtual network gateway tags. +// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual +// network gateway. parameters is parameters supplied to update virtual network gateway tags. func (client VirtualNetworkGatewaysClient) UpdateTags(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters TagsObject) (result VirtualNetworkGatewaysUpdateTagsFuture, err error) { req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, virtualNetworkGatewayName, parameters) if err != nil { @@ -1080,9 +1082,9 @@ func (client VirtualNetworkGatewaysClient) UpdateTagsResponder(resp *http.Respon // VpnDeviceConfigurationScript gets a xml format representation for vpn device configuration script. // -// resourceGroupName is the name of the resource group. virtualNetworkGatewayConnectionName is the name of the virtual -// network gateway connection for which the configuration script is generated. parameters is parameters supplied to the -// generate vpn device script operation. +// resourceGroupName is the name of the resource group. virtualNetworkGatewayConnectionName is the name of the +// virtual network gateway connection for which the configuration script is generated. parameters is parameters +// supplied to the generate vpn device script operation. func (client VirtualNetworkGatewaysClient) VpnDeviceConfigurationScript(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VpnDeviceScriptParameters) (result String, err error) { req, err := client.VpnDeviceConfigurationScriptPreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/virtualnetworkpeerings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/virtualnetworkpeerings.go index 1e97457a2da7..3038875ca5eb 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/virtualnetworkpeerings.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/virtualnetworkpeerings.go @@ -42,8 +42,8 @@ func NewVirtualNetworkPeeringsClientWithBaseURI(baseURI string, subscriptionID s // CreateOrUpdate creates or updates a peering in the specified virtual network. // // resourceGroupName is the name of the resource group. virtualNetworkName is the name of the virtual network. -// virtualNetworkPeeringName is the name of the peering. virtualNetworkPeeringParameters is parameters supplied to the -// create or update virtual network peering operation. +// virtualNetworkPeeringName is the name of the peering. virtualNetworkPeeringParameters is parameters supplied to +// the create or update virtual network peering operation. func (client VirtualNetworkPeeringsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, virtualNetworkPeeringParameters VirtualNetworkPeering) (result VirtualNetworkPeeringsCreateOrUpdateFuture, err error) { req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/virtualnetworks.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/virtualnetworks.go index b005f4ce1735..405a3a23e7d5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/virtualnetworks.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/virtualnetworks.go @@ -249,8 +249,8 @@ func (client VirtualNetworksClient) DeleteResponder(resp *http.Response) (result // Get gets the specified virtual network by resource group. // -// resourceGroupName is the name of the resource group. virtualNetworkName is the name of the virtual network. expand -// is expands referenced resources. +// resourceGroupName is the name of the resource group. virtualNetworkName is the name of the virtual network. +// expand is expands referenced resources. func (client VirtualNetworksClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkName string, expand string) (result VirtualNetwork, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, virtualNetworkName, expand) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/watchers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/watchers.go index fecc8fa41100..0cbbb2bbfa53 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/watchers.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/watchers.go @@ -43,15 +43,15 @@ func NewWatchersClientWithBaseURI(baseURI string, subscriptionID string) Watcher // CheckConnectivity verifies the possibility of establishing a direct TCP connection from a virtual machine to a given // endpoint including another VM or an arbitrary remote server. // -// resourceGroupName is the name of the network watcher resource group. networkWatcherName is the name of the network -// watcher resource. parameters is parameters that determine how the connectivity check will be performed. +// resourceGroupName is the name of the network watcher resource group. networkWatcherName is the name of the +// network watcher resource. parameters is parameters that determine how the connectivity check will be performed. func (client WatchersClient) CheckConnectivity(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters ConnectivityParameters) (result WatchersCheckConnectivityFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Source", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.Source.ResourceID", Name: validation.Null, Rule: true, Chain: nil}}}, {Target: "parameters.Destination", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "network.WatchersClient", "CheckConnectivity") + return result, validation.NewError("network.WatchersClient", "CheckConnectivity", err.Error()) } req, err := client.CheckConnectivityPreparer(ctx, resourceGroupName, networkWatcherName, parameters) @@ -325,8 +325,8 @@ func (client WatchersClient) GetResponder(resp *http.Response) (result Watcher, // GetAzureReachabilityReport gets the relative latency score for internet service providers from a specified location // to Azure regions. // -// resourceGroupName is the name of the network watcher resource group. networkWatcherName is the name of the network -// watcher resource. parameters is parameters that determine Azure reachability report configuration. +// resourceGroupName is the name of the network watcher resource group. networkWatcherName is the name of the +// network watcher resource. parameters is parameters that determine Azure reachability report configuration. func (client WatchersClient) GetAzureReachabilityReport(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters AzureReachabilityReportParameters) (result WatchersGetAzureReachabilityReportFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -334,7 +334,7 @@ func (client WatchersClient) GetAzureReachabilityReport(ctx context.Context, res Chain: []validation.Constraint{{Target: "parameters.ProviderLocation.Country", Name: validation.Null, Rule: true, Chain: nil}}}, {Target: "parameters.StartTime", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.EndTime", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "network.WatchersClient", "GetAzureReachabilityReport") + return result, validation.NewError("network.WatchersClient", "GetAzureReachabilityReport", err.Error()) } req, err := client.GetAzureReachabilityReportPreparer(ctx, resourceGroupName, networkWatcherName, parameters) @@ -405,13 +405,13 @@ func (client WatchersClient) GetAzureReachabilityReportResponder(resp *http.Resp // GetFlowLogStatus queries status of flow log on a specified resource. // -// resourceGroupName is the name of the network watcher resource group. networkWatcherName is the name of the network -// watcher resource. parameters is parameters that define a resource to query flow log status. +// resourceGroupName is the name of the network watcher resource group. networkWatcherName is the name of the +// network watcher resource. parameters is parameters that define a resource to query flow log status. func (client WatchersClient) GetFlowLogStatus(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters FlowLogStatusParameters) (result WatchersGetFlowLogStatusFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.TargetResourceID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "network.WatchersClient", "GetFlowLogStatus") + return result, validation.NewError("network.WatchersClient", "GetFlowLogStatus", err.Error()) } req, err := client.GetFlowLogStatusPreparer(ctx, resourceGroupName, networkWatcherName, parameters) @@ -490,7 +490,7 @@ func (client WatchersClient) GetNextHop(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "parameters.TargetResourceID", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.SourceIPAddress", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.DestinationIPAddress", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "network.WatchersClient", "GetNextHop") + return result, validation.NewError("network.WatchersClient", "GetNextHop", err.Error()) } req, err := client.GetNextHopPreparer(ctx, resourceGroupName, networkWatcherName, parameters) @@ -567,7 +567,7 @@ func (client WatchersClient) GetTopology(ctx context.Context, resourceGroupName if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.TargetResourceGroupName", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "network.WatchersClient", "GetTopology") + return result, validation.NewError("network.WatchersClient", "GetTopology", err.Error()) } req, err := client.GetTopologyPreparer(ctx, resourceGroupName, networkWatcherName, parameters) @@ -636,8 +636,8 @@ func (client WatchersClient) GetTopologyResponder(resp *http.Response) (result T // GetTroubleshooting initiate troubleshooting on a specified resource // -// resourceGroupName is the name of the resource group. networkWatcherName is the name of the network watcher resource. -// parameters is parameters that define the resource to troubleshoot. +// resourceGroupName is the name of the resource group. networkWatcherName is the name of the network watcher +// resource. parameters is parameters that define the resource to troubleshoot. func (client WatchersClient) GetTroubleshooting(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TroubleshootingParameters) (result WatchersGetTroubleshootingFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -646,7 +646,7 @@ func (client WatchersClient) GetTroubleshooting(ctx context.Context, resourceGro Chain: []validation.Constraint{{Target: "parameters.TroubleshootingProperties.StorageID", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.TroubleshootingProperties.StoragePath", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "network.WatchersClient", "GetTroubleshooting") + return result, validation.NewError("network.WatchersClient", "GetTroubleshooting", err.Error()) } req, err := client.GetTroubleshootingPreparer(ctx, resourceGroupName, networkWatcherName, parameters) @@ -717,13 +717,13 @@ func (client WatchersClient) GetTroubleshootingResponder(resp *http.Response) (r // GetTroubleshootingResult get the last completed troubleshooting result on a specified resource // -// resourceGroupName is the name of the resource group. networkWatcherName is the name of the network watcher resource. -// parameters is parameters that define the resource to query the troubleshooting result. +// resourceGroupName is the name of the resource group. networkWatcherName is the name of the network watcher +// resource. parameters is parameters that define the resource to query the troubleshooting result. func (client WatchersClient) GetTroubleshootingResult(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters QueryTroubleshootingParameters) (result WatchersGetTroubleshootingResultFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.TargetResourceID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "network.WatchersClient", "GetTroubleshootingResult") + return result, validation.NewError("network.WatchersClient", "GetTroubleshootingResult", err.Error()) } req, err := client.GetTroubleshootingResultPreparer(ctx, resourceGroupName, networkWatcherName, parameters) @@ -800,7 +800,7 @@ func (client WatchersClient) GetVMSecurityRules(ctx context.Context, resourceGro if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.TargetResourceID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "network.WatchersClient", "GetVMSecurityRules") + return result, validation.NewError("network.WatchersClient", "GetVMSecurityRules", err.Error()) } req, err := client.GetVMSecurityRulesPreparer(ctx, resourceGroupName, networkWatcherName, parameters) @@ -998,8 +998,8 @@ func (client WatchersClient) ListAllResponder(resp *http.Response) (result Watch // ListAvailableProviders lists all available internet service providers for a specified Azure region. // -// resourceGroupName is the name of the network watcher resource group. networkWatcherName is the name of the network -// watcher resource. parameters is parameters that scope the list of available providers. +// resourceGroupName is the name of the network watcher resource group. networkWatcherName is the name of the +// network watcher resource. parameters is parameters that scope the list of available providers. func (client WatchersClient) ListAvailableProviders(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters AvailableProvidersListParameters) (result WatchersListAvailableProvidersFuture, err error) { req, err := client.ListAvailableProvidersPreparer(ctx, resourceGroupName, networkWatcherName, parameters) if err != nil { @@ -1069,8 +1069,8 @@ func (client WatchersClient) ListAvailableProvidersResponder(resp *http.Response // SetFlowLogConfiguration configures flow log on a specified resource. // -// resourceGroupName is the name of the network watcher resource group. networkWatcherName is the name of the network -// watcher resource. parameters is parameters that define the configuration of flow log. +// resourceGroupName is the name of the network watcher resource group. networkWatcherName is the name of the +// network watcher resource. parameters is parameters that define the configuration of flow log. func (client WatchersClient) SetFlowLogConfiguration(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters FlowLogInformation) (result WatchersSetFlowLogConfigurationFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -1079,7 +1079,7 @@ func (client WatchersClient) SetFlowLogConfiguration(ctx context.Context, resour Chain: []validation.Constraint{{Target: "parameters.FlowLogProperties.StorageID", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.FlowLogProperties.Enabled", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "network.WatchersClient", "SetFlowLogConfiguration") + return result, validation.NewError("network.WatchersClient", "SetFlowLogConfiguration", err.Error()) } req, err := client.SetFlowLogConfigurationPreparer(ctx, resourceGroupName, networkWatcherName, parameters) @@ -1229,7 +1229,7 @@ func (client WatchersClient) VerifyIPFlow(ctx context.Context, resourceGroupName {Target: "parameters.RemotePort", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.LocalIPAddress", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.RemoteIPAddress", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "network.WatchersClient", "VerifyIPFlow") + return result, validation.NewError("network.WatchersClient", "VerifyIPFlow", err.Error()) } req, err := client.VerifyIPFlowPreparer(ctx, resourceGroupName, networkWatcherName, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/client.go index 62f1ece0f567..2cbc44bf4686 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/client.go @@ -1,4 +1,4 @@ -// Package operationalinsights implements the Azure ARM Operationalinsights service API version . +// Package operationalinsights implements the Azure ARM Operationalinsights service API version 2015-11-01-preview. // // Operational Insights Client package operationalinsights diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/datasources.go b/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/datasources.go index 09f16403ad21..04510b700d55 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/datasources.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/datasources.go @@ -42,9 +42,9 @@ func NewDataSourcesClientWithBaseURI(baseURI string, subscriptionID string) Data // CreateOrUpdate create or update a data source. // -// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is name of -// the Log Analytics Workspace that will contain the datasource dataSourceName is the name of the datasource resource. -// parameters is the parameters required to create or update a datasource. +// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is name +// of the Log Analytics Workspace that will contain the datasource dataSourceName is the name of the datasource +// resource. parameters is the parameters required to create or update a datasource. func (client DataSourcesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceName string, parameters DataSource) (result DataSource, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -53,7 +53,7 @@ func (client DataSourcesClient) CreateOrUpdate(ctx context.Context, resourceGrou {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "operationalinsights.DataSourcesClient", "CreateOrUpdate") + return result, validation.NewError("operationalinsights.DataSourcesClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, dataSourceName, parameters) @@ -123,15 +123,15 @@ func (client DataSourcesClient) CreateOrUpdateResponder(resp *http.Response) (re // Delete deletes a data source instance. // -// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is name of -// the Log Analytics Workspace that contains the datasource. dataSourceName is name of the datasource. +// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is name +// of the Log Analytics Workspace that contains the datasource. dataSourceName is name of the datasource. func (client DataSourcesClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "operationalinsights.DataSourcesClient", "Delete") + return result, validation.NewError("operationalinsights.DataSourcesClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName, dataSourceName) @@ -198,15 +198,15 @@ func (client DataSourcesClient) DeleteResponder(resp *http.Response) (result aut // Get gets a datasource instance. // -// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is name of -// the Log Analytics Workspace that contains the datasource. dataSourceName is name of the datasource +// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is name +// of the Log Analytics Workspace that contains the datasource. dataSourceName is name of the datasource func (client DataSourcesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceName string) (result DataSource, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "operationalinsights.DataSourcesClient", "Get") + return result, validation.NewError("operationalinsights.DataSourcesClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, dataSourceName) @@ -283,7 +283,7 @@ func (client DataSourcesClient) ListByWorkspace(ctx context.Context, resourceGro 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.NewErrorWithValidationError(err, "operationalinsights.DataSourcesClient", "ListByWorkspace") + return result, validation.NewError("operationalinsights.DataSourcesClient", "ListByWorkspace", err.Error()) } result.fn = client.listByWorkspaceNextResults diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/linkedservices.go b/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/linkedservices.go index f10e32ae74b2..7199e3b57c40 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/linkedservices.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/linkedservices.go @@ -42,8 +42,8 @@ func NewLinkedServicesClientWithBaseURI(baseURI string, subscriptionID string) L // CreateOrUpdate create or update a linked service. // -// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is name of -// the Log Analytics Workspace that will contain the linkedServices resource linkedServiceName is name of the +// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is name +// of the Log Analytics Workspace that will contain the linkedServices resource linkedServiceName is name of the // linkedServices resource parameters is the parameters required to create or update a linked service. func (client LinkedServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, linkedServiceName string, parameters LinkedService) (result LinkedService, err error) { if err := validation.Validate([]validation.Validation{ @@ -54,7 +54,7 @@ func (client LinkedServicesClient) CreateOrUpdate(ctx context.Context, resourceG {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.LinkedServiceProperties", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.LinkedServiceProperties.ResourceID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "operationalinsights.LinkedServicesClient", "CreateOrUpdate") + return result, validation.NewError("operationalinsights.LinkedServicesClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, linkedServiceName, parameters) @@ -124,8 +124,8 @@ func (client LinkedServicesClient) CreateOrUpdateResponder(resp *http.Response) // Delete deletes a linked service instance. // -// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is name of -// the Log Analytics Workspace that contains the linkedServices resource linkedServiceName is name of the linked +// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is name +// of the Log Analytics Workspace that contains the linkedServices resource linkedServiceName is name of the linked // service. func (client LinkedServicesClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, linkedServiceName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ @@ -133,7 +133,7 @@ func (client LinkedServicesClient) Delete(ctx context.Context, 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.NewErrorWithValidationError(err, "operationalinsights.LinkedServicesClient", "Delete") + return result, validation.NewError("operationalinsights.LinkedServicesClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName, linkedServiceName) @@ -200,8 +200,8 @@ func (client LinkedServicesClient) DeleteResponder(resp *http.Response) (result // Get gets a linked service instance. // -// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is name of -// the Log Analytics Workspace that contains the linkedServices resource linkedServiceName is name of the linked +// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is name +// of the Log Analytics Workspace that contains the linkedServices resource linkedServiceName is name of the linked // service. func (client LinkedServicesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, linkedServiceName string) (result LinkedService, err error) { if err := validation.Validate([]validation.Validation{ @@ -209,7 +209,7 @@ func (client LinkedServicesClient) Get(ctx context.Context, resourceGroupName st 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.NewErrorWithValidationError(err, "operationalinsights.LinkedServicesClient", "Get") + return result, validation.NewError("operationalinsights.LinkedServicesClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, linkedServiceName) @@ -277,15 +277,15 @@ func (client LinkedServicesClient) GetResponder(resp *http.Response) (result Lin // ListByWorkspace gets the linked services instances in a workspace. // -// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is name of -// the Log Analytics Workspace that contains the linked services. +// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is name +// of the Log Analytics Workspace that contains the linked services. func (client LinkedServicesClient) ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result LinkedServiceListResult, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "operationalinsights.LinkedServicesClient", "ListByWorkspace") + return result, validation.NewError("operationalinsights.LinkedServicesClient", "ListByWorkspace", err.Error()) } req, err := client.ListByWorkspacePreparer(ctx, resourceGroupName, workspaceName) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/models.go index ae11df7356e2..a7f320479fe6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/models.go @@ -80,16 +80,6 @@ const ( Succeeded EntityStatus = "Succeeded" ) -// SearchSortEnum enumerates the values for search sort enum. -type SearchSortEnum string - -const ( - // Asc ... - Asc SearchSortEnum = "asc" - // Desc ... - Desc SearchSortEnum = "desc" -) - // SkuNameEnum enumerates the values for sku name enum. type SkuNameEnum string @@ -108,27 +98,15 @@ const ( Unlimited SkuNameEnum = "Unlimited" ) -// StorageInsightState enumerates the values for storage insight state. -type StorageInsightState string - -const ( - // ERROR ... - ERROR StorageInsightState = "ERROR" - // OK ... - OK StorageInsightState = "OK" -) - -// CoreSummary the core summary of a search. -type CoreSummary struct { - // Status - The status of a core summary. - Status *string `json:"Status,omitempty"` - // NumberOfDocuments - The number of documents of a core summary. - NumberOfDocuments *int64 `json:"NumberOfDocuments,omitempty"` -} - // DataSource datasources under OMS Workspace. type DataSource struct { autorest.Response `json:"-"` + // Properties - The data source properties in raw json format, each kind of data source have it's own schema. + Properties interface{} `json:"properties,omitempty"` + // ETag - The ETag of the data source. + ETag *string `json:"eTag,omitempty"` + // Kind - Possible values include: 'AzureActivityLog', 'ChangeTrackingPath', 'ChangeTrackingDefaultPath', 'ChangeTrackingDefaultRegistry', 'ChangeTrackingCustomRegistry', 'CustomLog', 'CustomLogCollection', 'GenericDataSource', 'IISLogs', 'LinuxPerformanceObject', 'LinuxPerformanceCollection', 'LinuxSyslog', 'LinuxSyslogCollection', 'WindowsEvent', 'WindowsPerformanceCounter' + Kind DataSourceKind `json:"kind,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. @@ -136,13 +114,30 @@ type DataSource struct { // Type - Resource type. Type *string `json:"type,omitempty"` // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - // Properties - The data source properties in raw json format, each kind of data source have it's own schema. - Properties *map[string]interface{} `json:"properties,omitempty"` - // ETag - The ETag of the data source. - ETag *string `json:"eTag,omitempty"` - // Kind - Possible values include: 'AzureActivityLog', 'ChangeTrackingPath', 'ChangeTrackingDefaultPath', 'ChangeTrackingDefaultRegistry', 'ChangeTrackingCustomRegistry', 'CustomLog', 'CustomLogCollection', 'GenericDataSource', 'IISLogs', 'LinuxPerformanceObject', 'LinuxPerformanceCollection', 'LinuxSyslog', 'LinuxSyslogCollection', 'WindowsEvent', 'WindowsPerformanceCounter' - Kind DataSourceKind `json:"kind,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DataSource. +func (ds DataSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = ds.Properties + if ds.ETag != nil { + objectMap["eTag"] = ds.ETag + } + objectMap["kind"] = ds.Kind + if ds.ID != nil { + objectMap["id"] = ds.ID + } + if ds.Name != nil { + objectMap["name"] = ds.Name + } + if ds.Type != nil { + objectMap["type"] = ds.Type + } + if ds.Tags != nil { + objectMap["tags"] = ds.Tags + } + return json.Marshal(objectMap) } // DataSourceFilter dataSource filter. Right now, only filter by kind is supported. @@ -259,11 +254,15 @@ type IntelligencePack struct { Name *string `json:"name,omitempty"` // Enabled - The enabled boolean for the intelligence pack. Enabled *bool `json:"enabled,omitempty"` + // DisplayName - The display name of the intelligence pack. + DisplayName *string `json:"displayName,omitempty"` } // LinkedService the top level Linked service resource container. type LinkedService struct { autorest.Response `json:"-"` + // LinkedServiceProperties - The properties of the linked service. + *LinkedServiceProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. @@ -271,9 +270,28 @@ type LinkedService struct { // Type - Resource type. Type *string `json:"type,omitempty"` // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - // LinkedServiceProperties - The properties of the linked service. - *LinkedServiceProperties `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for LinkedService. +func (ls LinkedService) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ls.LinkedServiceProperties != nil { + objectMap["properties"] = ls.LinkedServiceProperties + } + if ls.ID != nil { + objectMap["id"] = ls.ID + } + if ls.Name != nil { + objectMap["name"] = ls.Name + } + if ls.Type != nil { + objectMap["type"] = ls.Type + } + if ls.Tags != nil { + objectMap["tags"] = ls.Tags + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for LinkedService struct. @@ -283,56 +301,54 @@ func (ls *LinkedService) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties LinkedServiceProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var linkedServiceProperties LinkedServiceProperties + err = json.Unmarshal(*v, &linkedServiceProperties) + if err != nil { + return err + } + ls.LinkedServiceProperties = &linkedServiceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ls.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ls.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ls.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ls.Tags = tags + } } - ls.LinkedServiceProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - ls.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - ls.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - ls.Type = &typeVar - } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - ls.Tags = &tags } return nil @@ -351,30 +367,12 @@ type LinkedServiceProperties struct { ResourceID *string `json:"resourceId,omitempty"` } -// LinkTarget metadata for a workspace that isn't linked to an Azure subscription. -type LinkTarget struct { - // CustomerID - The GUID that uniquely identifies the workspace. - CustomerID *string `json:"customerId,omitempty"` - // DisplayName - The display name of the workspace. - DisplayName *string `json:"accountName,omitempty"` - // WorkspaceName - The DNS valid workspace name. - WorkspaceName *string `json:"workspaceName,omitempty"` - // Location - The location of the workspace. - Location *string `json:"location,omitempty"` -} - // ListIntelligencePack ... type ListIntelligencePack struct { autorest.Response `json:"-"` Value *[]IntelligencePack `json:"value,omitempty"` } -// ListLinkTarget ... -type ListLinkTarget struct { - autorest.Response `json:"-"` - Value *[]LinkTarget `json:"value,omitempty"` -} - // ManagementGroup a management group that is connected to a workspace type ManagementGroup struct { // ManagementGroupProperties - The properties of the management group. @@ -388,16 +386,18 @@ func (mg *ManagementGroup) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ManagementGroupProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var managementGroupProperties ManagementGroupProperties + err = json.Unmarshal(*v, &managementGroupProperties) + if err != nil { + return err + } + mg.ManagementGroupProperties = &managementGroupProperties + } } - mg.ManagementGroupProperties = &properties } return nil @@ -431,362 +431,42 @@ type MetricName struct { LocalizedValue *string `json:"localizedValue,omitempty"` } -// ProxyResource common properties of proxy resource. -type ProxyResource struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - Resource name. - Name *string `json:"name,omitempty"` - // Type - Resource type. - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` -} - -// Resource the resource definition. -type Resource struct { - // ID - Resource Id - ID *string `json:"id,omitempty"` - // Name - Resource name - Name *string `json:"name,omitempty"` - // Type - Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` -} - -// SavedSearch value object for saved search results. -type SavedSearch struct { - autorest.Response `json:"-"` - // ID - The id of the saved search. - ID *string `json:"id,omitempty"` - // Etag - The etag of the saved search. - Etag *string `json:"etag,omitempty"` - // SavedSearchProperties - Gets or sets properties of the saved search. - *SavedSearchProperties `json:"properties,omitempty"` -} - -// UnmarshalJSON is the custom unmarshaler for SavedSearch struct. -func (ss *SavedSearch) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - var v *json.RawMessage - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - ss.ID = &ID - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - ss.Etag = &etag - } - - v = m["properties"] - if v != nil { - var properties SavedSearchProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - ss.SavedSearchProperties = &properties - } - - return nil -} - -// SavedSearchesListResult the saved search operation response. -type SavedSearchesListResult struct { - autorest.Response `json:"-"` - // Metadata - The metadata from search results. - Metadata *SearchMetadata `json:"__metadata,omitempty"` - // Value - The array of result values. - Value *[]SavedSearch `json:"value,omitempty"` -} - -// SavedSearchProperties value object for saved search results. -type SavedSearchProperties struct { - // Category - The category of the saved search. This helps the user to find a saved search faster. - Category *string `json:"Category,omitempty"` - // DisplayName - Saved search display name. - DisplayName *string `json:"DisplayName,omitempty"` - // Query - The query expression for the saved search. Please see https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-search-reference for reference. - Query *string `json:"Query,omitempty"` - // Version - The version number of the query lanuage. Only verion 1 is allowed here. - Version *int64 `json:"Version,omitempty"` - // Tags - The tags attached to the saved search. - Tags *[]Tag `json:"Tags,omitempty"` -} - -// SearchError details for a search error. -type SearchError struct { - // Type - The error type. - Type *string `json:"type,omitempty"` - // Message - The error message. - Message *string `json:"message,omitempty"` -} - -// SearchGetSchemaResponse the get schema operation response. -type SearchGetSchemaResponse struct { - autorest.Response `json:"-"` - // Metadata - The metadata from search results. - Metadata *SearchMetadata `json:"__metadata,omitempty"` - // Value - The array of result values. - Value *[]SearchSchemaValue `json:"value,omitempty"` -} - -// SearchHighlight highlight details. -type SearchHighlight struct { - // Pre - The string that is put before a matched result. - Pre *string `json:"pre,omitempty"` - // Post - The string that is put after a matched result. - Post *string `json:"post,omitempty"` -} - -// SearchMetadata metadata for search results. -type SearchMetadata struct { - // SearchID - The request id of the search. - SearchID *string `json:"RequestId,omitempty"` - // ResultType - The search result type. - ResultType *string `json:"resultType,omitempty"` - // Total - The total number of search results. - Total *int64 `json:"total,omitempty"` - // Top - The number of top search results. - Top *int64 `json:"top,omitempty"` - // ID - The id of the search results request. - ID *string `json:"id,omitempty"` - // CoreSummaries - The core summaries. - CoreSummaries *[]CoreSummary `json:"CoreSummaries,omitempty"` - // Status - The status of the search results. - Status *string `json:"Status,omitempty"` - // StartTime - The start time for the search. - StartTime *date.Time `json:"StartTime,omitempty"` - // LastUpdated - The time of last update. - LastUpdated *date.Time `json:"LastUpdated,omitempty"` - // ETag - The ETag of the search results. - ETag *string `json:"ETag,omitempty"` - // Sort - How the results are sorted. - Sort *[]SearchSort `json:"sort,omitempty"` - // RequestTime - The request time. - RequestTime *int64 `json:"requestTime,omitempty"` - // AggregatedValueField - The aggregated value field. - AggregatedValueField *string `json:"aggregatedValueField,omitempty"` - // AggregatedGroupingFields - The aggregated grouping fields. - AggregatedGroupingFields *string `json:"aggregatedGroupingFields,omitempty"` - // Sum - The sum of all aggregates returned in the result set. - Sum *int64 `json:"sum,omitempty"` - // Max - The max of all aggregates returned in the result set. - Max *int64 `json:"max,omitempty"` - // Schema - The schema. - Schema *SearchMetadataSchema `json:"schema,omitempty"` -} - -// SearchMetadataSchema schema metadata for search. -type SearchMetadataSchema struct { - // Name - The name of the metadata schema. - Name *string `json:"name,omitempty"` - // Version - The version of the metadata schema. - Version *int32 `json:"version,omitempty"` -} - -// SearchParameters parameters specifying the search query and range. -type SearchParameters struct { - // Top - The number to get from the top. - Top *int64 `json:"top,omitempty"` - // Highlight - The highlight that looks for all occurences of a string. - Highlight *SearchHighlight `json:"highlight,omitempty"` - // Query - The query to search. - Query *string `json:"query,omitempty"` - // Start - The start date filter, so the only query results returned are after this date. - Start *date.Time `json:"start,omitempty"` - // End - The end date filter, so the only query results returned are before this date. - End *date.Time `json:"end,omitempty"` -} - -// SearchResultsResponse the get search result operation response. -type SearchResultsResponse struct { - autorest.Response `json:"-"` - // ID - The id of the search, which includes the full url. - ID *string `json:"id,omitempty"` - // Metadata - The metadata from search results. - Metadata *SearchMetadata `json:"__metadata,omitempty"` - // Value - The array of result values. - Value *[]map[string]interface{} `json:"value,omitempty"` - // Error - The error. - Error *SearchError `json:"error,omitempty"` -} - -// SearchSchemaValue value object for schema results. -type SearchSchemaValue struct { - // Name - The name of the schema. - Name *string `json:"name,omitempty"` - // DisplayName - The display name of the schema. - DisplayName *string `json:"displayName,omitempty"` - // Type - The type. - Type *string `json:"type,omitempty"` - // Indexed - The boolean that indicates the field is searchable as free text. - Indexed *bool `json:"indexed,omitempty"` - // Stored - The boolean that indicates whether or not the field is stored. - Stored *bool `json:"stored,omitempty"` - // Facet - The boolean that indicates whether or not the field is a facet. - Facet *bool `json:"facet,omitempty"` - // OwnerType - The array of workflows containing the field. - OwnerType *[]string `json:"ownerType,omitempty"` -} - -// SearchSort the sort parameters for search. -type SearchSort struct { - // Name - The name of the field the search query is sorted on. - Name *string `json:"name,omitempty"` - // Order - The sort order of the search. Possible values include: 'Asc', 'Desc' - Order SearchSortEnum `json:"order,omitempty"` -} - -// SharedKeys the shared keys for a workspace. -type SharedKeys struct { - autorest.Response `json:"-"` - // PrimarySharedKey - The primary shared key of a workspace. - PrimarySharedKey *string `json:"primarySharedKey,omitempty"` - // SecondarySharedKey - The secondary shared key of a workspace. - SecondarySharedKey *string `json:"secondarySharedKey,omitempty"` -} - -// Sku the SKU (tier) of a workspace. -type Sku struct { - // Name - The name of the SKU. Possible values include: 'Free', 'Standard', 'Premium', 'Unlimited', 'PerNode', 'Standalone' - Name SkuNameEnum `json:"name,omitempty"` -} - -// StorageAccount describes a storage account connection. -type StorageAccount struct { - // ID - The Azure Resource Manager ID of the storage account resource. - ID *string `json:"id,omitempty"` - // Key - The storage account key. - Key *string `json:"key,omitempty"` -} - -// StorageInsight the top level storage insight resource container. -type StorageInsight struct { - autorest.Response `json:"-"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - Resource name. +// Operation supported operation of OperationalInsights resource provider. +type Operation struct { + // Name - Operation name: {provider}/{resource}/{operation} Name *string `json:"name,omitempty"` - // Type - Resource type. - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - // StorageInsightProperties - Storage insight properties. - *StorageInsightProperties `json:"properties,omitempty"` - // ETag - The ETag of the storage insight. - ETag *string `json:"eTag,omitempty"` + // Display - Display metadata associated with the operation. + Display *OperationDisplay `json:"display,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for StorageInsight struct. -func (si *StorageInsight) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties StorageInsightProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - si.StorageInsightProperties = &properties - } - - v = m["eTag"] - if v != nil { - var eTag string - err = json.Unmarshal(*m["eTag"], &eTag) - if err != nil { - return err - } - si.ETag = &eTag - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - si.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - si.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - si.Type = &typeVar - } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - si.Tags = &tags - } - - return nil +// OperationDisplay display metadata associated with the operation. +type OperationDisplay struct { + // Provider - Service provider: Microsoft OperationsManagement. + Provider *string `json:"provider,omitempty"` + // Resource - Resource on which the operation is performed etc. + Resource *string `json:"resource,omitempty"` + // Operation - Type of operation: get, read, delete, etc. + Operation *string `json:"operation,omitempty"` } -// StorageInsightListResult the list storage insights operation response. -type StorageInsightListResult struct { +// OperationListResult result of the request to list solution operations. +type OperationListResult struct { autorest.Response `json:"-"` - // Value - Gets or sets a list of storage insight instances. - Value *[]StorageInsight `json:"value,omitempty"` - // OdataNextLink - The link (url) to the next page of results. - OdataNextLink *string `json:"@odata.nextLink,omitempty"` + // Value - List of solution operations supported by the OperationsManagement resource provider. + Value *[]Operation `json:"value,omitempty"` + // NextLink - URL to get the next set of operation list results if there are any. + NextLink *string `json:"nextLink,omitempty"` } -// StorageInsightListResultIterator provides access to a complete listing of StorageInsight values. -type StorageInsightListResultIterator struct { +// OperationListResultIterator provides access to a complete listing of Operation values. +type OperationListResultIterator struct { i int - page StorageInsightListResultPage + page OperationListResultPage } // Next 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 *StorageInsightListResultIterator) Next() error { +func (iter *OperationListResultIterator) Next() error { iter.i++ if iter.i < len(iter.page.Values()) { return nil @@ -801,102 +481,154 @@ func (iter *StorageInsightListResultIterator) Next() error { } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter StorageInsightListResultIterator) NotDone() bool { +func (iter OperationListResultIterator) 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 StorageInsightListResultIterator) Response() StorageInsightListResult { +func (iter OperationListResultIterator) Response() OperationListResult { 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 StorageInsightListResultIterator) Value() StorageInsight { +func (iter OperationListResultIterator) Value() Operation { if !iter.page.NotDone() { - return StorageInsight{} + return Operation{} } return iter.page.Values()[iter.i] } // IsEmpty returns true if the ListResult contains no values. -func (silr StorageInsightListResult) IsEmpty() bool { - return silr.Value == nil || len(*silr.Value) == 0 +func (olr OperationListResult) IsEmpty() bool { + return olr.Value == nil || len(*olr.Value) == 0 } -// storageInsightListResultPreparer prepares a request to retrieve the next set of results. +// operationListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (silr StorageInsightListResult) storageInsightListResultPreparer() (*http.Request, error) { - if silr.OdataNextLink == nil || len(to.String(silr.OdataNextLink)) < 1 { +func (olr OperationListResult) operationListResultPreparer() (*http.Request, error) { + if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 { return nil, nil } return autorest.Prepare(&http.Request{}, autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(silr.OdataNextLink))) + autorest.WithBaseURL(to.String(olr.NextLink))) } -// StorageInsightListResultPage contains a page of StorageInsight values. -type StorageInsightListResultPage struct { - fn func(StorageInsightListResult) (StorageInsightListResult, error) - silr StorageInsightListResult +// OperationListResultPage contains a page of Operation values. +type OperationListResultPage struct { + fn func(OperationListResult) (OperationListResult, error) + olr OperationListResult } // 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. -func (page *StorageInsightListResultPage) Next() error { - next, err := page.fn(page.silr) +func (page *OperationListResultPage) Next() error { + next, err := page.fn(page.olr) if err != nil { return err } - page.silr = next + page.olr = next return nil } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page StorageInsightListResultPage) NotDone() bool { - return !page.silr.IsEmpty() +func (page OperationListResultPage) NotDone() bool { + return !page.olr.IsEmpty() } // Response returns the raw server response from the last page request. -func (page StorageInsightListResultPage) Response() StorageInsightListResult { - return page.silr +func (page OperationListResultPage) Response() OperationListResult { + return page.olr } // Values returns the slice of values for the current page or nil if there are no values. -func (page StorageInsightListResultPage) Values() []StorageInsight { - if page.silr.IsEmpty() { +func (page OperationListResultPage) Values() []Operation { + if page.olr.IsEmpty() { return nil } - return *page.silr.Value + return *page.olr.Value +} + +// ProxyResource common properties of proxy resource. +type ProxyResource struct { + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` } -// StorageInsightProperties storage insight properties. -type StorageInsightProperties struct { - // Containers - The names of the blob containers that the workspace should read - Containers *[]string `json:"containers,omitempty"` - // Tables - The names of the Azure tables that the workspace should read - Tables *[]string `json:"tables,omitempty"` - // StorageAccount - The storage account connection details - StorageAccount *StorageAccount `json:"storageAccount,omitempty"` - // Status - The status of the storage insight - Status *StorageInsightStatus `json:"status,omitempty"` +// MarshalJSON is the custom marshaler for ProxyResource. +func (pr ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pr.ID != nil { + objectMap["id"] = pr.ID + } + if pr.Name != nil { + objectMap["name"] = pr.Name + } + if pr.Type != nil { + objectMap["type"] = pr.Type + } + if pr.Tags != nil { + objectMap["tags"] = pr.Tags + } + return json.Marshal(objectMap) } -// StorageInsightStatus the status of the storage insight. -type StorageInsightStatus struct { - // State - The state of the storage insight connection to the workspace. Possible values include: 'OK', 'ERROR' - State StorageInsightState `json:"state,omitempty"` - // Description - Description of the state of the storage insight. - Description *string `json:"description,omitempty"` +// Resource the resource definition. +type Resource struct { + // ID - Resource Id + ID *string `json:"id,omitempty"` + // Name - Resource name + Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` } -// Tag a tag of a saved search. -type Tag struct { - // Name - The tag name. - Name *string `json:"Name,omitempty"` - // Value - The tag value. - Value *string `json:"Value,omitempty"` +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.ID != nil { + objectMap["id"] = r.ID + } + if r.Name != nil { + objectMap["name"] = r.Name + } + if r.Type != nil { + objectMap["type"] = r.Type + } + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) +} + +// SharedKeys the shared keys for a workspace. +type SharedKeys struct { + autorest.Response `json:"-"` + // PrimarySharedKey - The primary shared key of a workspace. + PrimarySharedKey *string `json:"primarySharedKey,omitempty"` + // SecondarySharedKey - The secondary shared key of a workspace. + SecondarySharedKey *string `json:"secondarySharedKey,omitempty"` +} + +// Sku the SKU (tier) of a workspace. +type Sku struct { + // Name - The name of the SKU. Possible values include: 'Free', 'Standard', 'Premium', 'Unlimited', 'PerNode', 'Standalone' + Name SkuNameEnum `json:"name,omitempty"` } // UsageMetric a metric describing the usage of a resource. @@ -918,6 +650,10 @@ type UsageMetric struct { // Workspace the top level Workspace resource container. type Workspace struct { autorest.Response `json:"-"` + // WorkspaceProperties - Workspace properties. + *WorkspaceProperties `json:"properties,omitempty"` + // ETag - The ETag of the workspace. + ETag *string `json:"eTag,omitempty"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name @@ -927,90 +663,109 @@ type Workspace struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - // WorkspaceProperties - Workspace properties. - *WorkspaceProperties `json:"properties,omitempty"` - // ETag - The ETag of the workspace. - ETag *string `json:"eTag,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for Workspace struct. -func (w *Workspace) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for Workspace. +func (w Workspace) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if w.WorkspaceProperties != nil { + objectMap["properties"] = w.WorkspaceProperties } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties WorkspaceProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - w.WorkspaceProperties = &properties + if w.ETag != nil { + objectMap["eTag"] = w.ETag } - - v = m["eTag"] - if v != nil { - var eTag string - err = json.Unmarshal(*m["eTag"], &eTag) - if err != nil { - return err - } - w.ETag = &eTag + if w.ID != nil { + objectMap["id"] = w.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - w.ID = &ID + if w.Name != nil { + objectMap["name"] = w.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - w.Name = &name + if w.Type != nil { + objectMap["type"] = w.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - w.Type = &typeVar + if w.Location != nil { + objectMap["location"] = w.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - w.Location = &location + if w.Tags != nil { + objectMap["tags"] = w.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for Workspace struct. +func (w *Workspace) 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 "properties": + if v != nil { + var workspaceProperties WorkspaceProperties + err = json.Unmarshal(*v, &workspaceProperties) + if err != nil { + return err + } + w.WorkspaceProperties = &workspaceProperties + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + w.ETag = &eTag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + w.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + w.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + w.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + w.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + w.Tags = tags + } } - w.Tags = &tags } return nil @@ -1053,7 +808,8 @@ type WorkspaceProperties struct { RetentionInDays *int32 `json:"retentionInDays,omitempty"` } -// WorkspacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// WorkspacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type WorkspacesCreateOrUpdateFuture struct { azure.Future req *http.Request @@ -1065,53 +821,38 @@ func (future WorkspacesCreateOrUpdateFuture) Result(client WorkspacesClient) (w var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return w, autorest.NewError("operationalinsights.WorkspacesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return w, azure.NewAsyncOpIncompleteError("operationalinsights.WorkspacesCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { w, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } w, err = client.CreateOrUpdateResponder(resp) - return -} - -// WorkspacesGetSearchResultsFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type WorkspacesGetSearchResultsFuture struct { - azure.Future - req *http.Request -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future WorkspacesGetSearchResultsFuture) Result(client WorkspacesClient) (srr SearchResultsResponse, err error) { - var done bool - done, err = future.Done(client) - if err != nil { - return - } - if !done { - return srr, autorest.NewError("operationalinsights.WorkspacesGetSearchResultsFuture", "Result", "asynchronous operation has not completed") - } - if future.PollingMethod() == azure.PollingLocation { - srr, err = client.GetSearchResultsResponder(future.Response()) - return - } - var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { - return + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesCreateOrUpdateFuture", "Result", resp, "Failure responding to request") } - srr, err = client.GetSearchResultsResponder(resp) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/operations.go new file mode 100644 index 000000000000..3df445e34f5f --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/operations.go @@ -0,0 +1,126 @@ +package operationalinsights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" + "net/http" +) + +// OperationsClient is the operational Insights Client +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client. +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all of the available OperationalInsights Rest API operations. +func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.olr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.olr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2015-11-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.OperationalInsights/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(lastResults OperationListResult) (result OperationListResult, err error) { + req, err := lastResults.operationListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "operationalinsights.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "operationalinsights.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResultIterator, err error) { + result.page, err = client.List(ctx) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/savedsearches.go b/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/savedsearches.go deleted file mode 100644 index babcb9d29fe3..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/savedsearches.go +++ /dev/null @@ -1,432 +0,0 @@ -package operationalinsights - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// 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" - "net/http" -) - -// SavedSearchesClient is the operational Insights Client -type SavedSearchesClient struct { - BaseClient -} - -// NewSavedSearchesClient creates an instance of the SavedSearchesClient client. -func NewSavedSearchesClient(subscriptionID string) SavedSearchesClient { - return NewSavedSearchesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSavedSearchesClientWithBaseURI creates an instance of the SavedSearchesClient client. -func NewSavedSearchesClientWithBaseURI(baseURI string, subscriptionID string) SavedSearchesClient { - return SavedSearchesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a saved search for a given workspace. -// -// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is log -// Analytics workspace name savedSearchName is the id of the saved search. parameters is the parameters required to -// save a search. -func (client SavedSearchesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, savedSearchName string, parameters SavedSearch) (result SavedSearch, err error) { - if err := validation.Validate([]validation.Validation{ - {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: parameters, - Constraints: []validation.Constraint{{Target: "parameters.SavedSearchProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.SavedSearchProperties.Category", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.SavedSearchProperties.DisplayName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.SavedSearchProperties.Query", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.SavedSearchProperties.Version", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.SavedSearchProperties.Version", Name: validation.InclusiveMaximum, Rule: 1, Chain: nil}, - {Target: "parameters.SavedSearchProperties.Version", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "operationalinsights.SavedSearchesClient", "CreateOrUpdate") - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, savedSearchName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.SavedSearchesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "operationalinsights.SavedSearchesClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.SavedSearchesClient", "CreateOrUpdate", resp, "Failure responding to request") - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client SavedSearchesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, savedSearchName string, parameters SavedSearch) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "savedSearchName": autorest.Encode("path", savedSearchName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2015-03-20" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsJSON(), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchName}", pathParameters), - autorest.WithJSON(parameters), - 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 SavedSearchesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client SavedSearchesClient) CreateOrUpdateResponder(resp *http.Response) (result SavedSearch, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified saved search in a given workspace. -// -// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is log -// Analytics workspace name savedSearchName is name of the saved search. -func (client SavedSearchesClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, savedSearchName string) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {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.NewErrorWithValidationError(err, "operationalinsights.SavedSearchesClient", "Delete") - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName, savedSearchName) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.SavedSearchesClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "operationalinsights.SavedSearchesClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.SavedSearchesClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client SavedSearchesClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string, savedSearchName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "savedSearchName": autorest.Encode("path", savedSearchName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2015-03-20" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchName}", 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 SavedSearchesClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client SavedSearchesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified saved search for a given workspace. -// -// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is log -// Analytics workspace name savedSearchName is the id of the saved search. -func (client SavedSearchesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, savedSearchName string) (result SavedSearch, err error) { - if err := validation.Validate([]validation.Validation{ - {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.NewErrorWithValidationError(err, "operationalinsights.SavedSearchesClient", "Get") - } - - req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, savedSearchName) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.SavedSearchesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "operationalinsights.SavedSearchesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.SavedSearchesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client SavedSearchesClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, savedSearchName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "savedSearchName": autorest.Encode("path", savedSearchName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2015-03-20" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchName}", 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 SavedSearchesClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client SavedSearchesClient) GetResponder(resp *http.Response) (result SavedSearch, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetResults gets the results from a saved search for a given workspace. -// -// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is log -// Analytics workspace name savedSearchName is the name of the saved search. -func (client SavedSearchesClient) GetResults(ctx context.Context, resourceGroupName string, workspaceName string, savedSearchName string) (result SearchResultsResponse, err error) { - if err := validation.Validate([]validation.Validation{ - {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.NewErrorWithValidationError(err, "operationalinsights.SavedSearchesClient", "GetResults") - } - - req, err := client.GetResultsPreparer(ctx, resourceGroupName, workspaceName, savedSearchName) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.SavedSearchesClient", "GetResults", nil, "Failure preparing request") - return - } - - resp, err := client.GetResultsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "operationalinsights.SavedSearchesClient", "GetResults", resp, "Failure sending request") - return - } - - result, err = client.GetResultsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.SavedSearchesClient", "GetResults", resp, "Failure responding to request") - } - - return -} - -// GetResultsPreparer prepares the GetResults request. -func (client SavedSearchesClient) GetResultsPreparer(ctx context.Context, resourceGroupName string, workspaceName string, savedSearchName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "savedSearchName": autorest.Encode("path", savedSearchName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2015-03-20" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchName}/results", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetResultsSender sends the GetResults request. The method will close the -// http.Response Body if it receives an error. -func (client SavedSearchesClient) GetResultsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetResultsResponder handles the response to the GetResults request. The method always -// closes the http.Response Body. -func (client SavedSearchesClient) GetResultsResponder(resp *http.Response) (result SearchResultsResponse, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByWorkspace gets the saved searches for a given Log Analytics Workspace -// -// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is log -// Analytics workspace name -func (client SavedSearchesClient) ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result SavedSearchesListResult, err error) { - if err := validation.Validate([]validation.Validation{ - {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.NewErrorWithValidationError(err, "operationalinsights.SavedSearchesClient", "ListByWorkspace") - } - - req, err := client.ListByWorkspacePreparer(ctx, resourceGroupName, workspaceName) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.SavedSearchesClient", "ListByWorkspace", nil, "Failure preparing request") - return - } - - resp, err := client.ListByWorkspaceSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "operationalinsights.SavedSearchesClient", "ListByWorkspace", resp, "Failure sending request") - return - } - - result, err = client.ListByWorkspaceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.SavedSearchesClient", "ListByWorkspace", resp, "Failure responding to request") - } - - return -} - -// ListByWorkspacePreparer prepares the ListByWorkspace request. -func (client SavedSearchesClient) ListByWorkspacePreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2015-03-20" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByWorkspaceSender sends the ListByWorkspace request. The method will close the -// http.Response Body if it receives an error. -func (client SavedSearchesClient) ListByWorkspaceSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListByWorkspaceResponder handles the response to the ListByWorkspace request. The method always -// closes the http.Response Body. -func (client SavedSearchesClient) ListByWorkspaceResponder(resp *http.Response) (result SavedSearchesListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - 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/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/storageinsights.go b/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/storageinsights.go deleted file mode 100644 index cd846787108c..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/storageinsights.go +++ /dev/null @@ -1,383 +0,0 @@ -package operationalinsights - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// 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" - "net/http" -) - -// StorageInsightsClient is the operational Insights Client -type StorageInsightsClient struct { - BaseClient -} - -// NewStorageInsightsClient creates an instance of the StorageInsightsClient client. -func NewStorageInsightsClient(subscriptionID string) StorageInsightsClient { - return NewStorageInsightsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewStorageInsightsClientWithBaseURI creates an instance of the StorageInsightsClient client. -func NewStorageInsightsClientWithBaseURI(baseURI string, subscriptionID string) StorageInsightsClient { - return StorageInsightsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a storage insight. -// -// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is log -// Analytics Workspace name that will contain the storageInsightsConfigs resource storageInsightName is name of the -// storageInsightsConfigs resource parameters is the parameters required to create or update a storage insight. -func (client StorageInsightsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, storageInsightName string, parameters StorageInsight) (result StorageInsight, err error) { - if err := validation.Validate([]validation.Validation{ - {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: parameters, - Constraints: []validation.Constraint{{Target: "parameters.StorageInsightProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.StorageInsightProperties.StorageAccount", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.StorageInsightProperties.StorageAccount.ID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.StorageInsightProperties.StorageAccount.Key", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "operationalinsights.StorageInsightsClient", "CreateOrUpdate") - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, storageInsightName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.StorageInsightsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "operationalinsights.StorageInsightsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.StorageInsightsClient", "CreateOrUpdate", resp, "Failure responding to request") - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client StorageInsightsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, storageInsightName string, parameters StorageInsight) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "storageInsightName": autorest.Encode("path", storageInsightName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2015-03-20" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsJSON(), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}", pathParameters), - autorest.WithJSON(parameters), - 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 StorageInsightsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client StorageInsightsClient) CreateOrUpdateResponder(resp *http.Response) (result StorageInsight, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a storageInsightsConfigs resource -// -// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is log -// Analytics Workspace name that contains the storageInsightsConfigs resource storageInsightName is name of the -// storageInsightsConfigs resource -func (client StorageInsightsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, storageInsightName string) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {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.NewErrorWithValidationError(err, "operationalinsights.StorageInsightsClient", "Delete") - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName, storageInsightName) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.StorageInsightsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "operationalinsights.StorageInsightsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.StorageInsightsClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client StorageInsightsClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string, storageInsightName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "storageInsightName": autorest.Encode("path", storageInsightName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2015-03-20" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}", 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 StorageInsightsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client StorageInsightsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets a storage insight instance. -// -// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is log -// Analytics Workspace name that contains the storageInsightsConfigs resource storageInsightName is name of the -// storageInsightsConfigs resource -func (client StorageInsightsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, storageInsightName string) (result StorageInsight, err error) { - if err := validation.Validate([]validation.Validation{ - {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.NewErrorWithValidationError(err, "operationalinsights.StorageInsightsClient", "Get") - } - - req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, storageInsightName) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.StorageInsightsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "operationalinsights.StorageInsightsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.StorageInsightsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client StorageInsightsClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, storageInsightName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "storageInsightName": autorest.Encode("path", storageInsightName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2015-03-20" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}", 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 StorageInsightsClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client StorageInsightsClient) GetResponder(resp *http.Response) (result StorageInsight, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByWorkspace lists the storage insight instances within a workspace -// -// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is log -// Analytics Workspace name that will contain the storageInsightsConfigs resource -func (client StorageInsightsClient) ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result StorageInsightListResultPage, err error) { - if err := validation.Validate([]validation.Validation{ - {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.NewErrorWithValidationError(err, "operationalinsights.StorageInsightsClient", "ListByWorkspace") - } - - result.fn = client.listByWorkspaceNextResults - req, err := client.ListByWorkspacePreparer(ctx, resourceGroupName, workspaceName) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.StorageInsightsClient", "ListByWorkspace", nil, "Failure preparing request") - return - } - - resp, err := client.ListByWorkspaceSender(req) - if err != nil { - result.silr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "operationalinsights.StorageInsightsClient", "ListByWorkspace", resp, "Failure sending request") - return - } - - result.silr, err = client.ListByWorkspaceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.StorageInsightsClient", "ListByWorkspace", resp, "Failure responding to request") - } - - return -} - -// ListByWorkspacePreparer prepares the ListByWorkspace request. -func (client StorageInsightsClient) ListByWorkspacePreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2015-03-20" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByWorkspaceSender sends the ListByWorkspace request. The method will close the -// http.Response Body if it receives an error. -func (client StorageInsightsClient) ListByWorkspaceSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListByWorkspaceResponder handles the response to the ListByWorkspace request. The method always -// closes the http.Response Body. -func (client StorageInsightsClient) ListByWorkspaceResponder(resp *http.Response) (result StorageInsightListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByWorkspaceNextResults retrieves the next set of results, if any. -func (client StorageInsightsClient) listByWorkspaceNextResults(lastResults StorageInsightListResult) (result StorageInsightListResult, err error) { - req, err := lastResults.storageInsightListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "operationalinsights.StorageInsightsClient", "listByWorkspaceNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByWorkspaceSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "operationalinsights.StorageInsightsClient", "listByWorkspaceNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByWorkspaceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.StorageInsightsClient", "listByWorkspaceNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByWorkspaceComplete enumerates all values, automatically crossing page boundaries as required. -func (client StorageInsightsClient) ListByWorkspaceComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result StorageInsightListResultIterator, err error) { - result.page, err = client.ListByWorkspace(ctx, resourceGroupName, workspaceName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/version.go index 737b78ab70a2..d15046da501b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/version.go @@ -1,5 +1,7 @@ package operationalinsights +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package operationalinsights // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta services" + return "Azure-SDK-For-Go/" + version.Number + " operationalinsights/2015-11-01-preview" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/workspaces.go b/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/workspaces.go index 13a3d8e55965..29aeab7a8f7c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/workspaces.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/workspaces.go @@ -57,7 +57,7 @@ func (client WorkspacesClient) CreateOrUpdate(ctx context.Context, resourceGroup {Target: "parameters.WorkspaceProperties.RetentionInDays", Name: validation.InclusiveMinimum, Rule: -1, Chain: nil}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "operationalinsights.WorkspacesClient", "CreateOrUpdate") + return result, validation.NewError("operationalinsights.WorkspacesClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, parameters) @@ -128,7 +128,8 @@ func (client WorkspacesClient) CreateOrUpdateResponder(resp *http.Response) (res // Delete deletes a workspace instance. // -// resourceGroupName is the resource group name of the workspace. workspaceName is name of the Log Analytics Workspace. +// resourceGroupName is the resource group name of the workspace. workspaceName is name of the Log Analytics +// Workspace. func (client WorkspacesClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string) (result autorest.Response, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName) if err != nil { @@ -193,15 +194,15 @@ func (client WorkspacesClient) DeleteResponder(resp *http.Response) (result auto // DisableIntelligencePack disables an intelligence pack for a given workspace. // -// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is name of -// the Log Analytics Workspace. intelligencePackName is the name of the intelligence pack to be disabled. +// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is name +// of the Log Analytics Workspace. intelligencePackName is the name of the intelligence pack to be disabled. func (client WorkspacesClient) DisableIntelligencePack(ctx context.Context, resourceGroupName string, workspaceName string, intelligencePackName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "operationalinsights.WorkspacesClient", "DisableIntelligencePack") + return result, validation.NewError("operationalinsights.WorkspacesClient", "DisableIntelligencePack", err.Error()) } req, err := client.DisableIntelligencePackPreparer(ctx, resourceGroupName, workspaceName, intelligencePackName) @@ -268,15 +269,15 @@ func (client WorkspacesClient) DisableIntelligencePackResponder(resp *http.Respo // EnableIntelligencePack enables an intelligence pack for a given workspace. // -// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is name of -// the Log Analytics Workspace. intelligencePackName is the name of the intelligence pack to be enabled. +// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is name +// of the Log Analytics Workspace. intelligencePackName is the name of the intelligence pack to be enabled. func (client WorkspacesClient) EnableIntelligencePack(ctx context.Context, resourceGroupName string, workspaceName string, intelligencePackName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "operationalinsights.WorkspacesClient", "EnableIntelligencePack") + return result, validation.NewError("operationalinsights.WorkspacesClient", "EnableIntelligencePack", err.Error()) } req, err := client.EnableIntelligencePackPreparer(ctx, resourceGroupName, workspaceName, intelligencePackName) @@ -343,7 +344,8 @@ func (client WorkspacesClient) EnableIntelligencePackResponder(resp *http.Respon // Get gets a workspace instance. // -// resourceGroupName is the resource group name of the workspace. workspaceName is name of the Log Analytics Workspace. +// resourceGroupName is the resource group name of the workspace. workspaceName is name of the Log Analytics +// Workspace. func (client WorkspacesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string) (result Workspace, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName) if err != nil { @@ -407,175 +409,17 @@ func (client WorkspacesClient) GetResponder(resp *http.Response) (result Workspa return } -// GetSchema gets the schema for a given workspace. -// -// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is log -// Analytics workspace name -func (client WorkspacesClient) GetSchema(ctx context.Context, resourceGroupName string, workspaceName string) (result SearchGetSchemaResponse, err error) { - if err := validation.Validate([]validation.Validation{ - {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.NewErrorWithValidationError(err, "operationalinsights.WorkspacesClient", "GetSchema") - } - - req, err := client.GetSchemaPreparer(ctx, resourceGroupName, workspaceName) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "GetSchema", nil, "Failure preparing request") - return - } - - resp, err := client.GetSchemaSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "GetSchema", resp, "Failure sending request") - return - } - - result, err = client.GetSchemaResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "GetSchema", resp, "Failure responding to request") - } - - return -} - -// GetSchemaPreparer prepares the GetSchema request. -func (client WorkspacesClient) GetSchemaPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2015-03-20" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/schema", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSchemaSender sends the GetSchema request. The method will close the -// http.Response Body if it receives an error. -func (client WorkspacesClient) GetSchemaSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetSchemaResponder handles the response to the GetSchema request. The method always -// closes the http.Response Body. -func (client WorkspacesClient) GetSchemaResponder(resp *http.Response) (result SearchGetSchemaResponse, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetSearchResults submit a search for a given workspace. The response will contain an id to track the search. User -// can use the id to poll the search status and get the full search result later if the search takes long time to -// finish. -// -// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is log -// Analytics workspace name parameters is the parameters required to execute a search query. -func (client WorkspacesClient) GetSearchResults(ctx context.Context, resourceGroupName string, workspaceName string, parameters SearchParameters) (result WorkspacesGetSearchResultsFuture, err error) { - if err := validation.Validate([]validation.Validation{ - {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: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Query", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "operationalinsights.WorkspacesClient", "GetSearchResults") - } - - req, err := client.GetSearchResultsPreparer(ctx, resourceGroupName, workspaceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "GetSearchResults", nil, "Failure preparing request") - return - } - - result, err = client.GetSearchResultsSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "GetSearchResults", result.Response(), "Failure sending request") - return - } - - return -} - -// GetSearchResultsPreparer prepares the GetSearchResults request. -func (client WorkspacesClient) GetSearchResultsPreparer(ctx context.Context, resourceGroupName string, workspaceName string, parameters SearchParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2015-03-20" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsJSON(), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/search", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSearchResultsSender sends the GetSearchResults request. The method will close the -// http.Response Body if it receives an error. -func (client WorkspacesClient) GetSearchResultsSender(req *http.Request) (future WorkspacesGetSearchResultsFuture, err error) { - sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) - future.Future = azure.NewFuture(req) - future.req = req - _, err = future.Done(sender) - if err != nil { - return - } - err = autorest.Respond(future.Response(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - return -} - -// GetSearchResultsResponder handles the response to the GetSearchResults request. The method always -// closes the http.Response Body. -func (client WorkspacesClient) GetSearchResultsResponder(resp *http.Response) (result SearchResultsResponse, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - // GetSharedKeys gets the shared keys for a workspace. // -// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is name of -// the Log Analytics Workspace. +// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is name +// of the Log Analytics Workspace. func (client WorkspacesClient) GetSharedKeys(ctx context.Context, resourceGroupName string, workspaceName string) (result SharedKeys, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "operationalinsights.WorkspacesClient", "GetSharedKeys") + return result, validation.NewError("operationalinsights.WorkspacesClient", "GetSharedKeys", err.Error()) } req, err := client.GetSharedKeysPreparer(ctx, resourceGroupName, workspaceName) @@ -711,7 +555,7 @@ func (client WorkspacesClient) ListByResourceGroup(ctx context.Context, resource 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.NewErrorWithValidationError(err, "operationalinsights.WorkspacesClient", "ListByResourceGroup") + return result, validation.NewError("operationalinsights.WorkspacesClient", "ListByResourceGroup", err.Error()) } req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) @@ -778,15 +622,15 @@ func (client WorkspacesClient) ListByResourceGroupResponder(resp *http.Response) // ListIntelligencePacks lists all the intelligence packs possible and whether they are enabled or disabled for a given // workspace. // -// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is name of -// the Log Analytics Workspace. +// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is name +// of the Log Analytics Workspace. func (client WorkspacesClient) ListIntelligencePacks(ctx context.Context, resourceGroupName string, workspaceName string) (result ListIntelligencePack, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "operationalinsights.WorkspacesClient", "ListIntelligencePacks") + return result, validation.NewError("operationalinsights.WorkspacesClient", "ListIntelligencePacks", err.Error()) } req, err := client.ListIntelligencePacksPreparer(ctx, resourceGroupName, workspaceName) @@ -851,80 +695,17 @@ func (client WorkspacesClient) ListIntelligencePacksResponder(resp *http.Respons return } -// ListLinkTargets get a list of workspaces which the current user has administrator privileges and are not associated -// with an Azure Subscription. The subscriptionId parameter in the Url is ignored. -func (client WorkspacesClient) ListLinkTargets(ctx context.Context) (result ListLinkTarget, err error) { - req, err := client.ListLinkTargetsPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "ListLinkTargets", nil, "Failure preparing request") - return - } - - resp, err := client.ListLinkTargetsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "ListLinkTargets", resp, "Failure sending request") - return - } - - result, err = client.ListLinkTargetsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "ListLinkTargets", resp, "Failure responding to request") - } - - return -} - -// ListLinkTargetsPreparer prepares the ListLinkTargets request. -func (client WorkspacesClient) ListLinkTargetsPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2015-03-20" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/linkTargets", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListLinkTargetsSender sends the ListLinkTargets request. The method will close the -// http.Response Body if it receives an error. -func (client WorkspacesClient) ListLinkTargetsSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListLinkTargetsResponder handles the response to the ListLinkTargets request. The method always -// closes the http.Response Body. -func (client WorkspacesClient) ListLinkTargetsResponder(resp *http.Response) (result ListLinkTarget, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - // ListManagementGroups gets a list of management groups connected to a workspace. // -// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is the name -// of the workspace. +// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is the +// name of the workspace. func (client WorkspacesClient) ListManagementGroups(ctx context.Context, resourceGroupName string, workspaceName string) (result WorkspaceListManagementGroupsResult, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "operationalinsights.WorkspacesClient", "ListManagementGroups") + return result, validation.NewError("operationalinsights.WorkspacesClient", "ListManagementGroups", err.Error()) } req, err := client.ListManagementGroupsPreparer(ctx, resourceGroupName, workspaceName) @@ -991,15 +772,15 @@ func (client WorkspacesClient) ListManagementGroupsResponder(resp *http.Response // ListUsages gets a list of usage metrics for a workspace. // -// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is the name -// of the workspace. +// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is the +// name of the workspace. func (client WorkspacesClient) ListUsages(ctx context.Context, resourceGroupName string, workspaceName string) (result WorkspaceListUsagesResult, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "operationalinsights.WorkspacesClient", "ListUsages") + return result, validation.NewError("operationalinsights.WorkspacesClient", "ListUsages", err.Error()) } req, err := client.ListUsagesPreparer(ctx, resourceGroupName, workspaceName) @@ -1064,73 +845,73 @@ func (client WorkspacesClient) ListUsagesResponder(resp *http.Response) (result return } -// UpdateSearchResults gets updated search results for a given search query. +// Update updates a workspace. // -// resourceGroupName is the name of the resource group to get. The name is case insensitive. workspaceName is log -// Analytics workspace name ID is the id of the search that will have results updated. You can get the id from the -// response of the GetResults call. -func (client WorkspacesClient) UpdateSearchResults(ctx context.Context, resourceGroupName string, workspaceName string, ID string) (result SearchResultsResponse, err error) { +// resourceGroupName is the resource group name of the workspace. workspaceName is the name of the workspace. +// parameters is the parameters required to patch a workspace. +func (client WorkspacesClient) Update(ctx context.Context, resourceGroupName string, workspaceName string, parameters Workspace) (result Workspace, err error) { if err := validation.Validate([]validation.Validation{ - {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.NewErrorWithValidationError(err, "operationalinsights.WorkspacesClient", "UpdateSearchResults") + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.WorkspacesClient", "Update", err.Error()) } - req, err := client.UpdateSearchResultsPreparer(ctx, resourceGroupName, workspaceName, ID) + req, err := client.UpdatePreparer(ctx, resourceGroupName, workspaceName, parameters) if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "UpdateSearchResults", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "Update", nil, "Failure preparing request") return } - resp, err := client.UpdateSearchResultsSender(req) + resp, err := client.UpdateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "UpdateSearchResults", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "Update", resp, "Failure sending request") return } - result, err = client.UpdateSearchResultsResponder(resp) + result, err = client.UpdateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "UpdateSearchResults", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "Update", resp, "Failure responding to request") } return } -// UpdateSearchResultsPreparer prepares the UpdateSearchResults request. -func (client WorkspacesClient) UpdateSearchResultsPreparer(ctx context.Context, resourceGroupName string, workspaceName string, ID string) (*http.Request, error) { +// UpdatePreparer prepares the Update request. +func (client WorkspacesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, parameters Workspace) (*http.Request, error) { pathParameters := map[string]interface{}{ - "id": autorest.Encode("path", ID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "workspaceName": autorest.Encode("path", workspaceName), } - const APIVersion = "2015-03-20" + const APIVersion = "2015-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( - autorest.AsPost(), + autorest.AsJSON(), + autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/search/{id}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}", pathParameters), + autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// UpdateSearchResultsSender sends the UpdateSearchResults request. The method will close the +// UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. -func (client WorkspacesClient) UpdateSearchResultsSender(req *http.Request) (*http.Response, error) { +func (client WorkspacesClient) UpdateSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } -// UpdateSearchResultsResponder handles the response to the UpdateSearchResults request. The method always +// UpdateResponder handles the response to the Update request. The method always // closes the http.Response Body. -func (client WorkspacesClient) UpdateSearchResultsResponder(resp *http.Response) (result SearchResultsResponse, err error) { +func (client WorkspacesClient) UpdateResponder(resp *http.Response) (result Workspace, err error) { err = autorest.Respond( resp, client.ByInspecting(), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement/managementassociations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement/managementassociations.go index 4d8c8d9072ef..07787fc595d9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement/managementassociations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement/managementassociations.go @@ -42,8 +42,9 @@ func NewManagementAssociationsClientWithBaseURI(baseURI string, subscriptionID s // CreateOrUpdate creates or updates the ManagementAssociation. // -// resourceGroupName is the name of the resource group to get. The name is case insensitive. managementAssociationName -// is user ManagementAssociation Name. parameters is the parameters required to create ManagementAssociation extension. +// resourceGroupName is the name of the resource group to get. The name is case insensitive. +// managementAssociationName is user ManagementAssociation Name. parameters is the parameters required to create +// ManagementAssociation extension. func (client ManagementAssociationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managementAssociationName string, parameters ManagementAssociation) (result ManagementAssociation, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -53,7 +54,7 @@ func (client ManagementAssociationsClient) CreateOrUpdate(ctx context.Context, r {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.Properties.ApplicationID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "operationsmanagement.ManagementAssociationsClient", "CreateOrUpdate") + return result, validation.NewError("operationsmanagement.ManagementAssociationsClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, managementAssociationName, parameters) @@ -125,15 +126,15 @@ func (client ManagementAssociationsClient) CreateOrUpdateResponder(resp *http.Re // Delete deletes the ManagementAssociation in the subscription. // -// resourceGroupName is the name of the resource group to get. The name is case insensitive. managementAssociationName -// is user ManagementAssociation Name. +// resourceGroupName is the name of the resource group to get. The name is case insensitive. +// managementAssociationName is user ManagementAssociation Name. func (client ManagementAssociationsClient) Delete(ctx context.Context, resourceGroupName string, managementAssociationName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "operationsmanagement.ManagementAssociationsClient", "Delete") + return result, validation.NewError("operationsmanagement.ManagementAssociationsClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, managementAssociationName) @@ -202,15 +203,15 @@ func (client ManagementAssociationsClient) DeleteResponder(resp *http.Response) // Get retrieves the user ManagementAssociation. // -// resourceGroupName is the name of the resource group to get. The name is case insensitive. managementAssociationName -// is user ManagementAssociation Name. +// resourceGroupName is the name of the resource group to get. The name is case insensitive. +// managementAssociationName is user ManagementAssociation Name. func (client ManagementAssociationsClient) Get(ctx context.Context, resourceGroupName string, managementAssociationName string) (result ManagementAssociation, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "operationsmanagement.ManagementAssociationsClient", "Get") + return result, validation.NewError("operationsmanagement.ManagementAssociationsClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, managementAssociationName) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement/managementconfigurations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement/managementconfigurations.go index a53e64067617..ef84d37678b3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement/managementconfigurations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement/managementconfigurations.go @@ -43,8 +43,8 @@ func NewManagementConfigurationsClientWithBaseURI(baseURI string, subscriptionID // CreateOrUpdate creates or updates the ManagementConfiguration. // // resourceGroupName is the name of the resource group to get. The name is case insensitive. -// managementConfigurationName is user Management Configuration Name. parameters is the parameters required to create -// OMS Solution. +// managementConfigurationName is user Management Configuration Name. parameters is the parameters required to +// create OMS Solution. func (client ManagementConfigurationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managementConfigurationName string, parameters ManagementConfiguration) (result ManagementConfiguration, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -57,7 +57,7 @@ func (client ManagementConfigurationsClient) CreateOrUpdate(ctx context.Context, {Target: "parameters.Properties.Parameters", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.Properties.Template", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "operationsmanagement.ManagementConfigurationsClient", "CreateOrUpdate") + return result, validation.NewError("operationsmanagement.ManagementConfigurationsClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, managementConfigurationName, parameters) @@ -134,7 +134,7 @@ func (client ManagementConfigurationsClient) Delete(ctx context.Context, resourc 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.NewErrorWithValidationError(err, "operationsmanagement.ManagementConfigurationsClient", "Delete") + return result, validation.NewError("operationsmanagement.ManagementConfigurationsClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, managementConfigurationName) @@ -208,7 +208,7 @@ func (client ManagementConfigurationsClient) Get(ctx context.Context, resourceGr 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.NewErrorWithValidationError(err, "operationsmanagement.ManagementConfigurationsClient", "Get") + return result, validation.NewError("operationsmanagement.ManagementConfigurationsClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, managementConfigurationName) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement/models.go index aa5e5a2114af..34fc539c9135 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement/models.go @@ -87,8 +87,8 @@ type ManagementConfiguration struct { Properties *ManagementConfigurationProperties `json:"properties,omitempty"` } -// ManagementConfigurationProperties managementConfiguration properties supported by the OperationsManagement resource -// provider. +// ManagementConfigurationProperties managementConfiguration properties supported by the OperationsManagement +// resource provider. type ManagementConfigurationProperties struct { // ApplicationID - The applicationId of the appliance for this Management. ApplicationID *string `json:"applicationId,omitempty"` @@ -99,7 +99,7 @@ type ManagementConfigurationProperties struct { // ProvisioningState - The provisioning state for the ManagementConfiguration. ProvisioningState *string `json:"provisioningState,omitempty"` // Template - The Json object containing the ARM template to deploy - Template *map[string]interface{} `json:"template,omitempty"` + Template interface{} `json:"template,omitempty"` } // ManagementConfigurationPropertiesList the list of ManagementConfiguration response diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement/solutions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement/solutions.go index be6f5501e6e4..85a5a074bdb3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement/solutions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement/solutions.go @@ -53,7 +53,7 @@ func (client SolutionsClient) CreateOrUpdate(ctx context.Context, resourceGroupN {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.Properties.WorkspaceResourceID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "operationsmanagement.SolutionsClient", "CreateOrUpdate") + return result, validation.NewError("operationsmanagement.SolutionsClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, solutionName, parameters) @@ -130,7 +130,7 @@ func (client SolutionsClient) Delete(ctx context.Context, resourceGroupName stri 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.NewErrorWithValidationError(err, "operationsmanagement.SolutionsClient", "Delete") + return result, validation.NewError("operationsmanagement.SolutionsClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, solutionName) @@ -204,7 +204,7 @@ func (client SolutionsClient) Get(ctx context.Context, resourceGroupName string, 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.NewErrorWithValidationError(err, "operationsmanagement.SolutionsClient", "Get") + return result, validation.NewError("operationsmanagement.SolutionsClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, solutionName) @@ -278,7 +278,7 @@ func (client SolutionsClient) ListByResourceGroup(ctx context.Context, resourceG 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.NewErrorWithValidationError(err, "operationsmanagement.SolutionsClient", "ListByResourceGroup") + return result, validation.NewError("operationsmanagement.SolutionsClient", "ListByResourceGroup", err.Error()) } req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement/version.go index d8d97ca5153e..f33e0e91aa51 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement/version.go @@ -1,5 +1,7 @@ package operationsmanagement +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package operationsmanagement // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta services" + return "Azure-SDK-For-Go/" + version.Number + " operationsmanagement/2015-11-01-preview" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/checknameavailability.go b/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/checknameavailability.go index 29e445e60a79..a4370727fef1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/checknameavailability.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/checknameavailability.go @@ -26,7 +26,7 @@ import ( ) // CheckNameAvailabilityClient is the the Microsoft Azure management API provides create, read, update, and delete -// functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, log files and +// functionality for Azure PostgreSQL resources including servers, databases, firewall rules, log files and // configurations. type CheckNameAvailabilityClient struct { BaseClient @@ -49,7 +49,7 @@ func (client CheckNameAvailabilityClient) Execute(ctx context.Context, nameAvail if err := validation.Validate([]validation.Validation{ {TargetValue: nameAvailabilityRequest, Constraints: []validation.Constraint{{Target: "nameAvailabilityRequest.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "postgresql.CheckNameAvailabilityClient", "Execute") + return result, validation.NewError("postgresql.CheckNameAvailabilityClient", "Execute", err.Error()) } req, err := client.ExecutePreparer(ctx, nameAvailabilityRequest) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/client.go index 785e8418f89b..6c97a46756e5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/client.go @@ -1,7 +1,7 @@ // Package postgresql implements the Azure ARM Postgresql service API version 2017-04-30-preview. // // The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL -// resources including servers, databases, firewall rules, VNET rules, log files and configurations. +// resources including servers, databases, firewall rules, log files and configurations. package postgresql // Copyright (c) Microsoft and contributors. All rights reserved. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/configurations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/configurations.go index 6197dd99badc..71a0837aa5b0 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/configurations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/configurations.go @@ -25,7 +25,7 @@ import ( ) // ConfigurationsClient is the the Microsoft Azure management API provides create, read, update, and delete -// functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, log files and +// functionality for Azure PostgreSQL resources including servers, databases, firewall rules, log files and // configurations. type ConfigurationsClient struct { BaseClient @@ -43,9 +43,9 @@ func NewConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) C // CreateOrUpdate updates a configuration of a server. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. configurationName is the name of the -// server configuration. parameters is the required parameters for updating a server configuration. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. configurationName is the +// name of the server configuration. parameters is the required parameters for updating a server configuration. func (client ConfigurationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, configurationName string, parameters Configuration) (result ConfigurationsCreateOrUpdateFuture, err error) { req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, configurationName, parameters) if err != nil { @@ -116,9 +116,9 @@ func (client ConfigurationsClient) CreateOrUpdateResponder(resp *http.Response) // Get gets information about a configuration of server. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. configurationName is the name of the -// server configuration. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. configurationName is the +// name of the server configuration. func (client ConfigurationsClient) Get(ctx context.Context, resourceGroupName string, serverName string, configurationName string) (result Configuration, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, serverName, configurationName) if err != nil { @@ -185,8 +185,8 @@ func (client ConfigurationsClient) GetResponder(resp *http.Response) (result Con // ListByServer list all the configurations in a given server. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. func (client ConfigurationsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result ConfigurationListResult, err error) { req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/databases.go b/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/databases.go index 5d39b3d6a54d..9519373d9c40 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/databases.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/databases.go @@ -25,8 +25,7 @@ import ( ) // DatabasesClient is the the Microsoft Azure management API provides create, read, update, and delete functionality -// for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, log files and -// configurations. +// for Azure PostgreSQL resources including servers, databases, firewall rules, log files and configurations. type DatabasesClient struct { BaseClient } @@ -43,9 +42,9 @@ func NewDatabasesClientWithBaseURI(baseURI string, subscriptionID string) Databa // CreateOrUpdate creates a new database or updates an existing database. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database. parameters is the required parameters for creating or updating a database. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database. parameters is the required parameters for creating or updating a database. func (client DatabasesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters Database) (result DatabasesCreateOrUpdateFuture, err error) { req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, parameters) if err != nil { @@ -116,9 +115,9 @@ func (client DatabasesClient) CreateOrUpdateResponder(resp *http.Response) (resu // Delete deletes a database. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database. func (client DatabasesClient) Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DatabasesDeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, databaseName) if err != nil { @@ -186,9 +185,9 @@ func (client DatabasesClient) DeleteResponder(resp *http.Response) (result autor // Get gets information about a database. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database. func (client DatabasesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result Database, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, serverName, databaseName) if err != nil { @@ -255,8 +254,8 @@ func (client DatabasesClient) GetResponder(resp *http.Response) (result Database // ListByServer list all the databases in a given server. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. func (client DatabasesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result DatabaseListResult, err error) { req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/firewallrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/firewallrules.go index 278875996a74..309a302c5ad9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/firewallrules.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/firewallrules.go @@ -26,7 +26,7 @@ import ( ) // FirewallRulesClient is the the Microsoft Azure management API provides create, read, update, and delete -// functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, log files and +// functionality for Azure PostgreSQL resources including servers, databases, firewall rules, log files and // configurations. type FirewallRulesClient struct { BaseClient @@ -44,9 +44,9 @@ func NewFirewallRulesClientWithBaseURI(baseURI string, subscriptionID string) Fi // CreateOrUpdate creates a new firewall rule or updates an existing firewall rule. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. firewallRuleName is the name of the -// server firewall rule. parameters is the required parameters for creating or updating a firewall rule. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. firewallRuleName is the name +// of the server firewall rule. parameters is the required parameters for creating or updating a firewall rule. func (client FirewallRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters FirewallRule) (result FirewallRulesCreateOrUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -56,7 +56,7 @@ func (client FirewallRulesClient) CreateOrUpdate(ctx context.Context, resourceGr {Target: "parameters.FirewallRuleProperties.EndIPAddress", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.FirewallRuleProperties.EndIPAddress", Name: validation.Pattern, Rule: `^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$`, Chain: nil}}}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "postgresql.FirewallRulesClient", "CreateOrUpdate") + return result, validation.NewError("postgresql.FirewallRulesClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, firewallRuleName, parameters) @@ -128,9 +128,9 @@ func (client FirewallRulesClient) CreateOrUpdateResponder(resp *http.Response) ( // Delete deletes a server firewall rule. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. firewallRuleName is the name of the -// server firewall rule. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. firewallRuleName is the name +// of the server firewall rule. func (client FirewallRulesClient) Delete(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string) (result FirewallRulesDeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, firewallRuleName) if err != nil { @@ -198,9 +198,9 @@ func (client FirewallRulesClient) DeleteResponder(resp *http.Response) (result a // Get gets information about a server firewall rule. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. firewallRuleName is the name of the -// server firewall rule. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. firewallRuleName is the name +// of the server firewall rule. func (client FirewallRulesClient) Get(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string) (result FirewallRule, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, serverName, firewallRuleName) if err != nil { @@ -267,8 +267,8 @@ func (client FirewallRulesClient) GetResponder(resp *http.Response) (result Fire // ListByServer list all the firewall rules in a given server. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. func (client FirewallRulesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result FirewallRuleListResult, err error) { req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/locationbasedperformancetier.go b/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/locationbasedperformancetier.go index 9ebcecfdc7ca..7e24e1ce81f8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/locationbasedperformancetier.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/locationbasedperformancetier.go @@ -25,8 +25,8 @@ import ( ) // LocationBasedPerformanceTierClient is the the Microsoft Azure management API provides create, read, update, and -// delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, log -// files and configurations. +// delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, log files and +// configurations. type LocationBasedPerformanceTierClient struct { BaseClient } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/logfiles.go b/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/logfiles.go index 9071c55206b5..9a9e22cc41c5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/logfiles.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/logfiles.go @@ -25,7 +25,7 @@ import ( ) // LogFilesClient is the the Microsoft Azure management API provides create, read, update, and delete functionality for -// Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, log files and configurations. +// Azure PostgreSQL resources including servers, databases, firewall rules, log files and configurations. type LogFilesClient struct { BaseClient } @@ -42,8 +42,8 @@ func NewLogFilesClientWithBaseURI(baseURI string, subscriptionID string) LogFile // ListByServer list all the log files in a given server. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. func (client LogFilesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result LogFileListResult, err error) { req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/models.go index d27c184bde12..d7ac6b4efaeb 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/models.go @@ -22,7 +22,6 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/date" - "github.com/Azure/go-autorest/autorest/to" "net/http" ) @@ -92,33 +91,17 @@ const ( SslEnforcementEnumEnabled SslEnforcementEnum = "Enabled" ) -// VirtualNetworkRuleState enumerates the values for virtual network rule state. -type VirtualNetworkRuleState string - -const ( - // VirtualNetworkRuleStateDeleting ... - VirtualNetworkRuleStateDeleting VirtualNetworkRuleState = "Deleting" - // VirtualNetworkRuleStateInitializing ... - VirtualNetworkRuleStateInitializing VirtualNetworkRuleState = "Initializing" - // VirtualNetworkRuleStateInProgress ... - VirtualNetworkRuleStateInProgress VirtualNetworkRuleState = "InProgress" - // VirtualNetworkRuleStateReady ... - VirtualNetworkRuleStateReady VirtualNetworkRuleState = "Ready" - // VirtualNetworkRuleStateUnknown ... - VirtualNetworkRuleStateUnknown VirtualNetworkRuleState = "Unknown" -) - // Configuration represents a Configuration. type Configuration struct { autorest.Response `json:"-"` + // ConfigurationProperties - The properties of a configuration. + *ConfigurationProperties `json:"properties,omitempty"` // ID - Resource ID ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // ConfigurationProperties - The properties of a configuration. - *ConfigurationProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for Configuration struct. @@ -128,46 +111,45 @@ func (c *Configuration) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ConfigurationProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var configurationProperties ConfigurationProperties + err = json.Unmarshal(*v, &configurationProperties) + if err != nil { + return err + } + c.ConfigurationProperties = &configurationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + c.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + c.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } } - c.ConfigurationProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - c.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - c.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - c.Type = &typeVar } return nil @@ -209,36 +191,53 @@ func (future ConfigurationsCreateOrUpdateFuture) Result(client ConfigurationsCli var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ConfigurationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return c, autorest.NewError("postgresql.ConfigurationsCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return c, azure.NewAsyncOpIncompleteError("postgresql.ConfigurationsCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { c, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ConfigurationsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ConfigurationsCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } c, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ConfigurationsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } // Database represents a Database. type Database struct { autorest.Response `json:"-"` + // DatabaseProperties - The properties of a database. + *DatabaseProperties `json:"properties,omitempty"` // ID - Resource ID ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // DatabaseProperties - The properties of a database. - *DatabaseProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for Database struct. @@ -248,46 +247,45 @@ func (d *Database) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties DatabaseProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var databaseProperties DatabaseProperties + err = json.Unmarshal(*v, &databaseProperties) + if err != nil { + return err + } + d.DatabaseProperties = &databaseProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + d.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + d.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + d.Type = &typeVar + } } - d.DatabaseProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - d.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - d.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - d.Type = &typeVar } return nil @@ -308,7 +306,8 @@ type DatabaseProperties struct { Collation *string `json:"collation,omitempty"` } -// DatabasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// DatabasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type DatabasesCreateOrUpdateFuture struct { azure.Future req *http.Request @@ -320,22 +319,39 @@ func (future DatabasesCreateOrUpdateFuture) Result(client DatabasesClient) (d Da var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.DatabasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return d, autorest.NewError("postgresql.DatabasesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return d, azure.NewAsyncOpIncompleteError("postgresql.DatabasesCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { d, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.DatabasesCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.DatabasesCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } d, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.DatabasesCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -351,36 +367,53 @@ func (future DatabasesDeleteFuture) Result(client DatabasesClient) (ar autorest. var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.DatabasesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("postgresql.DatabasesDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("postgresql.DatabasesDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.DatabasesDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.DatabasesDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.DatabasesDeleteFuture", "Result", resp, "Failure responding to request") + } return } // FirewallRule represents a server firewall rule. type FirewallRule struct { autorest.Response `json:"-"` + // FirewallRuleProperties - The properties of a firewall rule. + *FirewallRuleProperties `json:"properties,omitempty"` // ID - Resource ID ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // FirewallRuleProperties - The properties of a firewall rule. - *FirewallRuleProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for FirewallRule struct. @@ -390,46 +423,45 @@ func (fr *FirewallRule) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties FirewallRuleProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var firewallRuleProperties FirewallRuleProperties + err = json.Unmarshal(*v, &firewallRuleProperties) + if err != nil { + return err + } + fr.FirewallRuleProperties = &firewallRuleProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + fr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + fr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + fr.Type = &typeVar + } } - fr.FirewallRuleProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - fr.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - fr.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - fr.Type = &typeVar } return nil @@ -463,22 +495,39 @@ func (future FirewallRulesCreateOrUpdateFuture) Result(client FirewallRulesClien var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.FirewallRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return fr, autorest.NewError("postgresql.FirewallRulesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return fr, azure.NewAsyncOpIncompleteError("postgresql.FirewallRulesCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { fr, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.FirewallRulesCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.FirewallRulesCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } fr, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.FirewallRulesCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -494,35 +543,52 @@ func (future FirewallRulesDeleteFuture) Result(client FirewallRulesClient) (ar a var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.FirewallRulesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("postgresql.FirewallRulesDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("postgresql.FirewallRulesDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.FirewallRulesDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.FirewallRulesDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.FirewallRulesDeleteFuture", "Result", resp, "Failure responding to request") + } return } // LogFile represents a log file. type LogFile struct { + // LogFileProperties - The properties of the log file. + *LogFileProperties `json:"properties,omitempty"` // ID - Resource ID ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // LogFileProperties - The properties of the log file. - *LogFileProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for LogFile struct. @@ -532,46 +598,45 @@ func (lf *LogFile) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties LogFileProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var logFileProperties LogFileProperties + err = json.Unmarshal(*v, &logFileProperties) + if err != nil { + return err + } + lf.LogFileProperties = &logFileProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + lf.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + lf.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + lf.Type = &typeVar + } } - lf.LogFileProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - lf.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - lf.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - lf.Type = &typeVar } return nil @@ -628,7 +693,23 @@ type Operation struct { // Origin - The intended executor of the operation. Possible values include: 'NotSpecified', 'User', 'System' Origin OperationOrigin `json:"origin,omitempty"` // Properties - Additional descriptions for the operation. - Properties *map[string]*map[string]interface{} `json:"properties,omitempty"` + Properties map[string]interface{} `json:"properties"` +} + +// MarshalJSON is the custom marshaler for Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if o.Name != nil { + objectMap["name"] = o.Name + } + if o.Display != nil { + objectMap["display"] = o.Display + } + objectMap["origin"] = o.Origin + if o.Properties != nil { + objectMap["properties"] = o.Properties + } + return json.Marshal(objectMap) } // OperationDisplay display metadata associated with the operation. @@ -692,99 +773,122 @@ type ProxyResource struct { // Server represents a server. type Server struct { autorest.Response `json:"-"` + // Sku - The SKU (pricing tier) of the server. + Sku *Sku `json:"sku,omitempty"` + // ServerProperties - Properties of the server. + *ServerProperties `json:"properties,omitempty"` + // Location - The location the resource resides in. + Location *string `json:"location,omitempty"` + // Tags - Application-specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags"` // ID - Resource ID ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // Location - The location the resource resides in. - Location *string `json:"location,omitempty"` - // Tags - Application-specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` - // Sku - The SKU (pricing tier) of the server. - Sku *Sku `json:"sku,omitempty"` - // ServerProperties - Properties of the server. - *ServerProperties `json:"properties,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for Server struct. -func (s *Server) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for Server. +func (s Server) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.Sku != nil { + objectMap["sku"] = s.Sku } - var v *json.RawMessage - - v = m["sku"] - if v != nil { - var sku Sku - err = json.Unmarshal(*m["sku"], &sku) - if err != nil { - return err - } - s.Sku = &sku + if s.ServerProperties != nil { + objectMap["properties"] = s.ServerProperties } - - v = m["properties"] - if v != nil { - var properties ServerProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - s.ServerProperties = &properties + if s.Location != nil { + objectMap["location"] = s.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - s.Location = &location + if s.Tags != nil { + objectMap["tags"] = s.Tags } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - s.Tags = &tags + if s.ID != nil { + objectMap["id"] = s.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - s.ID = &ID + if s.Name != nil { + objectMap["name"] = s.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - s.Name = &name + if s.Type != nil { + objectMap["type"] = s.Type } + return json.Marshal(objectMap) +} - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for Server struct. +func (s *Server) 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 "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + s.Sku = &sku + } + case "properties": + if v != nil { + var serverProperties ServerProperties + err = json.Unmarshal(*v, &serverProperties) + if err != nil { + return err + } + s.ServerProperties = &serverProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + s.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + s.Tags = tags + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + s.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + s.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + s.Type = &typeVar + } } - s.Type = &typeVar } return nil @@ -799,7 +903,23 @@ type ServerForCreate struct { // Location - The location the resource resides in. Location *string `json:"location,omitempty"` // Tags - Application-specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ServerForCreate. +func (sfc ServerForCreate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sfc.Sku != nil { + objectMap["sku"] = sfc.Sku + } + objectMap["properties"] = sfc.Properties + if sfc.Location != nil { + objectMap["location"] = sfc.Location + } + if sfc.Tags != nil { + objectMap["tags"] = sfc.Tags + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ServerForCreate struct. @@ -809,45 +929,44 @@ func (sfc *ServerForCreate) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["sku"] - if v != nil { - var sku Sku - err = json.Unmarshal(*m["sku"], &sku) - if err != nil { - return err - } - sfc.Sku = &sku - } - - v = m["properties"] - if v != nil { - properties, err := unmarshalBasicServerPropertiesForCreate(*m["properties"]) - if err != nil { - return err - } - sfc.Properties = properties - } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - sfc.Location = &location - } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err + for k, v := range m { + switch k { + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + sfc.Sku = &sku + } + case "properties": + if v != nil { + properties, err := unmarshalBasicServerPropertiesForCreate(*v) + if err != nil { + return err + } + sfc.Properties = properties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + sfc.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + sfc.Tags = tags + } } - sfc.Tags = &tags } return nil @@ -939,12 +1058,14 @@ func unmarshalBasicServerPropertiesForCreateArray(body []byte) ([]BasicServerPro // MarshalJSON is the custom marshaler for ServerPropertiesForCreate. func (spfc ServerPropertiesForCreate) MarshalJSON() ([]byte, error) { spfc.CreateMode = CreateModeServerPropertiesForCreate - type Alias ServerPropertiesForCreate - return json.Marshal(&struct { - Alias - }{ - Alias: (Alias)(spfc), - }) + objectMap := make(map[string]interface{}) + if spfc.StorageMB != nil { + objectMap["storageMB"] = spfc.StorageMB + } + objectMap["version"] = spfc.Version + objectMap["sslEnforcement"] = spfc.SslEnforcement + objectMap["createMode"] = spfc.CreateMode + return json.Marshal(objectMap) } // AsServerPropertiesForDefaultCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForCreate. @@ -969,6 +1090,10 @@ func (spfc ServerPropertiesForCreate) AsBasicServerPropertiesForCreate() (BasicS // ServerPropertiesForDefaultCreate the properties used to create a new server. type ServerPropertiesForDefaultCreate struct { + // AdministratorLogin - The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). + AdministratorLogin *string `json:"administratorLogin,omitempty"` + // AdministratorLoginPassword - The password of the administrator login. + AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` // StorageMB - The maximum storage allowed for a server. StorageMB *int64 `json:"storageMB,omitempty"` // Version - Server version. Possible values include: 'NineFullStopFive', 'NineFullStopSix' @@ -977,21 +1102,25 @@ type ServerPropertiesForDefaultCreate struct { SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"` // CreateMode - Possible values include: 'CreateModeServerPropertiesForCreate', 'CreateModeDefault', 'CreateModePointInTimeRestore' CreateMode CreateMode `json:"createMode,omitempty"` - // AdministratorLogin - The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). - AdministratorLogin *string `json:"administratorLogin,omitempty"` - // AdministratorLoginPassword - The password of the administrator login. - AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` } // MarshalJSON is the custom marshaler for ServerPropertiesForDefaultCreate. func (spfdc ServerPropertiesForDefaultCreate) MarshalJSON() ([]byte, error) { spfdc.CreateMode = CreateModeDefault - type Alias ServerPropertiesForDefaultCreate - return json.Marshal(&struct { - Alias - }{ - Alias: (Alias)(spfdc), - }) + objectMap := make(map[string]interface{}) + if spfdc.AdministratorLogin != nil { + objectMap["administratorLogin"] = spfdc.AdministratorLogin + } + if spfdc.AdministratorLoginPassword != nil { + objectMap["administratorLoginPassword"] = spfdc.AdministratorLoginPassword + } + if spfdc.StorageMB != nil { + objectMap["storageMB"] = spfdc.StorageMB + } + objectMap["version"] = spfdc.Version + objectMap["sslEnforcement"] = spfdc.SslEnforcement + objectMap["createMode"] = spfdc.CreateMode + return json.Marshal(objectMap) } // AsServerPropertiesForDefaultCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForDefaultCreate. @@ -1016,6 +1145,10 @@ func (spfdc ServerPropertiesForDefaultCreate) AsBasicServerPropertiesForCreate() // ServerPropertiesForRestore the properties to a new server by restoring from a backup. type ServerPropertiesForRestore struct { + // SourceServerID - The source server id to restore from. + SourceServerID *string `json:"sourceServerId,omitempty"` + // RestorePointInTime - Restore point creation time (ISO8601 format), specifying the time to restore from. + RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"` // StorageMB - The maximum storage allowed for a server. StorageMB *int64 `json:"storageMB,omitempty"` // Version - Server version. Possible values include: 'NineFullStopFive', 'NineFullStopSix' @@ -1024,21 +1157,25 @@ type ServerPropertiesForRestore struct { SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"` // CreateMode - Possible values include: 'CreateModeServerPropertiesForCreate', 'CreateModeDefault', 'CreateModePointInTimeRestore' CreateMode CreateMode `json:"createMode,omitempty"` - // SourceServerID - The source server id to restore from. - SourceServerID *string `json:"sourceServerId,omitempty"` - // RestorePointInTime - Restore point creation time (ISO8601 format), specifying the time to restore from. - RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"` } // MarshalJSON is the custom marshaler for ServerPropertiesForRestore. func (spfr ServerPropertiesForRestore) MarshalJSON() ([]byte, error) { spfr.CreateMode = CreateModePointInTimeRestore - type Alias ServerPropertiesForRestore - return json.Marshal(&struct { - Alias - }{ - Alias: (Alias)(spfr), - }) + objectMap := make(map[string]interface{}) + if spfr.SourceServerID != nil { + objectMap["sourceServerId"] = spfr.SourceServerID + } + if spfr.RestorePointInTime != nil { + objectMap["restorePointInTime"] = spfr.RestorePointInTime + } + if spfr.StorageMB != nil { + objectMap["storageMB"] = spfr.StorageMB + } + objectMap["version"] = spfr.Version + objectMap["sslEnforcement"] = spfr.SslEnforcement + objectMap["createMode"] = spfr.CreateMode + return json.Marshal(objectMap) } // AsServerPropertiesForDefaultCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForRestore. @@ -1073,22 +1210,39 @@ func (future ServersCreateFuture) Result(client ServersClient) (s Server, err er var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServersCreateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return s, autorest.NewError("postgresql.ServersCreateFuture", "Result", "asynchronous operation has not completed") + return s, azure.NewAsyncOpIncompleteError("postgresql.ServersCreateFuture") } if future.PollingMethod() == azure.PollingLocation { s, err = client.CreateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServersCreateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServersCreateFuture", "Result", resp, "Failure sending request") return } s, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServersCreateFuture", "Result", resp, "Failure responding to request") + } return } @@ -1104,22 +1258,39 @@ func (future ServersDeleteFuture) Result(client ServersClient) (ar autorest.Resp var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServersDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("postgresql.ServersDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("postgresql.ServersDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServersDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServersDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServersDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -1135,22 +1306,39 @@ func (future ServersUpdateFuture) Result(client ServersClient) (s Server, err er var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServersUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return s, autorest.NewError("postgresql.ServersUpdateFuture", "Result", "asynchronous operation has not completed") + return s, azure.NewAsyncOpIncompleteError("postgresql.ServersUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { s, err = client.UpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServersUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServersUpdateFuture", "Result", resp, "Failure sending request") return } s, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "postgresql.ServersUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -1161,7 +1349,22 @@ type ServerUpdateParameters struct { // ServerUpdateParametersProperties - The properties that can be updated for a server. *ServerUpdateParametersProperties `json:"properties,omitempty"` // Tags - Application-specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ServerUpdateParameters. +func (sup ServerUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sup.Sku != nil { + objectMap["sku"] = sup.Sku + } + if sup.ServerUpdateParametersProperties != nil { + objectMap["properties"] = sup.ServerUpdateParametersProperties + } + if sup.Tags != nil { + objectMap["tags"] = sup.Tags + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ServerUpdateParameters struct. @@ -1171,36 +1374,36 @@ func (sup *ServerUpdateParameters) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["sku"] - if v != nil { - var sku Sku - err = json.Unmarshal(*m["sku"], &sku) - if err != nil { - return err - } - sup.Sku = &sku - } - - v = m["properties"] - if v != nil { - var properties ServerUpdateParametersProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + sup.Sku = &sku + } + case "properties": + if v != nil { + var serverUpdateParametersProperties ServerUpdateParametersProperties + err = json.Unmarshal(*v, &serverUpdateParametersProperties) + if err != nil { + return err + } + sup.ServerUpdateParametersProperties = &serverUpdateParametersProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + sup.Tags = tags + } } - sup.ServerUpdateParametersProperties = &properties - } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - sup.Tags = &tags } return nil @@ -1234,255 +1437,35 @@ type Sku struct { // TrackedResource resource properties including location and tags for track resources. type TrackedResource struct { - // ID - Resource ID - ID *string `json:"id,omitempty"` - // Name - Resource name. - Name *string `json:"name,omitempty"` - // Type - Resource type. - Type *string `json:"type,omitempty"` // Location - The location the resource resides in. Location *string `json:"location,omitempty"` // Tags - Application-specific metadata in the form of key-value pairs. - Tags *map[string]*string `json:"tags,omitempty"` -} - -// VirtualNetworkRule a virtual network rule. -type VirtualNetworkRule struct { - autorest.Response `json:"-"` + Tags map[string]*string `json:"tags"` // ID - Resource ID ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // VirtualNetworkRuleProperties - Resource properties. - *VirtualNetworkRuleProperties `json:"properties,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for VirtualNetworkRule struct. -func (vnr *VirtualNetworkRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Location != nil { + objectMap["location"] = tr.Location } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties VirtualNetworkRuleProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - vnr.VirtualNetworkRuleProperties = &properties + if tr.Tags != nil { + objectMap["tags"] = tr.Tags } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - vnr.ID = &ID + if tr.ID != nil { + objectMap["id"] = tr.ID } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - vnr.Name = &name + if tr.Name != nil { + objectMap["name"] = tr.Name } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - vnr.Type = &typeVar + if tr.Type != nil { + objectMap["type"] = tr.Type } - - return nil -} - -// VirtualNetworkRuleListResult a list of virtual network rules. -type VirtualNetworkRuleListResult struct { - autorest.Response `json:"-"` - // Value - Array of results. - Value *[]VirtualNetworkRule `json:"value,omitempty"` - // NextLink - Link to retrieve next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualNetworkRuleListResultIterator provides access to a complete listing of VirtualNetworkRule values. -type VirtualNetworkRuleListResultIterator struct { - i int - page VirtualNetworkRuleListResultPage -} - -// Next 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 *VirtualNetworkRuleListResultIterator) Next() error { - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err := iter.page.Next() - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualNetworkRuleListResultIterator) 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 VirtualNetworkRuleListResultIterator) Response() VirtualNetworkRuleListResult { - 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 VirtualNetworkRuleListResultIterator) Value() VirtualNetworkRule { - if !iter.page.NotDone() { - return VirtualNetworkRule{} - } - return iter.page.Values()[iter.i] -} - -// IsEmpty returns true if the ListResult contains no values. -func (vnrlr VirtualNetworkRuleListResult) IsEmpty() bool { - return vnrlr.Value == nil || len(*vnrlr.Value) == 0 -} - -// virtualNetworkRuleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vnrlr VirtualNetworkRuleListResult) virtualNetworkRuleListResultPreparer() (*http.Request, error) { - if vnrlr.NextLink == nil || len(to.String(vnrlr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare(&http.Request{}, - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vnrlr.NextLink))) -} - -// VirtualNetworkRuleListResultPage contains a page of VirtualNetworkRule values. -type VirtualNetworkRuleListResultPage struct { - fn func(VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error) - vnrlr VirtualNetworkRuleListResult -} - -// 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. -func (page *VirtualNetworkRuleListResultPage) Next() error { - next, err := page.fn(page.vnrlr) - if err != nil { - return err - } - page.vnrlr = next - return nil -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualNetworkRuleListResultPage) NotDone() bool { - return !page.vnrlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualNetworkRuleListResultPage) Response() VirtualNetworkRuleListResult { - return page.vnrlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualNetworkRuleListResultPage) Values() []VirtualNetworkRule { - if page.vnrlr.IsEmpty() { - return nil - } - return *page.vnrlr.Value -} - -// VirtualNetworkRuleProperties properties of a virtual network rule. -type VirtualNetworkRuleProperties struct { - // VirtualNetworkSubnetID - The ARM resource id of the virtual network subnet. - VirtualNetworkSubnetID *string `json:"virtualNetworkSubnetId,omitempty"` - // IgnoreMissingVnetServiceEndpoint - Create firewall rule before the virtual network has vnet service endpoint enabled. - IgnoreMissingVnetServiceEndpoint *bool `json:"ignoreMissingVnetServiceEndpoint,omitempty"` - // State - Virtual Network Rule State. Possible values include: 'VirtualNetworkRuleStateInitializing', 'VirtualNetworkRuleStateInProgress', 'VirtualNetworkRuleStateReady', 'VirtualNetworkRuleStateDeleting', 'VirtualNetworkRuleStateUnknown' - State VirtualNetworkRuleState `json:"state,omitempty"` -} - -// VirtualNetworkRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualNetworkRulesCreateOrUpdateFuture struct { - azure.Future - req *http.Request -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future VirtualNetworkRulesCreateOrUpdateFuture) Result(client VirtualNetworkRulesClient) (vnr VirtualNetworkRule, err error) { - var done bool - done, err = future.Done(client) - if err != nil { - return - } - if !done { - return vnr, autorest.NewError("postgresql.VirtualNetworkRulesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") - } - if future.PollingMethod() == azure.PollingLocation { - vnr, err = client.CreateOrUpdateResponder(future.Response()) - return - } - var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if err != nil { - return - } - vnr, err = client.CreateOrUpdateResponder(resp) - return -} - -// VirtualNetworkRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualNetworkRulesDeleteFuture struct { - azure.Future - req *http.Request -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future VirtualNetworkRulesDeleteFuture) Result(client VirtualNetworkRulesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.Done(client) - if err != nil { - return - } - if !done { - return ar, autorest.NewError("postgresql.VirtualNetworkRulesDeleteFuture", "Result", "asynchronous operation has not completed") - } - if future.PollingMethod() == azure.PollingLocation { - ar, err = client.DeleteResponder(future.Response()) - return - } - var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if err != nil { - return - } - ar, err = client.DeleteResponder(resp) - return + return json.Marshal(objectMap) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/operations.go index f74784add21e..b9e3b4c75591 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/operations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/operations.go @@ -25,8 +25,7 @@ import ( ) // OperationsClient is the the Microsoft Azure management API provides create, read, update, and delete functionality -// for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, log files and -// configurations. +// for Azure PostgreSQL resources including servers, databases, firewall rules, log files and configurations. type OperationsClient struct { BaseClient } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/performancetiers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/performancetiers.go index cc6ce2f269f7..c55894d8af49 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/performancetiers.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/performancetiers.go @@ -25,7 +25,7 @@ import ( ) // PerformanceTiersClient is the the Microsoft Azure management API provides create, read, update, and delete -// functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, log files and +// functionality for Azure PostgreSQL resources including servers, databases, firewall rules, log files and // configurations. type PerformanceTiersClient struct { BaseClient diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/servers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/servers.go index cffb6bfc4418..084271eee04b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/servers.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/servers.go @@ -26,7 +26,7 @@ import ( ) // ServersClient is the the Microsoft Azure management API provides create, read, update, and delete functionality for -// Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, log files and configurations. +// Azure PostgreSQL resources including servers, databases, firewall rules, log files and configurations. type ServersClient struct { BaseClient } @@ -43,8 +43,8 @@ func NewServersClientWithBaseURI(baseURI string, subscriptionID string) ServersC // Create creates a new server, or will overwrite an existing server. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. parameters is the required +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. parameters is the required // parameters for creating or updating a server. func (client ServersClient) Create(ctx context.Context, resourceGroupName string, serverName string, parameters ServerForCreate) (result ServersCreateFuture, err error) { if err := validation.Validate([]validation.Validation{ @@ -58,7 +58,7 @@ func (client ServersClient) Create(ctx context.Context, resourceGroupName string Chain: []validation.Constraint{{Target: "parameters.Properties.StorageMB", Name: validation.InclusiveMinimum, Rule: 1024, Chain: nil}}}, }}, {Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "postgresql.ServersClient", "Create") + return result, validation.NewError("postgresql.ServersClient", "Create", err.Error()) } req, err := client.CreatePreparer(ctx, resourceGroupName, serverName, parameters) @@ -129,8 +129,8 @@ func (client ServersClient) CreateResponder(resp *http.Response) (result Server, // Delete deletes a server. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. func (client ServersClient) Delete(ctx context.Context, resourceGroupName string, serverName string) (result ServersDeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, serverName) if err != nil { @@ -197,8 +197,8 @@ func (client ServersClient) DeleteResponder(resp *http.Response) (result autores // Get gets information about a server. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. func (client ServersClient) Get(ctx context.Context, resourceGroupName string, serverName string) (result Server, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, serverName) if err != nil { @@ -326,8 +326,8 @@ func (client ServersClient) ListResponder(resp *http.Response) (result ServerLis // ListByResourceGroup list all the servers in a given resource group. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. func (client ServersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ServerListResult, err error) { req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) if err != nil { @@ -393,8 +393,8 @@ func (client ServersClient) ListByResourceGroupResponder(resp *http.Response) (r // Update updates an existing server. The request body can contain one to many of the properties present in the normal // server definition. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. parameters is the required +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. parameters is the required // parameters for updating a server. func (client ServersClient) Update(ctx context.Context, resourceGroupName string, serverName string, parameters ServerUpdateParameters) (result ServersUpdateFuture, err error) { req, err := client.UpdatePreparer(ctx, resourceGroupName, serverName, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/version.go index 3c03237f1f6a..66c6f027168b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/version.go @@ -1,5 +1,7 @@ package postgresql +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package postgresql // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta services" + return "Azure-SDK-For-Go/" + version.Number + " postgresql/2017-04-30-preview" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/virtualnetworkrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/virtualnetworkrules.go deleted file mode 100644 index ad3cde800ccd..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/virtualnetworkrules.go +++ /dev/null @@ -1,357 +0,0 @@ -package postgresql - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// 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" - "net/http" -) - -// VirtualNetworkRulesClient is the the Microsoft Azure management API provides create, read, update, and delete -// functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, log files and -// configurations. -type VirtualNetworkRulesClient struct { - BaseClient -} - -// NewVirtualNetworkRulesClient creates an instance of the VirtualNetworkRulesClient client. -func NewVirtualNetworkRulesClient(subscriptionID string) VirtualNetworkRulesClient { - return NewVirtualNetworkRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualNetworkRulesClientWithBaseURI creates an instance of the VirtualNetworkRulesClient client. -func NewVirtualNetworkRulesClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworkRulesClient { - return VirtualNetworkRulesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates an existing virtual network rule. -// -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. virtualNetworkRuleName is the name -// of the virtual network rule. parameters is the requested virtual Network Rule Resource state. -func (client VirtualNetworkRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, parameters VirtualNetworkRule) (result VirtualNetworkRulesCreateOrUpdateFuture, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VirtualNetworkRuleProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkRuleProperties.VirtualNetworkSubnetID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "postgresql.VirtualNetworkRulesClient", "CreateOrUpdate") - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, virtualNetworkRuleName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "postgresql.VirtualNetworkRulesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "postgresql.VirtualNetworkRulesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualNetworkRulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, parameters VirtualNetworkRule) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkRuleName": autorest.Encode("path", virtualNetworkRuleName), - } - - const APIVersion = "2017-04-30-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsJSON(), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", pathParameters), - autorest.WithJSON(parameters), - 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 VirtualNetworkRulesClient) CreateOrUpdateSender(req *http.Request) (future VirtualNetworkRulesCreateOrUpdateFuture, err error) { - sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) - future.Future = azure.NewFuture(req) - future.req = req - _, err = future.Done(sender) - if err != nil { - return - } - err = autorest.Respond(future.Response(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted)) - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualNetworkRulesClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetworkRule, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the virtual network rule with the given name. -// -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. virtualNetworkRuleName is the name -// of the virtual network rule. -func (client VirtualNetworkRulesClient) Delete(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string) (result VirtualNetworkRulesDeleteFuture, err error) { - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, virtualNetworkRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "postgresql.VirtualNetworkRulesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "postgresql.VirtualNetworkRulesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualNetworkRulesClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkRuleName": autorest.Encode("path", virtualNetworkRuleName), - } - - const APIVersion = "2017-04-30-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", 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 VirtualNetworkRulesClient) DeleteSender(req *http.Request) (future VirtualNetworkRulesDeleteFuture, err error) { - sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) - future.Future = azure.NewFuture(req) - future.req = req - _, err = future.Done(sender) - if err != nil { - return - } - err = autorest.Respond(future.Response(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualNetworkRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets a virtual network rule. -// -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. virtualNetworkRuleName is the name -// of the virtual network rule. -func (client VirtualNetworkRulesClient) Get(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string) (result VirtualNetworkRule, err error) { - req, err := client.GetPreparer(ctx, resourceGroupName, serverName, virtualNetworkRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "postgresql.VirtualNetworkRulesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "postgresql.VirtualNetworkRulesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "postgresql.VirtualNetworkRulesClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualNetworkRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkRuleName": autorest.Encode("path", virtualNetworkRuleName), - } - - const APIVersion = "2017-04-30-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", 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 VirtualNetworkRulesClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualNetworkRulesClient) GetResponder(resp *http.Response) (result VirtualNetworkRule, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByServer gets a list of virtual network rules in a server. -// -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. -func (client VirtualNetworkRulesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result VirtualNetworkRuleListResultPage, err error) { - result.fn = client.listByServerNextResults - req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) - if err != nil { - err = autorest.NewErrorWithError(err, "postgresql.VirtualNetworkRulesClient", "ListByServer", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServerSender(req) - if err != nil { - result.vnrlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "postgresql.VirtualNetworkRulesClient", "ListByServer", resp, "Failure sending request") - return - } - - result.vnrlr, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "postgresql.VirtualNetworkRulesClient", "ListByServer", resp, "Failure responding to request") - } - - return -} - -// ListByServerPreparer prepares the ListByServer request. -func (client VirtualNetworkRulesClient) ListByServerPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serverName": autorest.Encode("path", serverName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-04-30-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/virtualNetworkRules", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByServerSender sends the ListByServer request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkRulesClient) ListByServerSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListByServerResponder handles the response to the ListByServer request. The method always -// closes the http.Response Body. -func (client VirtualNetworkRulesClient) ListByServerResponder(resp *http.Response) (result VirtualNetworkRuleListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByServerNextResults retrieves the next set of results, if any. -func (client VirtualNetworkRulesClient) listByServerNextResults(lastResults VirtualNetworkRuleListResult) (result VirtualNetworkRuleListResult, err error) { - req, err := lastResults.virtualNetworkRuleListResultPreparer() - if err != nil { - return result, autorest.NewErrorWithError(err, "postgresql.VirtualNetworkRulesClient", "listByServerNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByServerSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "postgresql.VirtualNetworkRulesClient", "listByServerNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByServerResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "postgresql.VirtualNetworkRulesClient", "listByServerNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByServerComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualNetworkRulesClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result VirtualNetworkRuleListResultIterator, err error) { - result.page, err = client.ListByServer(ctx, resourceGroupName, serverName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/client.go similarity index 98% rename from vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns/client.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/client.go index 4dfa42b84d6f..7b653b49a40b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/client.go @@ -1,4 +1,4 @@ -// Package dns implements the Azure ARM Dns service API version 2016-04-01. +// Package dns implements the Azure ARM Dns service API version 2018-03-01-preview. // // The DNS Management Client. package dns diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/models.go similarity index 64% rename from vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns/models.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/models.go index 7406d8b0e878..b032a20f1888 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/models.go @@ -25,118 +25,6 @@ import ( "net/http" ) -// HTTPStatusCode enumerates the values for http status code. -type HTTPStatusCode string - -const ( - // Accepted ... - Accepted HTTPStatusCode = "Accepted" - // Ambiguous ... - Ambiguous HTTPStatusCode = "Ambiguous" - // BadGateway ... - BadGateway HTTPStatusCode = "BadGateway" - // BadRequest ... - BadRequest HTTPStatusCode = "BadRequest" - // Conflict ... - Conflict HTTPStatusCode = "Conflict" - // Continue ... - Continue HTTPStatusCode = "Continue" - // Created ... - Created HTTPStatusCode = "Created" - // ExpectationFailed ... - ExpectationFailed HTTPStatusCode = "ExpectationFailed" - // Forbidden ... - Forbidden HTTPStatusCode = "Forbidden" - // Found ... - Found HTTPStatusCode = "Found" - // GatewayTimeout ... - GatewayTimeout HTTPStatusCode = "GatewayTimeout" - // Gone ... - Gone HTTPStatusCode = "Gone" - // HTTPVersionNotSupported ... - HTTPVersionNotSupported HTTPStatusCode = "HttpVersionNotSupported" - // InternalServerError ... - InternalServerError HTTPStatusCode = "InternalServerError" - // LengthRequired ... - LengthRequired HTTPStatusCode = "LengthRequired" - // MethodNotAllowed ... - MethodNotAllowed HTTPStatusCode = "MethodNotAllowed" - // Moved ... - Moved HTTPStatusCode = "Moved" - // MovedPermanently ... - MovedPermanently HTTPStatusCode = "MovedPermanently" - // MultipleChoices ... - MultipleChoices HTTPStatusCode = "MultipleChoices" - // NoContent ... - NoContent HTTPStatusCode = "NoContent" - // NonAuthoritativeInformation ... - NonAuthoritativeInformation HTTPStatusCode = "NonAuthoritativeInformation" - // NotAcceptable ... - NotAcceptable HTTPStatusCode = "NotAcceptable" - // NotFound ... - NotFound HTTPStatusCode = "NotFound" - // NotImplemented ... - NotImplemented HTTPStatusCode = "NotImplemented" - // NotModified ... - NotModified HTTPStatusCode = "NotModified" - // OK ... - OK HTTPStatusCode = "OK" - // PartialContent ... - PartialContent HTTPStatusCode = "PartialContent" - // PaymentRequired ... - PaymentRequired HTTPStatusCode = "PaymentRequired" - // PreconditionFailed ... - PreconditionFailed HTTPStatusCode = "PreconditionFailed" - // ProxyAuthenticationRequired ... - ProxyAuthenticationRequired HTTPStatusCode = "ProxyAuthenticationRequired" - // Redirect ... - Redirect HTTPStatusCode = "Redirect" - // RedirectKeepVerb ... - RedirectKeepVerb HTTPStatusCode = "RedirectKeepVerb" - // RedirectMethod ... - RedirectMethod HTTPStatusCode = "RedirectMethod" - // RequestedRangeNotSatisfiable ... - RequestedRangeNotSatisfiable HTTPStatusCode = "RequestedRangeNotSatisfiable" - // RequestEntityTooLarge ... - RequestEntityTooLarge HTTPStatusCode = "RequestEntityTooLarge" - // RequestTimeout ... - RequestTimeout HTTPStatusCode = "RequestTimeout" - // RequestURITooLong ... - RequestURITooLong HTTPStatusCode = "RequestUriTooLong" - // ResetContent ... - ResetContent HTTPStatusCode = "ResetContent" - // SeeOther ... - SeeOther HTTPStatusCode = "SeeOther" - // ServiceUnavailable ... - ServiceUnavailable HTTPStatusCode = "ServiceUnavailable" - // SwitchingProtocols ... - SwitchingProtocols HTTPStatusCode = "SwitchingProtocols" - // TemporaryRedirect ... - TemporaryRedirect HTTPStatusCode = "TemporaryRedirect" - // Unauthorized ... - Unauthorized HTTPStatusCode = "Unauthorized" - // UnsupportedMediaType ... - UnsupportedMediaType HTTPStatusCode = "UnsupportedMediaType" - // Unused ... - Unused HTTPStatusCode = "Unused" - // UpgradeRequired ... - UpgradeRequired HTTPStatusCode = "UpgradeRequired" - // UseProxy ... - UseProxy HTTPStatusCode = "UseProxy" -) - -// OperationStatus enumerates the values for operation status. -type OperationStatus string - -const ( - // Failed ... - Failed OperationStatus = "Failed" - // InProgress ... - InProgress OperationStatus = "InProgress" - // Succeeded ... - Succeeded OperationStatus = "Succeeded" -) - // RecordType enumerates the values for record type. type RecordType string @@ -145,6 +33,8 @@ const ( A RecordType = "A" // AAAA ... AAAA RecordType = "AAAA" + // CAA ... + CAA RecordType = "CAA" // CNAME ... CNAME RecordType = "CNAME" // MX ... @@ -161,6 +51,26 @@ const ( TXT RecordType = "TXT" ) +// PossibleRecordTypeValues returns an array of possible values for the RecordType const type. +func PossibleRecordTypeValues() []RecordType { + return []RecordType{A, AAAA, CAA, CNAME, MX, NS, PTR, SOA, SRV, TXT} +} + +// ZoneType enumerates the values for zone type. +type ZoneType string + +const ( + // Private ... + Private ZoneType = "Private" + // Public ... + Public ZoneType = "Public" +) + +// PossibleZoneTypeValues returns an array of possible values for the ZoneType const type. +func PossibleZoneTypeValues() []ZoneType { + return []ZoneType{Private, Public} +} + // AaaaRecord an AAAA record. type AaaaRecord struct { // Ipv6Address - The IPv6 address of this AAAA record. @@ -173,16 +83,31 @@ type ARecord struct { Ipv4Address *string `json:"ipv4Address,omitempty"` } -// CloudError ... +// CaaRecord a CAA record. +type CaaRecord struct { + // Flags - The flags for this CAA record as an integer between 0 and 255. + Flags *int32 `json:"flags,omitempty"` + // Tag - The tag for this CAA record. + Tag *string `json:"tag,omitempty"` + // Value - The value for this CAA record. + Value *string `json:"value,omitempty"` +} + +// CloudError an error message type CloudError struct { + // Error - The error message body Error *CloudErrorBody `json:"error,omitempty"` } -// CloudErrorBody ... +// CloudErrorBody the body of an error message type CloudErrorBody struct { - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Target *string `json:"target,omitempty"` + // Code - The error code + Code *string `json:"code,omitempty"` + // Message - A description of what caused the error + Message *string `json:"message,omitempty"` + // Target - The target resource of the error message + Target *string `json:"target,omitempty"` + // Details - Extra error information Details *[]CloudErrorBody `json:"details,omitempty"` } @@ -227,6 +152,27 @@ type RecordSet struct { *RecordSetProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for RecordSet. +func (rs RecordSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rs.ID != nil { + objectMap["id"] = rs.ID + } + if rs.Name != nil { + objectMap["name"] = rs.Name + } + if rs.Type != nil { + objectMap["type"] = rs.Type + } + if rs.Etag != nil { + objectMap["etag"] = rs.Etag + } + if rs.RecordSetProperties != nil { + objectMap["properties"] = rs.RecordSetProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for RecordSet struct. func (rs *RecordSet) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -234,56 +180,54 @@ func (rs *RecordSet) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - rs.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - rs.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - rs.Type = &typeVar - } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - rs.Etag = &etag - } - - v = m["properties"] - if v != nil { - var properties RecordSetProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rs.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rs.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rs.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + rs.Etag = &etag + } + case "properties": + if v != nil { + var recordSetProperties RecordSetProperties + err = json.Unmarshal(*v, &recordSetProperties) + if err != nil { + return err + } + rs.RecordSetProperties = &recordSetProperties + } } - rs.RecordSetProperties = &properties } return nil @@ -394,9 +338,11 @@ func (page RecordSetListResultPage) Values() []RecordSet { // RecordSetProperties represents the properties of the records in the record set. type RecordSetProperties struct { // Metadata - The metadata attached to the record set. - Metadata *map[string]*string `json:"metadata,omitempty"` + Metadata map[string]*string `json:"metadata"` // TTL - The TTL (time-to-live) of the records in the record set. TTL *int64 `json:"TTL,omitempty"` + // Fqdn - Fully qualified domain name of the record set. + Fqdn *string `json:"fqdn,omitempty"` // ARecords - The list of A records in the record set. ARecords *[]ARecord `json:"ARecords,omitempty"` // AaaaRecords - The list of AAAA records in the record set. @@ -415,6 +361,53 @@ type RecordSetProperties struct { CnameRecord *CnameRecord `json:"CNAMERecord,omitempty"` // SoaRecord - The SOA record in the record set. SoaRecord *SoaRecord `json:"SOARecord,omitempty"` + // CaaRecords - The list of CAA records in the record set. + CaaRecords *[]CaaRecord `json:"caaRecords,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecordSetProperties. +func (rsp RecordSetProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rsp.Metadata != nil { + objectMap["metadata"] = rsp.Metadata + } + if rsp.TTL != nil { + objectMap["TTL"] = rsp.TTL + } + if rsp.Fqdn != nil { + objectMap["fqdn"] = rsp.Fqdn + } + if rsp.ARecords != nil { + objectMap["ARecords"] = rsp.ARecords + } + if rsp.AaaaRecords != nil { + objectMap["AAAARecords"] = rsp.AaaaRecords + } + if rsp.MxRecords != nil { + objectMap["MXRecords"] = rsp.MxRecords + } + if rsp.NsRecords != nil { + objectMap["NSRecords"] = rsp.NsRecords + } + if rsp.PtrRecords != nil { + objectMap["PTRRecords"] = rsp.PtrRecords + } + if rsp.SrvRecords != nil { + objectMap["SRVRecords"] = rsp.SrvRecords + } + if rsp.TxtRecords != nil { + objectMap["TXTRecords"] = rsp.TxtRecords + } + if rsp.CnameRecord != nil { + objectMap["CNAMERecord"] = rsp.CnameRecord + } + if rsp.SoaRecord != nil { + objectMap["SOARecord"] = rsp.SoaRecord + } + if rsp.CaaRecords != nil { + objectMap["caaRecords"] = rsp.CaaRecords + } + return json.Marshal(objectMap) } // RecordSetUpdateParameters parameters supplied to update a record set. @@ -423,7 +416,7 @@ type RecordSetUpdateParameters struct { RecordSet *RecordSet `json:"RecordSet,omitempty"` } -// Resource ... +// Resource common properties of an Azure Resource Manager resource type Resource struct { // ID - Resource ID. ID *string `json:"id,omitempty"` @@ -434,7 +427,28 @@ type Resource struct { // Location - Resource location. Location *string `json:"location,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.ID != nil { + objectMap["id"] = r.ID + } + if r.Name != nil { + objectMap["name"] = r.Name + } + if r.Type != nil { + objectMap["type"] = r.Type + } + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) } // SoaRecord an SOA record. @@ -467,7 +481,7 @@ type SrvRecord struct { Target *string `json:"target,omitempty"` } -// SubResource ... +// SubResource a reference to a another resource type SubResource struct { // ID - Resource Id. ID *string `json:"id,omitempty"` @@ -482,6 +496,10 @@ type TxtRecord struct { // Zone describes a DNS zone. type Zone struct { autorest.Response `json:"-"` + // Etag - The etag of the zone. + Etag *string `json:"etag,omitempty"` + // ZoneProperties - The properties of the zone. + *ZoneProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. @@ -491,107 +509,114 @@ type Zone struct { // Location - Resource location. Location *string `json:"location,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // Etag - The etag of the zone. - Etag *string `json:"etag,omitempty"` - // ZoneProperties - The properties of the zone. - *ZoneProperties `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for Zone struct. -func (z *Zone) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for Zone. +func (z Zone) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if z.Etag != nil { + objectMap["etag"] = z.Etag } - var v *json.RawMessage - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - z.Etag = &etag + if z.ZoneProperties != nil { + objectMap["properties"] = z.ZoneProperties } - - v = m["properties"] - if v != nil { - var properties ZoneProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - z.ZoneProperties = &properties + if z.ID != nil { + objectMap["id"] = z.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - z.ID = &ID + if z.Name != nil { + objectMap["name"] = z.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - z.Name = &name + if z.Type != nil { + objectMap["type"] = z.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - z.Type = &typeVar + if z.Location != nil { + objectMap["location"] = z.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - z.Location = &location + if z.Tags != nil { + objectMap["tags"] = z.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for Zone struct. +func (z *Zone) 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 "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + z.Etag = &etag + } + case "properties": + if v != nil { + var zoneProperties ZoneProperties + err = json.Unmarshal(*v, &zoneProperties) + if err != nil { + return err + } + z.ZoneProperties = &zoneProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + z.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + z.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + z.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + z.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + z.Tags = tags + } } - z.Tags = &tags } return nil } -// ZoneDeleteResult the response to a Zone Delete operation. -type ZoneDeleteResult struct { - autorest.Response `json:"-"` - // AzureAsyncOperation - Users can perform a Get on Azure-AsyncOperation to get the status of their delete Zone operations. - AzureAsyncOperation *string `json:"azureAsyncOperation,omitempty"` - // Status - Possible values include: 'InProgress', 'Succeeded', 'Failed' - Status OperationStatus `json:"status,omitempty"` - // StatusCode - Possible values include: 'Continue', 'SwitchingProtocols', 'OK', 'Created', 'Accepted', 'NonAuthoritativeInformation', 'NoContent', 'ResetContent', 'PartialContent', 'MultipleChoices', 'Ambiguous', 'MovedPermanently', 'Moved', 'Found', 'Redirect', 'SeeOther', 'RedirectMethod', 'NotModified', 'UseProxy', 'Unused', 'TemporaryRedirect', 'RedirectKeepVerb', 'BadRequest', 'Unauthorized', 'PaymentRequired', 'Forbidden', 'NotFound', 'MethodNotAllowed', 'NotAcceptable', 'ProxyAuthenticationRequired', 'RequestTimeout', 'Conflict', 'Gone', 'LengthRequired', 'PreconditionFailed', 'RequestEntityTooLarge', 'RequestURITooLong', 'UnsupportedMediaType', 'RequestedRangeNotSatisfiable', 'ExpectationFailed', 'UpgradeRequired', 'InternalServerError', 'NotImplemented', 'BadGateway', 'ServiceUnavailable', 'GatewayTimeout', 'HTTPVersionNotSupported' - StatusCode HTTPStatusCode `json:"statusCode,omitempty"` - RequestID *string `json:"requestId,omitempty"` -} - // ZoneListResult the response to a Zone List or ListAll operation. type ZoneListResult struct { autorest.Response `json:"-"` @@ -702,6 +727,12 @@ type ZoneProperties struct { NumberOfRecordSets *int64 `json:"numberOfRecordSets,omitempty"` // NameServers - The name servers for this DNS zone. This is a read-only property and any attempt to set this value will be ignored. NameServers *[]string `json:"nameServers,omitempty"` + // ZoneType - The type of this DNS zone (Public or Private). Possible values include: 'Public', 'Private' + ZoneType ZoneType `json:"zoneType,omitempty"` + // RegistrationVirtualNetworks - A list of references to virtual networks that register hostnames in this DNS zone. This is a only when ZoneType is Private. + RegistrationVirtualNetworks *[]SubResource `json:"registrationVirtualNetworks,omitempty"` + // ResolutionVirtualNetworks - A list of references to virtual networks that resolve records in this DNS zone. This is a only when ZoneType is Private. + ResolutionVirtualNetworks *[]SubResource `json:"resolutionVirtualNetworks,omitempty"` } // ZonesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. @@ -712,25 +743,57 @@ type ZonesDeleteFuture struct { // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. -func (future ZonesDeleteFuture) Result(client ZonesClient) (zdr ZoneDeleteResult, err error) { +func (future ZonesDeleteFuture) Result(client ZonesClient) (ar autorest.Response, err error) { var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "dns.ZonesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return zdr, autorest.NewError("dns.ZonesDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("dns.ZonesDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { - zdr, err = client.DeleteResponder(future.Response()) + ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "dns.ZonesDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "dns.ZonesDeleteFuture", "Result", resp, "Failure sending request") return } - zdr, err = client.DeleteResponder(resp) + ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "dns.ZonesDeleteFuture", "Result", resp, "Failure responding to request") + } return } + +// ZoneUpdate describes a request to update a DNS zone. +type ZoneUpdate struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ZoneUpdate. +func (zu ZoneUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if zu.Tags != nil { + objectMap["tags"] = zu.Tags + } + return json.Marshal(objectMap) +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns/recordsets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/recordsets.go similarity index 77% rename from vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns/recordsets.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/recordsets.go index ae3fd5206b6f..342602186ef3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns/recordsets.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/recordsets.go @@ -42,12 +42,12 @@ func NewRecordSetsClientWithBaseURI(baseURI string, subscriptionID string) Recor // CreateOrUpdate creates or updates a record set within a DNS zone. // // resourceGroupName is the name of the resource group. zoneName is the name of the DNS zone (without a terminating -// dot). relativeRecordSetName is the name of the record set, relative to the name of the zone. recordType is the type -// of DNS record in this record set. Record sets of type SOA can be updated but not created (they are created when the -// DNS zone is created). parameters is parameters supplied to the CreateOrUpdate operation. ifMatch is the etag of the -// record set. Omit this value to always overwrite the current record set. Specify the last-seen etag value to prevent -// accidentally overwritting any concurrent changes. ifNoneMatch is set to '*' to allow a new record set to be created, -// but to prevent updating an existing record set. Other values will be ignored. +// dot). relativeRecordSetName is the name of the record set, relative to the name of the zone. recordType is the +// type of DNS record in this record set. Record sets of type SOA can be updated but not created (they are created +// when the DNS zone is created). parameters is parameters supplied to the CreateOrUpdate operation. ifMatch is the +// etag of the record set. Omit this value to always overwrite the current record set. Specify the last-seen etag +// value to prevent accidentally overwritting any concurrent changes. ifNoneMatch is set to '*' to allow a new +// record set to be created, but to prevent updating an existing record set. Other values will be ignored. func (client RecordSetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, parameters RecordSet, ifMatch string, ifNoneMatch string) (result RecordSet, err error) { req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, zoneName, relativeRecordSetName, recordType, parameters, ifMatch, ifNoneMatch) if err != nil { @@ -80,13 +80,13 @@ func (client RecordSetsClient) CreateOrUpdatePreparer(ctx context.Context, resou "zoneName": autorest.Encode("path", zoneName), } - const APIVersion = "2016-04-01" + const APIVersion = "2018-03-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}", pathParameters), @@ -126,10 +126,10 @@ func (client RecordSetsClient) CreateOrUpdateResponder(resp *http.Response) (res // Delete deletes a record set from a DNS zone. This operation cannot be undone. // // resourceGroupName is the name of the resource group. zoneName is the name of the DNS zone (without a terminating -// dot). relativeRecordSetName is the name of the record set, relative to the name of the zone. recordType is the type -// of DNS record in this record set. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is -// deleted). ifMatch is the etag of the record set. Omit this value to always delete the current record set. Specify -// the last-seen etag value to prevent accidentally deleting any concurrent changes. +// dot). relativeRecordSetName is the name of the record set, relative to the name of the zone. recordType is the +// type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are deleted when the DNS +// zone is deleted). ifMatch is the etag of the record set. Omit this value to always delete the current record +// set. Specify the last-seen etag value to prevent accidentally deleting any concurrent changes. func (client RecordSetsClient) Delete(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, ifMatch string) (result autorest.Response, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, zoneName, relativeRecordSetName, recordType, ifMatch) if err != nil { @@ -162,7 +162,7 @@ func (client RecordSetsClient) DeletePreparer(ctx context.Context, resourceGroup "zoneName": autorest.Encode("path", zoneName), } - const APIVersion = "2016-04-01" + const APIVersion = "2018-03-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -201,8 +201,8 @@ func (client RecordSetsClient) DeleteResponder(resp *http.Response) (result auto // Get gets a record set. // // resourceGroupName is the name of the resource group. zoneName is the name of the DNS zone (without a terminating -// dot). relativeRecordSetName is the name of the record set, relative to the name of the zone. recordType is the type -// of DNS record in this record set. +// dot). relativeRecordSetName is the name of the record set, relative to the name of the zone. recordType is the +// type of DNS record in this record set. func (client RecordSetsClient) Get(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType) (result RecordSet, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, zoneName, relativeRecordSetName, recordType) if err != nil { @@ -235,7 +235,7 @@ func (client RecordSetsClient) GetPreparer(ctx context.Context, resourceGroupNam "zoneName": autorest.Encode("path", zoneName), } - const APIVersion = "2016-04-01" + const APIVersion = "2018-03-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -268,6 +268,110 @@ func (client RecordSetsClient) GetResponder(resp *http.Response) (result RecordS return } +// ListAllByDNSZone lists all record sets in a DNS zone. +// +// resourceGroupName is the name of the resource group. zoneName is the name of the DNS zone (without a terminating +// dot). top is the maximum number of record sets to return. If not specified, returns up to 100 record sets. +// recordSetNameSuffix is the suffix label of the record set name that has to be used to filter the record set +// enumerations. If this parameter is specified, Enumeration will return only records that end with +// . +func (client RecordSetsClient) ListAllByDNSZone(ctx context.Context, resourceGroupName string, zoneName string, top *int32, recordSetNameSuffix string) (result RecordSetListResultPage, err error) { + result.fn = client.listAllByDNSZoneNextResults + req, err := client.ListAllByDNSZonePreparer(ctx, resourceGroupName, zoneName, top, recordSetNameSuffix) + if err != nil { + err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "ListAllByDNSZone", nil, "Failure preparing request") + return + } + + resp, err := client.ListAllByDNSZoneSender(req) + if err != nil { + result.rslr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "ListAllByDNSZone", resp, "Failure sending request") + return + } + + result.rslr, err = client.ListAllByDNSZoneResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "ListAllByDNSZone", resp, "Failure responding to request") + } + + return +} + +// ListAllByDNSZonePreparer prepares the ListAllByDNSZone request. +func (client RecordSetsClient) ListAllByDNSZonePreparer(ctx context.Context, resourceGroupName string, zoneName string, top *int32, recordSetNameSuffix string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "zoneName": autorest.Encode("path", zoneName), + } + + const APIVersion = "2018-03-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(recordSetNameSuffix) > 0 { + queryParameters["$recordsetnamesuffix"] = autorest.Encode("query", recordSetNameSuffix) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/all", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListAllByDNSZoneSender sends the ListAllByDNSZone request. The method will close the +// http.Response Body if it receives an error. +func (client RecordSetsClient) ListAllByDNSZoneSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListAllByDNSZoneResponder handles the response to the ListAllByDNSZone request. The method always +// closes the http.Response Body. +func (client RecordSetsClient) ListAllByDNSZoneResponder(resp *http.Response) (result RecordSetListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listAllByDNSZoneNextResults retrieves the next set of results, if any. +func (client RecordSetsClient) listAllByDNSZoneNextResults(lastResults RecordSetListResult) (result RecordSetListResult, err error) { + req, err := lastResults.recordSetListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "dns.RecordSetsClient", "listAllByDNSZoneNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListAllByDNSZoneSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "dns.RecordSetsClient", "listAllByDNSZoneNextResults", resp, "Failure sending next results request") + } + result, err = client.ListAllByDNSZoneResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "listAllByDNSZoneNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListAllByDNSZoneComplete enumerates all values, automatically crossing page boundaries as required. +func (client RecordSetsClient) ListAllByDNSZoneComplete(ctx context.Context, resourceGroupName string, zoneName string, top *int32, recordSetNameSuffix string) (result RecordSetListResultIterator, err error) { + result.page, err = client.ListAllByDNSZone(ctx, resourceGroupName, zoneName, top, recordSetNameSuffix) + return +} + // ListByDNSZone lists all record sets in a DNS zone. // // resourceGroupName is the name of the resource group. zoneName is the name of the DNS zone (without a terminating @@ -306,7 +410,7 @@ func (client RecordSetsClient) ListByDNSZonePreparer(ctx context.Context, resour "zoneName": autorest.Encode("path", zoneName), } - const APIVersion = "2016-04-01" + const APIVersion = "2018-03-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -375,10 +479,10 @@ func (client RecordSetsClient) ListByDNSZoneComplete(ctx context.Context, resour // ListByType lists the record sets of a specified type in a DNS zone. // // resourceGroupName is the name of the resource group. zoneName is the name of the DNS zone (without a terminating -// dot). recordType is the type of record sets to enumerate. top is the maximum number of record sets to return. If not -// specified, returns up to 100 record sets. recordsetnamesuffix is the suffix label of the record set name that has to -// be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records -// that end with . +// dot). recordType is the type of record sets to enumerate. top is the maximum number of record sets to return. If +// not specified, returns up to 100 record sets. recordsetnamesuffix is the suffix label of the record set name +// that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will +// return only records that end with . func (client RecordSetsClient) ListByType(ctx context.Context, resourceGroupName string, zoneName string, recordType RecordType, top *int32, recordsetnamesuffix string) (result RecordSetListResultPage, err error) { result.fn = client.listByTypeNextResults req, err := client.ListByTypePreparer(ctx, resourceGroupName, zoneName, recordType, top, recordsetnamesuffix) @@ -411,7 +515,7 @@ func (client RecordSetsClient) ListByTypePreparer(ctx context.Context, resourceG "zoneName": autorest.Encode("path", zoneName), } - const APIVersion = "2016-04-01" + const APIVersion = "2018-03-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -480,10 +584,10 @@ func (client RecordSetsClient) ListByTypeComplete(ctx context.Context, resourceG // Update updates a record set within a DNS zone. // // resourceGroupName is the name of the resource group. zoneName is the name of the DNS zone (without a terminating -// dot). relativeRecordSetName is the name of the record set, relative to the name of the zone. recordType is the type -// of DNS record in this record set. parameters is parameters supplied to the Update operation. ifMatch is the etag of -// the record set. Omit this value to always overwrite the current record set. Specify the last-seen etag value to -// prevent accidentally overwritting concurrent changes. +// dot). relativeRecordSetName is the name of the record set, relative to the name of the zone. recordType is the +// type of DNS record in this record set. parameters is parameters supplied to the Update operation. ifMatch is the +// etag of the record set. Omit this value to always overwrite the current record set. Specify the last-seen etag +// value to prevent accidentally overwritting concurrent changes. func (client RecordSetsClient) Update(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, parameters RecordSet, ifMatch string) (result RecordSet, err error) { req, err := client.UpdatePreparer(ctx, resourceGroupName, zoneName, relativeRecordSetName, recordType, parameters, ifMatch) if err != nil { @@ -516,13 +620,13 @@ func (client RecordSetsClient) UpdatePreparer(ctx context.Context, resourceGroup "zoneName": autorest.Encode("path", zoneName), } - const APIVersion = "2016-04-01" + const APIVersion = "2018-03-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}", pathParameters), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/version.go similarity index 87% rename from vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns/version.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/version.go index d5676e7e1581..0275c857cae2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/version.go @@ -1,5 +1,7 @@ package dns +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package dns // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta services" + return "Azure-SDK-For-Go/" + version.Number + " dns/2018-03-01-preview" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns/zones.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/zones.go similarity index 82% rename from vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns/zones.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/zones.go index 309a29aa2717..f73744508457 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns/zones.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/zones.go @@ -42,10 +42,10 @@ func NewZonesClientWithBaseURI(baseURI string, subscriptionID string) ZonesClien // CreateOrUpdate creates or updates a DNS zone. Does not modify DNS records within the zone. // // resourceGroupName is the name of the resource group. zoneName is the name of the DNS zone (without a terminating -// dot). parameters is parameters supplied to the CreateOrUpdate operation. ifMatch is the etag of the DNS zone. Omit -// this value to always overwrite the current zone. Specify the last-seen etag value to prevent accidentally -// overwritting any concurrent changes. ifNoneMatch is set to '*' to allow a new DNS zone to be created, but to prevent -// updating an existing zone. Other values will be ignored. +// dot). parameters is parameters supplied to the CreateOrUpdate operation. ifMatch is the etag of the DNS zone. +// Omit this value to always overwrite the current zone. Specify the last-seen etag value to prevent accidentally +// overwritting any concurrent changes. ifNoneMatch is set to '*' to allow a new DNS zone to be created, but to +// prevent updating an existing zone. Other values will be ignored. func (client ZonesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, zoneName string, parameters Zone, ifMatch string, ifNoneMatch string) (result Zone, err error) { req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, zoneName, parameters, ifMatch, ifNoneMatch) if err != nil { @@ -76,13 +76,13 @@ func (client ZonesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGr "zoneName": autorest.Encode("path", zoneName), } - const APIVersion = "2016-04-01" + const APIVersion = "2018-03-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}", pathParameters), @@ -123,8 +123,8 @@ func (client ZonesClient) CreateOrUpdateResponder(resp *http.Response) (result Z // undone. // // resourceGroupName is the name of the resource group. zoneName is the name of the DNS zone (without a terminating -// dot). ifMatch is the etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen -// etag value to prevent accidentally deleting any concurrent changes. +// dot). ifMatch is the etag of the DNS zone. Omit this value to always delete the current zone. Specify the +// last-seen etag value to prevent accidentally deleting any concurrent changes. func (client ZonesClient) Delete(ctx context.Context, resourceGroupName string, zoneName string, ifMatch string) (result ZonesDeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, zoneName, ifMatch) if err != nil { @@ -149,7 +149,7 @@ func (client ZonesClient) DeletePreparer(ctx context.Context, resourceGroupName "zoneName": autorest.Encode("path", zoneName), } - const APIVersion = "2016-04-01" + const APIVersion = "2018-03-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -183,14 +183,13 @@ func (client ZonesClient) DeleteSender(req *http.Request) (future ZonesDeleteFut // DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. -func (client ZonesClient) DeleteResponder(resp *http.Response) (result ZoneDeleteResult, err error) { +func (client ZonesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} + result.Response = resp return } @@ -228,7 +227,7 @@ func (client ZonesClient) GetPreparer(ctx context.Context, resourceGroupName str "zoneName": autorest.Encode("path", zoneName), } - const APIVersion = "2016-04-01" + const APIVersion = "2018-03-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -293,7 +292,7 @@ func (client ZonesClient) ListPreparer(ctx context.Context, top *int32) (*http.R "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-04-01" + const APIVersion = "2018-03-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -390,7 +389,7 @@ func (client ZonesClient) ListByResourceGroupPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-04-01" + const APIVersion = "2018-03-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -452,3 +451,78 @@ func (client ZonesClient) ListByResourceGroupComplete(ctx context.Context, resou result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, top) return } + +// Update updates a DNS zone. Does not modify DNS records within the zone. +// +// resourceGroupName is the name of the resource group. zoneName is the name of the DNS zone (without a terminating +// dot). parameters is parameters supplied to the Update operation. ifMatch is the etag of the DNS zone. Omit this +// value to always overwrite the current zone. Specify the last-seen etag value to prevent accidentally +// overwritting any concurrent changes. +func (client ZonesClient) Update(ctx context.Context, resourceGroupName string, zoneName string, parameters ZoneUpdate, ifMatch string) (result Zone, err error) { + req, err := client.UpdatePreparer(ctx, resourceGroupName, zoneName, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "dns.ZonesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "dns.ZonesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "dns.ZonesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ZonesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, zoneName string, parameters ZoneUpdate, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "zoneName": autorest.Encode("path", zoneName), + } + + const APIVersion = "2018-03-01-preview" + 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.Network/dnsZones/{zoneName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + 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 ZonesClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ZonesClient) UpdateResponder(resp *http.Response) (result Zone, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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/redis/mgmt/2016-04-01/redis/firewallrule.go b/vendor/github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2016-04-01/redis/firewallrule.go index 894383e873fd..cf9b87260bce 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2016-04-01/redis/firewallrule.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2016-04-01/redis/firewallrule.go @@ -42,8 +42,9 @@ func NewFirewallRuleClientWithBaseURI(baseURI string, subscriptionID string) Fir // CreateOrUpdate create or update a redis cache firewall rule // -// resourceGroupName is the name of the resource group. cacheName is the name of the Redis cache. ruleName is the name -// of the firewall rule. parameters is parameters supplied to the create or update redis firewall rule operation. +// resourceGroupName is the name of the resource group. cacheName is the name of the Redis cache. ruleName is the +// name of the firewall rule. parameters is parameters supplied to the create or update redis firewall rule +// operation. func (client FirewallRuleClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, cacheName string, ruleName string, parameters FirewallRule) (result FirewallRule, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -51,7 +52,7 @@ func (client FirewallRuleClient) CreateOrUpdate(ctx context.Context, resourceGro Chain: []validation.Constraint{{Target: "parameters.FirewallRuleProperties.StartIP", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.FirewallRuleProperties.EndIP", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "redis.FirewallRuleClient", "CreateOrUpdate") + return result, validation.NewError("redis.FirewallRuleClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, cacheName, ruleName, parameters) @@ -121,8 +122,8 @@ func (client FirewallRuleClient) CreateOrUpdateResponder(resp *http.Response) (r // Delete deletes a single firewall rule in a specified redis cache. // -// resourceGroupName is the name of the resource group. cacheName is the name of the Redis cache. ruleName is the name -// of the firewall rule. +// resourceGroupName is the name of the resource group. cacheName is the name of the Redis cache. ruleName is the +// name of the firewall rule. func (client FirewallRuleClient) Delete(ctx context.Context, resourceGroupName string, cacheName string, ruleName string) (result autorest.Response, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, cacheName, ruleName) if err != nil { @@ -188,8 +189,8 @@ func (client FirewallRuleClient) DeleteResponder(resp *http.Response) (result au // Get gets a single firewall rule in a specified redis cache. // -// resourceGroupName is the name of the resource group. cacheName is the name of the Redis cache. ruleName is the name -// of the firewall rule. +// resourceGroupName is the name of the resource group. cacheName is the name of the Redis cache. ruleName is the +// name of the firewall rule. func (client FirewallRuleClient) Get(ctx context.Context, resourceGroupName string, cacheName string, ruleName string) (result FirewallRule, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, cacheName, ruleName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2016-04-01/redis/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2016-04-01/redis/models.go index 8e0c4ed638ea..8747ac69a641 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2016-04-01/redis/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2016-04-01/redis/models.go @@ -102,8 +102,58 @@ type AccessKeys struct { SecondaryKey *string `json:"secondaryKey,omitempty"` } +// CreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type CreateFuture struct { + azure.Future + req *http.Request +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future CreateFuture) Result(client Client) (rt ResourceType, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "redis.CreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + return rt, azure.NewAsyncOpIncompleteError("redis.CreateFuture") + } + if future.PollingMethod() == azure.PollingLocation { + rt, err = client.CreateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "redis.CreateFuture", "Result", future.Response(), "Failure responding to request") + } + return + } + var req *http.Request + var resp *http.Response + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if err != nil { + err = autorest.NewErrorWithError(err, "redis.CreateFuture", "Result", resp, "Failure sending request") + return + } + rt, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "redis.CreateFuture", "Result", resp, "Failure responding to request") + } + return +} + // CreateParameters parameters supplied to the Create Redis operation. type CreateParameters struct { + // CreateProperties - Redis cache properties. + *CreateProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. @@ -113,78 +163,97 @@ type CreateParameters struct { // Location - Resource location. Location *string `json:"location,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // CreateProperties - Redis cache properties. - *CreateProperties `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for CreateParameters struct. -func (cp *CreateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for CreateParameters. +func (cp CreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cp.CreateProperties != nil { + objectMap["properties"] = cp.CreateProperties } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties CreateProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - cp.CreateProperties = &properties + if cp.ID != nil { + objectMap["id"] = cp.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - cp.ID = &ID + if cp.Name != nil { + objectMap["name"] = cp.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - cp.Name = &name + if cp.Type != nil { + objectMap["type"] = cp.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - cp.Type = &typeVar + if cp.Location != nil { + objectMap["location"] = cp.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - cp.Location = &location + if cp.Tags != nil { + objectMap["tags"] = cp.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for CreateParameters struct. +func (cp *CreateParameters) 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 "properties": + if v != nil { + var createProperties CreateProperties + err = json.Unmarshal(*v, &createProperties) + if err != nil { + return err + } + cp.CreateProperties = &createProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cp.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + cp.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + cp.Tags = tags + } } - cp.Tags = &tags } return nil @@ -192,20 +261,143 @@ func (cp *CreateParameters) UnmarshalJSON(body []byte) error { // CreateProperties properties supplied to Create Redis operation. type CreateProperties struct { + // Sku - The SKU of the Redis cache to deploy. + Sku *Sku `json:"sku,omitempty"` // RedisConfiguration - All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value etc. - RedisConfiguration *map[string]*string `json:"redisConfiguration,omitempty"` + RedisConfiguration map[string]*string `json:"redisConfiguration"` // EnableNonSslPort - Specifies whether the non-ssl Redis server port (6379) is enabled. EnableNonSslPort *bool `json:"enableNonSslPort,omitempty"` // TenantSettings - tenantSettings - TenantSettings *map[string]*string `json:"tenantSettings,omitempty"` + TenantSettings map[string]*string `json:"tenantSettings"` // ShardCount - The number of shards to be created on a Premium Cluster Cache. ShardCount *int32 `json:"shardCount,omitempty"` // SubnetID - The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 SubnetID *string `json:"subnetId,omitempty"` // StaticIP - Static IP address. Required when deploying a Redis cache inside an existing Azure Virtual Network. StaticIP *string `json:"staticIP,omitempty"` - // Sku - The SKU of the Redis cache to deploy. - Sku *Sku `json:"sku,omitempty"` +} + +// MarshalJSON is the custom marshaler for CreateProperties. +func (cp CreateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cp.Sku != nil { + objectMap["sku"] = cp.Sku + } + if cp.RedisConfiguration != nil { + objectMap["redisConfiguration"] = cp.RedisConfiguration + } + if cp.EnableNonSslPort != nil { + objectMap["enableNonSslPort"] = cp.EnableNonSslPort + } + if cp.TenantSettings != nil { + objectMap["tenantSettings"] = cp.TenantSettings + } + if cp.ShardCount != nil { + objectMap["shardCount"] = cp.ShardCount + } + if cp.SubnetID != nil { + objectMap["subnetId"] = cp.SubnetID + } + if cp.StaticIP != nil { + objectMap["staticIP"] = cp.StaticIP + } + return json.Marshal(objectMap) +} + +// DeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type DeleteFuture struct { + azure.Future + req *http.Request +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future DeleteFuture) Result(client Client) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "redis.DeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + return ar, azure.NewAsyncOpIncompleteError("redis.DeleteFuture") + } + if future.PollingMethod() == azure.PollingLocation { + ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "redis.DeleteFuture", "Result", future.Response(), "Failure responding to request") + } + return + } + var req *http.Request + var resp *http.Response + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if err != nil { + err = autorest.NewErrorWithError(err, "redis.DeleteFuture", "Result", resp, "Failure sending request") + return + } + ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "redis.DeleteFuture", "Result", resp, "Failure responding to request") + } + return +} + +// ExportDataFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type ExportDataFuture struct { + azure.Future + req *http.Request +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future ExportDataFuture) Result(client Client) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "redis.ExportDataFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + return ar, azure.NewAsyncOpIncompleteError("redis.ExportDataFuture") + } + if future.PollingMethod() == azure.PollingLocation { + ar, err = client.ExportDataResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "redis.ExportDataFuture", "Result", future.Response(), "Failure responding to request") + } + return + } + var req *http.Request + var resp *http.Response + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if err != nil { + err = autorest.NewErrorWithError(err, "redis.ExportDataFuture", "Result", resp, "Failure sending request") + return + } + ar, err = client.ExportDataResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "redis.ExportDataFuture", "Result", resp, "Failure responding to request") + } + return } // ExportRDBParameters parameters for Redis export operation. @@ -218,8 +410,8 @@ type ExportRDBParameters struct { Container *string `json:"container,omitempty"` } -// FirewallRule a firewall rule on a redis cache has a name, and describes a contiguous range of IP addresses permitted -// to connect +// FirewallRule a firewall rule on a redis cache has a name, and describes a contiguous range of IP addresses +// permitted to connect type FirewallRule struct { autorest.Response `json:"-"` // ID - resource ID (of the firewall rule) @@ -239,46 +431,45 @@ func (fr *FirewallRule) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - fr.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - fr.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - fr.Type = &typeVar - } - - v = m["properties"] - if v != nil { - var properties FirewallRuleProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + fr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + fr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + fr.Type = &typeVar + } + case "properties": + if v != nil { + var firewallRuleProperties FirewallRuleProperties + err = json.Unmarshal(*v, &firewallRuleProperties) + if err != nil { + return err + } + fr.FirewallRuleProperties = &firewallRuleProperties + } } - fr.FirewallRuleProperties = &properties } return nil @@ -401,6 +592,54 @@ type ForceRebootResponse struct { Message *string `json:"Message,omitempty"` } +// ImportDataFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type ImportDataFuture struct { + azure.Future + req *http.Request +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future ImportDataFuture) Result(client Client) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "redis.ImportDataFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + return ar, azure.NewAsyncOpIncompleteError("redis.ImportDataFuture") + } + if future.PollingMethod() == azure.PollingLocation { + ar, err = client.ImportDataResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "redis.ImportDataFuture", "Result", future.Response(), "Failure responding to request") + } + return + } + var req *http.Request + var resp *http.Response + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if err != nil { + err = autorest.NewErrorWithError(err, "redis.ImportDataFuture", "Result", resp, "Failure sending request") + return + } + ar, err = client.ImportDataResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "redis.ImportDataFuture", "Result", resp, "Failure responding to request") + } + return +} + // ImportRDBParameters parameters for Redis import operation. type ImportRDBParameters struct { // Format - File format. @@ -531,8 +770,8 @@ type OperationDisplay struct { Description *string `json:"description,omitempty"` } -// OperationListResult result of the request to list REST API operations. It contains a list of operations and a URL -// nextLink to get the next set of results. +// OperationListResult result of the request to list REST API operations. It contains a list of operations and a +// URL nextLink to get the next set of results. type OperationListResult struct { autorest.Response `json:"-"` // Value - List of operations supported by the resource provider. @@ -656,56 +895,54 @@ func (ps *PatchSchedule) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - ps.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - ps.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - ps.Type = &typeVar - } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - ps.Location = &location - } - - v = m["properties"] - if v != nil { - var properties ScheduleEntries - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ps.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ps.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ps.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ps.Location = &location + } + case "properties": + if v != nil { + var scheduleEntries ScheduleEntries + err = json.Unmarshal(*v, &scheduleEntries) + if err != nil { + return err + } + ps.ScheduleEntries = &scheduleEntries + } } - ps.ScheduleEntries = &properties } return nil @@ -714,11 +951,11 @@ func (ps *PatchSchedule) UnmarshalJSON(body []byte) error { // Properties properties supplied to Create or Update Redis operation. type Properties struct { // RedisConfiguration - All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value etc. - RedisConfiguration *map[string]*string `json:"redisConfiguration,omitempty"` + RedisConfiguration map[string]*string `json:"redisConfiguration"` // EnableNonSslPort - Specifies whether the non-ssl Redis server port (6379) is enabled. EnableNonSslPort *bool `json:"enableNonSslPort,omitempty"` // TenantSettings - tenantSettings - TenantSettings *map[string]*string `json:"tenantSettings,omitempty"` + TenantSettings map[string]*string `json:"tenantSettings"` // ShardCount - The number of shards to be created on a Premium Cluster Cache. ShardCount *int32 `json:"shardCount,omitempty"` // SubnetID - The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 @@ -727,136 +964,36 @@ type Properties struct { StaticIP *string `json:"staticIP,omitempty"` } -// RebootParameters specifies which Redis node(s) to reboot. -type RebootParameters struct { - // RebootType - Which Redis node(s) to reboot. Depending on this value data loss is possible. Possible values include: 'PrimaryNode', 'SecondaryNode', 'AllNodes' - RebootType RebootType `json:"rebootType,omitempty"` - // ShardID - If clustering is enabled, the ID of the shard to be rebooted. - ShardID *int32 `json:"shardId,omitempty"` -} - -// RedisCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type RedisCreateFuture struct { - azure.Future - req *http.Request -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future RedisCreateFuture) Result(client Client) (rt ResourceType, err error) { - var done bool - done, err = future.Done(client) - if err != nil { - return +// MarshalJSON is the custom marshaler for Properties. +func (p Properties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if p.RedisConfiguration != nil { + objectMap["redisConfiguration"] = p.RedisConfiguration } - if !done { - return rt, autorest.NewError("redis.RedisCreateFuture", "Result", "asynchronous operation has not completed") + if p.EnableNonSslPort != nil { + objectMap["enableNonSslPort"] = p.EnableNonSslPort } - if future.PollingMethod() == azure.PollingLocation { - rt, err = client.CreateResponder(future.Response()) - return + if p.TenantSettings != nil { + objectMap["tenantSettings"] = p.TenantSettings } - var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if err != nil { - return - } - rt, err = client.CreateResponder(resp) - return -} - -// RedisDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type RedisDeleteFuture struct { - azure.Future - req *http.Request -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future RedisDeleteFuture) Result(client Client) (ar autorest.Response, err error) { - var done bool - done, err = future.Done(client) - if err != nil { - return + if p.ShardCount != nil { + objectMap["shardCount"] = p.ShardCount } - if !done { - return ar, autorest.NewError("redis.RedisDeleteFuture", "Result", "asynchronous operation has not completed") + if p.SubnetID != nil { + objectMap["subnetId"] = p.SubnetID } - if future.PollingMethod() == azure.PollingLocation { - ar, err = client.DeleteResponder(future.Response()) - return + if p.StaticIP != nil { + objectMap["staticIP"] = p.StaticIP } - var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if err != nil { - return - } - ar, err = client.DeleteResponder(resp) - return -} - -// RedisExportDataFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type RedisExportDataFuture struct { - azure.Future - req *http.Request -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future RedisExportDataFuture) Result(client Client) (ar autorest.Response, err error) { - var done bool - done, err = future.Done(client) - if err != nil { - return - } - if !done { - return ar, autorest.NewError("redis.RedisExportDataFuture", "Result", "asynchronous operation has not completed") - } - if future.PollingMethod() == azure.PollingLocation { - ar, err = client.ExportDataResponder(future.Response()) - return - } - var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if err != nil { - return - } - ar, err = client.ExportDataResponder(resp) - return + return json.Marshal(objectMap) } -// RedisImportDataFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type RedisImportDataFuture struct { - azure.Future - req *http.Request -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future RedisImportDataFuture) Result(client Client) (ar autorest.Response, err error) { - var done bool - done, err = future.Done(client) - if err != nil { - return - } - if !done { - return ar, autorest.NewError("redis.RedisImportDataFuture", "Result", "asynchronous operation has not completed") - } - if future.PollingMethod() == azure.PollingLocation { - ar, err = client.ImportDataResponder(future.Response()) - return - } - var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if err != nil { - return - } - ar, err = client.ImportDataResponder(resp) - return +// RebootParameters specifies which Redis node(s) to reboot. +type RebootParameters struct { + // RebootType - Which Redis node(s) to reboot. Depending on this value data loss is possible. Possible values include: 'PrimaryNode', 'SecondaryNode', 'AllNodes' + RebootType RebootType `json:"rebootType,omitempty"` + // ShardID - If clustering is enabled, the ID of the shard to be rebooted. + ShardID *int32 `json:"shardId,omitempty"` } // RegenerateKeyParameters specifies which Redis access keys to reset. @@ -876,23 +1013,32 @@ type Resource struct { // Location - Resource location. Location *string `json:"location,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.ID != nil { + objectMap["id"] = r.ID + } + if r.Name != nil { + objectMap["name"] = r.Name + } + if r.Type != nil { + objectMap["type"] = r.Type + } + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) } // ResourceProperties parameters describing a Redis instance. type ResourceProperties struct { - // RedisConfiguration - All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value etc. - RedisConfiguration *map[string]*string `json:"redisConfiguration,omitempty"` - // EnableNonSslPort - Specifies whether the non-ssl Redis server port (6379) is enabled. - EnableNonSslPort *bool `json:"enableNonSslPort,omitempty"` - // TenantSettings - tenantSettings - TenantSettings *map[string]*string `json:"tenantSettings,omitempty"` - // ShardCount - The number of shards to be created on a Premium Cluster Cache. - ShardCount *int32 `json:"shardCount,omitempty"` - // SubnetID - The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 - SubnetID *string `json:"subnetId,omitempty"` - // StaticIP - Static IP address. Required when deploying a Redis cache inside an existing Azure Virtual Network. - StaticIP *string `json:"staticIP,omitempty"` // Sku - The SKU of the Redis cache to deploy. Sku *Sku `json:"sku,omitempty"` // RedisVersion - Redis version. @@ -907,11 +1053,70 @@ type ResourceProperties struct { SslPort *int32 `json:"sslPort,omitempty"` // AccessKeys - The keys of the Redis cache - not set if this object is not the response to Create or Update redis cache AccessKeys *AccessKeys `json:"accessKeys,omitempty"` + // RedisConfiguration - All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value etc. + RedisConfiguration map[string]*string `json:"redisConfiguration"` + // EnableNonSslPort - Specifies whether the non-ssl Redis server port (6379) is enabled. + EnableNonSslPort *bool `json:"enableNonSslPort,omitempty"` + // TenantSettings - tenantSettings + TenantSettings map[string]*string `json:"tenantSettings"` + // ShardCount - The number of shards to be created on a Premium Cluster Cache. + ShardCount *int32 `json:"shardCount,omitempty"` + // SubnetID - The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 + SubnetID *string `json:"subnetId,omitempty"` + // StaticIP - Static IP address. Required when deploying a Redis cache inside an existing Azure Virtual Network. + StaticIP *string `json:"staticIP,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceProperties. +func (rp ResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rp.Sku != nil { + objectMap["sku"] = rp.Sku + } + if rp.RedisVersion != nil { + objectMap["redisVersion"] = rp.RedisVersion + } + if rp.ProvisioningState != nil { + objectMap["provisioningState"] = rp.ProvisioningState + } + if rp.HostName != nil { + objectMap["hostName"] = rp.HostName + } + if rp.Port != nil { + objectMap["port"] = rp.Port + } + if rp.SslPort != nil { + objectMap["sslPort"] = rp.SslPort + } + if rp.AccessKeys != nil { + objectMap["accessKeys"] = rp.AccessKeys + } + if rp.RedisConfiguration != nil { + objectMap["redisConfiguration"] = rp.RedisConfiguration + } + if rp.EnableNonSslPort != nil { + objectMap["enableNonSslPort"] = rp.EnableNonSslPort + } + if rp.TenantSettings != nil { + objectMap["tenantSettings"] = rp.TenantSettings + } + if rp.ShardCount != nil { + objectMap["shardCount"] = rp.ShardCount + } + if rp.SubnetID != nil { + objectMap["subnetId"] = rp.SubnetID + } + if rp.StaticIP != nil { + objectMap["staticIP"] = rp.StaticIP + } + return json.Marshal(objectMap) } // ResourceType a single Redis item in List or Get Operation. type ResourceType struct { autorest.Response `json:"-"` + // ResourceProperties - Redis cache properties. + *ResourceProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. @@ -921,78 +1126,97 @@ type ResourceType struct { // Location - Resource location. Location *string `json:"location,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // ResourceProperties - Redis cache properties. - *ResourceProperties `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for ResourceType struct. -func (rt *ResourceType) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for ResourceType. +func (rt ResourceType) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rt.ResourceProperties != nil { + objectMap["properties"] = rt.ResourceProperties } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ResourceProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - rt.ResourceProperties = &properties + if rt.ID != nil { + objectMap["id"] = rt.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - rt.ID = &ID + if rt.Name != nil { + objectMap["name"] = rt.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - rt.Name = &name + if rt.Type != nil { + objectMap["type"] = rt.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - rt.Type = &typeVar + if rt.Location != nil { + objectMap["location"] = rt.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - rt.Location = &location + if rt.Tags != nil { + objectMap["tags"] = rt.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for ResourceType struct. +func (rt *ResourceType) 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 "properties": + if v != nil { + var resourceProperties ResourceProperties + err = json.Unmarshal(*v, &resourceProperties) + if err != nil { + return err + } + rt.ResourceProperties = &resourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rt.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rt.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rt.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rt.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + rt.Tags = tags + } } - rt.Tags = &tags } return nil @@ -1029,7 +1253,19 @@ type UpdateParameters struct { // UpdateProperties - Redis cache properties. *UpdateProperties `json:"properties,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for UpdateParameters. +func (up UpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if up.UpdateProperties != nil { + objectMap["properties"] = up.UpdateProperties + } + if up.Tags != nil { + objectMap["tags"] = up.Tags + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for UpdateParameters struct. @@ -1039,26 +1275,27 @@ func (up *UpdateParameters) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties UpdateProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - up.UpdateProperties = &properties - } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var updateProperties UpdateProperties + err = json.Unmarshal(*v, &updateProperties) + if err != nil { + return err + } + up.UpdateProperties = &updateProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + up.Tags = tags + } } - up.Tags = &tags } return nil @@ -1066,18 +1303,45 @@ func (up *UpdateParameters) UnmarshalJSON(body []byte) error { // UpdateProperties properties supplied to Update Redis operation. type UpdateProperties struct { + // Sku - The SKU of the Redis cache to deploy. + Sku *Sku `json:"sku,omitempty"` // RedisConfiguration - All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value etc. - RedisConfiguration *map[string]*string `json:"redisConfiguration,omitempty"` + RedisConfiguration map[string]*string `json:"redisConfiguration"` // EnableNonSslPort - Specifies whether the non-ssl Redis server port (6379) is enabled. EnableNonSslPort *bool `json:"enableNonSslPort,omitempty"` // TenantSettings - tenantSettings - TenantSettings *map[string]*string `json:"tenantSettings,omitempty"` + TenantSettings map[string]*string `json:"tenantSettings"` // ShardCount - The number of shards to be created on a Premium Cluster Cache. ShardCount *int32 `json:"shardCount,omitempty"` // SubnetID - The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 SubnetID *string `json:"subnetId,omitempty"` // StaticIP - Static IP address. Required when deploying a Redis cache inside an existing Azure Virtual Network. StaticIP *string `json:"staticIP,omitempty"` - // Sku - The SKU of the Redis cache to deploy. - Sku *Sku `json:"sku,omitempty"` +} + +// MarshalJSON is the custom marshaler for UpdateProperties. +func (up UpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if up.Sku != nil { + objectMap["sku"] = up.Sku + } + if up.RedisConfiguration != nil { + objectMap["redisConfiguration"] = up.RedisConfiguration + } + if up.EnableNonSslPort != nil { + objectMap["enableNonSslPort"] = up.EnableNonSslPort + } + if up.TenantSettings != nil { + objectMap["tenantSettings"] = up.TenantSettings + } + if up.ShardCount != nil { + objectMap["shardCount"] = up.ShardCount + } + if up.SubnetID != nil { + objectMap["subnetId"] = up.SubnetID + } + if up.StaticIP != nil { + objectMap["staticIP"] = up.StaticIP + } + return json.Marshal(objectMap) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2016-04-01/redis/patchschedules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2016-04-01/redis/patchschedules.go index 91cb1d9d2627..91d61a9eff79 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2016-04-01/redis/patchschedules.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2016-04-01/redis/patchschedules.go @@ -42,14 +42,14 @@ func NewPatchSchedulesClientWithBaseURI(baseURI string, subscriptionID string) P // CreateOrUpdate create or replace the patching schedule for Redis cache (requires Premium SKU). // -// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is parameters -// to set the patching schedule for Redis cache. +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// parameters to set the patching schedule for Redis cache. func (client PatchSchedulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, name string, parameters PatchSchedule) (result PatchSchedule, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.ScheduleEntries", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.ScheduleEntries.ScheduleEntries", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "redis.PatchSchedulesClient", "CreateOrUpdate") + return result, validation.NewError("redis.PatchSchedulesClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, name, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2016-04-01/redis/redis.go b/vendor/github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2016-04-01/redis/redis.go index 8aa397221410..6a70e7950eac 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2016-04-01/redis/redis.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2016-04-01/redis/redis.go @@ -42,16 +42,16 @@ func NewClientWithBaseURI(baseURI string, subscriptionID string) Client { // Create create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. // -// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is parameters -// supplied to the Create Redis operation. -func (client Client) Create(ctx context.Context, resourceGroupName string, name string, parameters CreateParameters) (result RedisCreateFuture, err error) { +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// parameters supplied to the Create Redis operation. +func (client Client) Create(ctx context.Context, resourceGroupName string, name string, parameters CreateParameters) (result CreateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.CreateProperties", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.CreateProperties.Sku", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.CreateProperties.Sku.Capacity", Name: validation.Null, Rule: true, Chain: nil}}}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "redis.Client", "Create") + return result, validation.NewError("redis.Client", "Create", err.Error()) } req, err := client.CreatePreparer(ctx, resourceGroupName, name, parameters) @@ -94,7 +94,7 @@ func (client Client) CreatePreparer(ctx context.Context, resourceGroupName strin // CreateSender sends the Create request. The method will close the // http.Response Body if it receives an error. -func (client Client) CreateSender(req *http.Request) (future RedisCreateFuture, err error) { +func (client Client) CreateSender(req *http.Request) (future CreateFuture, err error) { sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) future.Future = azure.NewFuture(req) future.req = req @@ -123,7 +123,7 @@ func (client Client) CreateResponder(resp *http.Response) (result ResourceType, // Delete deletes a Redis cache. // // resourceGroupName is the name of the resource group. name is the name of the Redis cache. -func (client Client) Delete(ctx context.Context, resourceGroupName string, name string) (result RedisDeleteFuture, err error) { +func (client Client) Delete(ctx context.Context, resourceGroupName string, name string) (result DeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, name) if err != nil { err = autorest.NewErrorWithError(err, "redis.Client", "Delete", nil, "Failure preparing request") @@ -162,7 +162,7 @@ func (client Client) DeletePreparer(ctx context.Context, resourceGroupName strin // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. -func (client Client) DeleteSender(req *http.Request) (future RedisDeleteFuture, err error) { +func (client Client) DeleteSender(req *http.Request) (future DeleteFuture, err error) { sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) future.Future = azure.NewFuture(req) future.req = req @@ -189,14 +189,14 @@ func (client Client) DeleteResponder(resp *http.Response) (result autorest.Respo // ExportData export data from the redis cache to blobs in a container. // -// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is parameters -// for Redis export operation. -func (client Client) ExportData(ctx context.Context, resourceGroupName string, name string, parameters ExportRDBParameters) (result RedisExportDataFuture, err error) { +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// parameters for Redis export operation. +func (client Client) ExportData(ctx context.Context, resourceGroupName string, name string, parameters ExportRDBParameters) (result ExportDataFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Prefix", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.Container", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "redis.Client", "ExportData") + return result, validation.NewError("redis.Client", "ExportData", err.Error()) } req, err := client.ExportDataPreparer(ctx, resourceGroupName, name, parameters) @@ -239,7 +239,7 @@ func (client Client) ExportDataPreparer(ctx context.Context, resourceGroupName s // ExportDataSender sends the ExportData request. The method will close the // http.Response Body if it receives an error. -func (client Client) ExportDataSender(req *http.Request) (future RedisExportDataFuture, err error) { +func (client Client) ExportDataSender(req *http.Request) (future ExportDataFuture, err error) { sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) future.Future = azure.NewFuture(req) future.req = req @@ -267,8 +267,8 @@ func (client Client) ExportDataResponder(resp *http.Response) (result autorest.R // ForceReboot reboot specified Redis node(s). This operation requires write permission to the cache resource. There // can be potential data loss. // -// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is specifies -// which Redis node(s) to reboot. +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// specifies which Redis node(s) to reboot. func (client Client) ForceReboot(ctx context.Context, resourceGroupName string, name string, parameters RebootParameters) (result ForceRebootResponse, err error) { req, err := client.ForceRebootPreparer(ctx, resourceGroupName, name, parameters) if err != nil { @@ -402,13 +402,13 @@ func (client Client) GetResponder(resp *http.Response) (result ResourceType, err // ImportData import data into Redis cache. // -// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is parameters -// for Redis import operation. -func (client Client) ImportData(ctx context.Context, resourceGroupName string, name string, parameters ImportRDBParameters) (result RedisImportDataFuture, err error) { +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// parameters for Redis import operation. +func (client Client) ImportData(ctx context.Context, resourceGroupName string, name string, parameters ImportRDBParameters) (result ImportDataFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Files", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "redis.Client", "ImportData") + return result, validation.NewError("redis.Client", "ImportData", err.Error()) } req, err := client.ImportDataPreparer(ctx, resourceGroupName, name, parameters) @@ -451,7 +451,7 @@ func (client Client) ImportDataPreparer(ctx context.Context, resourceGroupName s // ImportDataSender sends the ImportData request. The method will close the // http.Response Body if it receives an error. -func (client Client) ImportDataSender(req *http.Request) (future RedisImportDataFuture, err error) { +func (client Client) ImportDataSender(req *http.Request) (future ImportDataFuture, err error) { sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) future.Future = azure.NewFuture(req) future.req = req @@ -727,8 +727,8 @@ func (client Client) ListKeysResponder(resp *http.Response) (result AccessKeys, // RegenerateKey regenerate Redis cache's access keys. This operation requires write permission to the cache resource. // -// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is specifies -// which key to regenerate. +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// specifies which key to regenerate. func (client Client) RegenerateKey(ctx context.Context, resourceGroupName string, name string, parameters RegenerateKeyParameters) (result AccessKeys, err error) { req, err := client.RegenerateKeyPreparer(ctx, resourceGroupName, name, parameters) if err != nil { @@ -796,8 +796,8 @@ func (client Client) RegenerateKeyResponder(resp *http.Response) (result AccessK // Update update an existing Redis cache. // -// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is parameters -// supplied to the Update Redis operation. +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// parameters supplied to the Update Redis operation. func (client Client) Update(ctx context.Context, resourceGroupName string, name string, parameters UpdateParameters) (result ResourceType, err error) { req, err := client.UpdatePreparer(ctx, resourceGroupName, name, parameters) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2016-04-01/redis/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2016-04-01/redis/version.go index 02d7bb925861..b4f0d2900201 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2016-04-01/redis/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2016-04-01/redis/version.go @@ -1,5 +1,7 @@ package redis +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package redis // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta services" + return "Azure-SDK-For-Go/" + version.Number + " redis/2016-04-01" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-06-01/subscriptions/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-06-01/subscriptions/version.go index ef27facf5d63..599c1d099a3e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-06-01/subscriptions/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-06-01/subscriptions/version.go @@ -1,5 +1,7 @@ package subscriptions +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package subscriptions // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta services" + return "Azure-SDK-For-Go/" + version.Number + " subscriptions/2016-06-01" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-09-01/locks/managementlocks.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-09-01/locks/managementlocks.go index e8c163f02c62..dc655d9741f8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-09-01/locks/managementlocks.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-09-01/locks/managementlocks.go @@ -57,7 +57,7 @@ func (client ManagementLocksClient) CreateOrUpdateAtResourceGroupLevel(ctx conte {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.ManagementLockProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "locks.ManagementLocksClient", "CreateOrUpdateAtResourceGroupLevel") + return result, validation.NewError("locks.ManagementLocksClient", "CreateOrUpdateAtResourceGroupLevel", err.Error()) } req, err := client.CreateOrUpdateAtResourceGroupLevelPreparer(ctx, resourceGroupName, lockName, parameters) @@ -128,11 +128,11 @@ func (client ManagementLocksClient) CreateOrUpdateAtResourceGroupLevelResponder( // create management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* // actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. // -// resourceGroupName is the name of the resource group containing the resource to lock. resourceProviderNamespace is -// the resource provider namespace of the resource to lock. parentResourcePath is the parent resource identity. +// resourceGroupName is the name of the resource group containing the resource to lock. resourceProviderNamespace +// is the resource provider namespace of the resource to lock. parentResourcePath is the parent resource identity. // resourceType is the resource type of the resource to lock. resourceName is the name of the resource to lock. -// lockName is the name of lock. The lock name can be a maximum of 260 characters. It cannot contain <, > %, &, :, \, -// ?, /, or any control characters. parameters is parameters for creating or updating a management lock. +// lockName is the name of lock. The lock name can be a maximum of 260 characters. It cannot contain <, > %, &, :, +// \, ?, /, or any control characters. parameters is parameters for creating or updating a management lock. func (client ManagementLocksClient) CreateOrUpdateAtResourceLevel(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, lockName string, parameters ManagementLockObject) (result ManagementLockObject, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -141,7 +141,7 @@ func (client ManagementLocksClient) CreateOrUpdateAtResourceLevel(ctx context.Co {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.ManagementLockProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "locks.ManagementLocksClient", "CreateOrUpdateAtResourceLevel") + return result, validation.NewError("locks.ManagementLocksClient", "CreateOrUpdateAtResourceLevel", err.Error()) } req, err := client.CreateOrUpdateAtResourceLevelPreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, lockName, parameters) @@ -217,13 +217,13 @@ func (client ManagementLocksClient) CreateOrUpdateAtResourceLevelResponder(resp // Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted // those actions. // -// lockName is the name of lock. The lock name can be a maximum of 260 characters. It cannot contain <, > %, &, :, \, -// ?, /, or any control characters. parameters is the management lock parameters. +// lockName is the name of lock. The lock name can be a maximum of 260 characters. It cannot contain <, > %, &, :, +// \, ?, /, or any control characters. parameters is the management lock parameters. func (client ManagementLocksClient) CreateOrUpdateAtSubscriptionLevel(ctx context.Context, lockName string, parameters ManagementLockObject) (result ManagementLockObject, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.ManagementLockProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "locks.ManagementLocksClient", "CreateOrUpdateAtSubscriptionLevel") + return result, validation.NewError("locks.ManagementLocksClient", "CreateOrUpdateAtSubscriptionLevel", err.Error()) } req, err := client.CreateOrUpdateAtSubscriptionLevelPreparer(ctx, lockName, parameters) @@ -291,15 +291,16 @@ func (client ManagementLocksClient) CreateOrUpdateAtSubscriptionLevelResponder(r // CreateOrUpdateByScope create or update a management lock by scope. // -// scope is the scope for the lock. When providing a scope for the assignment, use '/subscriptions/{subscriptionId}' -// for subscriptions, '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and +// scope is the scope for the lock. When providing a scope for the assignment, use +// '/subscriptions/{subscriptionId}' for subscriptions, +// '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and // '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' // for resources. lockName is the name of lock. parameters is create or update management lock parameters. func (client ManagementLocksClient) CreateOrUpdateByScope(ctx context.Context, scope string, lockName string, parameters ManagementLockObject) (result ManagementLockObject, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.ManagementLockProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "locks.ManagementLocksClient", "CreateOrUpdateByScope") + return result, validation.NewError("locks.ManagementLocksClient", "CreateOrUpdateByScope", err.Error()) } req, err := client.CreateOrUpdateByScopePreparer(ctx, scope, lockName, parameters) @@ -376,7 +377,7 @@ func (client ManagementLocksClient) DeleteAtResourceGroupLevel(ctx context.Conte 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.NewErrorWithValidationError(err, "locks.ManagementLocksClient", "DeleteAtResourceGroupLevel") + return result, validation.NewError("locks.ManagementLocksClient", "DeleteAtResourceGroupLevel", err.Error()) } req, err := client.DeleteAtResourceGroupLevelPreparer(ctx, resourceGroupName, lockName) @@ -446,16 +447,16 @@ func (client ManagementLocksClient) DeleteAtResourceGroupLevelResponder(resp *ht // // resourceGroupName is the name of the resource group containing the resource with the lock to delete. // resourceProviderNamespace is the resource provider namespace of the resource with the lock to delete. -// parentResourcePath is the parent resource identity. resourceType is the resource type of the resource with the lock -// to delete. resourceName is the name of the resource with the lock to delete. lockName is the name of the lock to -// delete. +// parentResourcePath is the parent resource identity. resourceType is the resource type of the resource with the +// lock to delete. resourceName is the name of the resource with the lock to delete. lockName is the name of the +// lock to delete. func (client ManagementLocksClient) DeleteAtResourceLevel(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, lockName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "locks.ManagementLocksClient", "DeleteAtResourceLevel") + return result, validation.NewError("locks.ManagementLocksClient", "DeleteAtResourceLevel", err.Error()) } req, err := client.DeleteAtResourceLevelPreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, lockName) @@ -662,7 +663,7 @@ func (client ManagementLocksClient) GetAtResourceGroupLevel(ctx context.Context, 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.NewErrorWithValidationError(err, "locks.ManagementLocksClient", "GetAtResourceGroupLevel") + return result, validation.NewError("locks.ManagementLocksClient", "GetAtResourceGroupLevel", err.Error()) } req, err := client.GetAtResourceGroupLevelPreparer(ctx, resourceGroupName, lockName) @@ -730,15 +731,16 @@ func (client ManagementLocksClient) GetAtResourceGroupLevelResponder(resp *http. // GetAtResourceLevel get the management lock of a resource or any level below resource. // // resourceGroupName is the name of the resource group. resourceProviderNamespace is the namespace of the resource -// provider. parentResourcePath is an extra path parameter needed in some services, like SQL Databases. resourceType is -// the type of the resource. resourceName is the name of the resource. lockName is the name of lock. +// provider. parentResourcePath is an extra path parameter needed in some services, like SQL Databases. +// resourceType is the type of the resource. resourceName is the name of the resource. lockName is the name of +// lock. func (client ManagementLocksClient) GetAtResourceLevel(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, lockName string) (result ManagementLockObject, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "locks.ManagementLocksClient", "GetAtResourceLevel") + return result, validation.NewError("locks.ManagementLocksClient", "GetAtResourceLevel", err.Error()) } req, err := client.GetAtResourceLevelPreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, lockName) @@ -939,15 +941,15 @@ func (client ManagementLocksClient) GetByScopeResponder(resp *http.Response) (re // ListAtResourceGroupLevel gets all the management locks for a resource group. // -// resourceGroupName is the name of the resource group containing the locks to get. filter is the filter to apply on -// the operation. +// resourceGroupName is the name of the resource group containing the locks to get. filter is the filter to apply +// on the operation. func (client ManagementLocksClient) ListAtResourceGroupLevel(ctx context.Context, resourceGroupName string, filter string) (result ManagementLockListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "locks.ManagementLocksClient", "ListAtResourceGroupLevel") + return result, validation.NewError("locks.ManagementLocksClient", "ListAtResourceGroupLevel", err.Error()) } result.fn = client.listAtResourceGroupLevelNextResults @@ -1044,17 +1046,17 @@ func (client ManagementLocksClient) ListAtResourceGroupLevelComplete(ctx context // ListAtResourceLevel gets all the management locks for a resource or any level below resource. // -// resourceGroupName is the name of the resource group containing the locked resource. The name is case insensitive. -// resourceProviderNamespace is the namespace of the resource provider. parentResourcePath is the parent resource -// identity. resourceType is the resource type of the locked resource. resourceName is the name of the locked resource. -// filter is the filter to apply on the operation. +// resourceGroupName is the name of the resource group containing the locked resource. The name is case +// insensitive. resourceProviderNamespace is the namespace of the resource provider. parentResourcePath is the +// parent resource identity. resourceType is the resource type of the locked resource. resourceName is the name of +// the locked resource. filter is the filter to apply on the operation. func (client ManagementLocksClient) ListAtResourceLevel(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, filter string) (result ManagementLockListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "locks.ManagementLocksClient", "ListAtResourceLevel") + return result, validation.NewError("locks.ManagementLocksClient", "ListAtResourceLevel", err.Error()) } result.fn = client.listAtResourceLevelNextResults diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-09-01/locks/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-09-01/locks/models.go index cc85f0a7b564..d39382a2d611 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-09-01/locks/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-09-01/locks/models.go @@ -158,46 +158,45 @@ func (mlo *ManagementLockObject) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ManagementLockProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var managementLockProperties ManagementLockProperties + err = json.Unmarshal(*v, &managementLockProperties) + if err != nil { + return err + } + mlo.ManagementLockProperties = &managementLockProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mlo.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mlo.Type = &typeVar + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mlo.Name = &name + } } - mlo.ManagementLockProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - mlo.ID = &ID - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - mlo.Type = &typeVar - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - mlo.Name = &name } return nil diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-09-01/locks/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-09-01/locks/version.go index abe014d19ee0..5d5cb6580483 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-09-01/locks/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-09-01/locks/version.go @@ -1,5 +1,7 @@ package locks +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package locks // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta services" + return "Azure-SDK-For-Go/" + version.Number + " locks/2016-09-01" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/deploymentoperations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/deploymentoperations.go index 56f1c8619ee4..6511bc72bf5c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/deploymentoperations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/deploymentoperations.go @@ -42,8 +42,8 @@ func NewDeploymentOperationsClientWithBaseURI(baseURI string, subscriptionID str // Get gets a deployments operation. // -// resourceGroupName is the name of the resource group. The name is case insensitive. deploymentName is the name of the -// deployment. operationID is the ID of the operation to get. +// resourceGroupName is the name of the resource group. The name is case insensitive. deploymentName is the name of +// the deployment. operationID is the ID of the operation to get. func (client DeploymentOperationsClient) Get(ctx context.Context, resourceGroupName string, deploymentName string, operationID string) (result DeploymentOperation, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -54,7 +54,7 @@ func (client DeploymentOperationsClient) Get(ctx context.Context, resourceGroupN Constraints: []validation.Constraint{{Target: "deploymentName", Name: validation.MaxLength, Rule: 64, Chain: nil}, {Target: "deploymentName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "deploymentName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "resources.DeploymentOperationsClient", "Get") + return result, validation.NewError("resources.DeploymentOperationsClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, deploymentName, operationID) @@ -122,8 +122,8 @@ func (client DeploymentOperationsClient) GetResponder(resp *http.Response) (resu // List gets all deployments operations for a deployment. // -// resourceGroupName is the name of the resource group. The name is case insensitive. deploymentName is the name of the -// deployment with the operation to get. top is the number of results to return. +// resourceGroupName is the name of the resource group. The name is case insensitive. deploymentName is the name of +// the deployment with the operation to get. top is the number of results to return. func (client DeploymentOperationsClient) List(ctx context.Context, resourceGroupName string, deploymentName string, top *int32) (result DeploymentOperationsListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -134,7 +134,7 @@ func (client DeploymentOperationsClient) List(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "deploymentName", Name: validation.MaxLength, Rule: 64, Chain: nil}, {Target: "deploymentName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "deploymentName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "resources.DeploymentOperationsClient", "List") + return result, validation.NewError("resources.DeploymentOperationsClient", "List", err.Error()) } result.fn = client.listNextResults diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/deployments.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/deployments.go index 38a104b10b66..ca69cee929e9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/deployments.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/deployments.go @@ -44,8 +44,8 @@ func NewDeploymentsClientWithBaseURI(baseURI string, subscriptionID string) Depl // canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running // template deployment and leaves the resource group partially deployed. // -// resourceGroupName is the name of the resource group. The name is case insensitive. deploymentName is the name of the -// deployment to cancel. +// resourceGroupName is the name of the resource group. The name is case insensitive. deploymentName is the name of +// the deployment to cancel. func (client DeploymentsClient) Cancel(ctx context.Context, resourceGroupName string, deploymentName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -56,7 +56,7 @@ func (client DeploymentsClient) Cancel(ctx context.Context, resourceGroupName st Constraints: []validation.Constraint{{Target: "deploymentName", Name: validation.MaxLength, Rule: 64, Chain: nil}, {Target: "deploymentName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "deploymentName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "resources.DeploymentsClient", "Cancel") + return result, validation.NewError("resources.DeploymentsClient", "Cancel", err.Error()) } req, err := client.CancelPreparer(ctx, resourceGroupName, deploymentName) @@ -134,7 +134,7 @@ func (client DeploymentsClient) CheckExistence(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "deploymentName", Name: validation.MaxLength, Rule: 64, Chain: nil}, {Target: "deploymentName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "deploymentName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "resources.DeploymentsClient", "CheckExistence") + return result, validation.NewError("resources.DeploymentsClient", "CheckExistence", err.Error()) } req, err := client.CheckExistencePreparer(ctx, resourceGroupName, deploymentName) @@ -200,9 +200,9 @@ func (client DeploymentsClient) CheckExistenceResponder(resp *http.Response) (re // CreateOrUpdate you can provide the template and parameters directly in the request or link to JSON files. // -// resourceGroupName is the name of the resource group to deploy the resources to. The name is case insensitive. The -// resource group must already exist. deploymentName is the name of the deployment. parameters is additional parameters -// supplied to the operation. +// resourceGroupName is the name of the resource group to deploy the resources to. The name is case insensitive. +// The resource group must already exist. deploymentName is the name of the deployment. parameters is additional +// parameters supplied to the operation. func (client DeploymentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, deploymentName string, parameters Deployment) (result DeploymentsCreateOrUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -220,7 +220,7 @@ func (client DeploymentsClient) CreateOrUpdate(ctx context.Context, resourceGrou {Target: "parameters.Properties.ParametersLink", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.Properties.ParametersLink.URI", Name: validation.Null, Rule: true, Chain: nil}}}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "resources.DeploymentsClient", "CreateOrUpdate") + return result, validation.NewError("resources.DeploymentsClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, deploymentName, parameters) @@ -309,7 +309,7 @@ func (client DeploymentsClient) Delete(ctx context.Context, resourceGroupName st Constraints: []validation.Constraint{{Target: "deploymentName", Name: validation.MaxLength, Rule: 64, Chain: nil}, {Target: "deploymentName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "deploymentName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "resources.DeploymentsClient", "Delete") + return result, validation.NewError("resources.DeploymentsClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, deploymentName) @@ -377,8 +377,8 @@ func (client DeploymentsClient) DeleteResponder(resp *http.Response) (result aut // ExportTemplate exports the template used for specified deployment. // -// resourceGroupName is the name of the resource group. The name is case insensitive. deploymentName is the name of the -// deployment from which to get the template. +// resourceGroupName is the name of the resource group. The name is case insensitive. deploymentName is the name of +// the deployment from which to get the template. func (client DeploymentsClient) ExportTemplate(ctx context.Context, resourceGroupName string, deploymentName string) (result DeploymentExportResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -389,7 +389,7 @@ func (client DeploymentsClient) ExportTemplate(ctx context.Context, resourceGrou Constraints: []validation.Constraint{{Target: "deploymentName", Name: validation.MaxLength, Rule: 64, Chain: nil}, {Target: "deploymentName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "deploymentName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "resources.DeploymentsClient", "ExportTemplate") + return result, validation.NewError("resources.DeploymentsClient", "ExportTemplate", err.Error()) } req, err := client.ExportTemplatePreparer(ctx, resourceGroupName, deploymentName) @@ -456,8 +456,8 @@ func (client DeploymentsClient) ExportTemplateResponder(resp *http.Response) (re // Get gets a deployment. // -// resourceGroupName is the name of the resource group. The name is case insensitive. deploymentName is the name of the -// deployment to get. +// resourceGroupName is the name of the resource group. The name is case insensitive. deploymentName is the name of +// the deployment to get. func (client DeploymentsClient) Get(ctx context.Context, resourceGroupName string, deploymentName string) (result DeploymentExtended, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -468,7 +468,7 @@ func (client DeploymentsClient) Get(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "deploymentName", Name: validation.MaxLength, Rule: 64, Chain: nil}, {Target: "deploymentName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "deploymentName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "resources.DeploymentsClient", "Get") + return result, validation.NewError("resources.DeploymentsClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, deploymentName) @@ -536,15 +536,15 @@ func (client DeploymentsClient) GetResponder(resp *http.Response) (result Deploy // ListByResourceGroup get all the deployments for a resource group. // // resourceGroupName is the name of the resource group with the deployments to get. The name is case insensitive. -// filter is the filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'. top -// is the number of results to get. If null is passed, returns all deployments. +// filter is the filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'. +// top is the number of results to get. If null is passed, returns all deployments. func (client DeploymentsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, top *int32) (result DeploymentListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "resources.DeploymentsClient", "ListByResourceGroup") + return result, validation.NewError("resources.DeploymentsClient", "ListByResourceGroup", err.Error()) } result.fn = client.listByResourceGroupNextResults @@ -645,8 +645,8 @@ func (client DeploymentsClient) ListByResourceGroupComplete(ctx context.Context, // Validate validates whether the specified template is syntactically correct and will be accepted by Azure Resource // Manager.. // -// resourceGroupName is the name of the resource group the template will be deployed to. The name is case insensitive. -// deploymentName is the name of the deployment. parameters is parameters to validate. +// resourceGroupName is the name of the resource group the template will be deployed to. The name is case +// insensitive. deploymentName is the name of the deployment. parameters is parameters to validate. func (client DeploymentsClient) Validate(ctx context.Context, resourceGroupName string, deploymentName string, parameters Deployment) (result DeploymentValidateResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -664,7 +664,7 @@ func (client DeploymentsClient) Validate(ctx context.Context, resourceGroupName {Target: "parameters.Properties.ParametersLink", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.Properties.ParametersLink.URI", Name: validation.Null, Rule: true, Chain: nil}}}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "resources.DeploymentsClient", "Validate") + return result, validation.NewError("resources.DeploymentsClient", "Validate", err.Error()) } req, err := client.ValidatePreparer(ctx, resourceGroupName, deploymentName, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/groups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/groups.go index 578854d5dee7..5c4962a0655d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/groups.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/groups.go @@ -49,7 +49,7 @@ func (client GroupsClient) CheckExistence(ctx context.Context, 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.NewErrorWithValidationError(err, "resources.GroupsClient", "CheckExistence") + return result, validation.NewError("resources.GroupsClient", "CheckExistence", err.Error()) } req, err := client.CheckExistencePreparer(ctx, resourceGroupName) @@ -114,8 +114,8 @@ func (client GroupsClient) CheckExistenceResponder(resp *http.Response) (result // CreateOrUpdate creates or updates a resource group. // -// resourceGroupName is the name of the resource group to create or update. parameters is parameters supplied to the -// create or update a resource group. +// resourceGroupName is the name of the resource group to create or update. parameters is parameters supplied to +// the create or update a resource group. func (client GroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, parameters Group) (result Group, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -124,7 +124,7 @@ func (client GroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "resources.GroupsClient", "CreateOrUpdate") + return result, validation.NewError("resources.GroupsClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, parameters) @@ -200,7 +200,7 @@ func (client GroupsClient) Delete(ctx context.Context, resourceGroupName string) 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.NewErrorWithValidationError(err, "resources.GroupsClient", "Delete") + return result, validation.NewError("resources.GroupsClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName) @@ -267,15 +267,15 @@ func (client GroupsClient) DeleteResponder(resp *http.Response) (result autorest // ExportTemplate captures the specified resource group as a template. // -// resourceGroupName is the name of the resource group to export as a template. parameters is parameters for exporting -// the template. +// resourceGroupName is the name of the resource group to export as a template. parameters is parameters for +// exporting the template. func (client GroupsClient) ExportTemplate(ctx context.Context, resourceGroupName string, parameters ExportTemplateRequest) (result GroupExportResult, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "resources.GroupsClient", "ExportTemplate") + return result, validation.NewError("resources.GroupsClient", "ExportTemplate", err.Error()) } req, err := client.ExportTemplatePreparer(ctx, resourceGroupName, parameters) @@ -350,7 +350,7 @@ func (client GroupsClient) Get(ctx context.Context, resourceGroupName string) (r 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.NewErrorWithValidationError(err, "resources.GroupsClient", "Get") + return result, validation.NewError("resources.GroupsClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName) @@ -416,8 +416,8 @@ func (client GroupsClient) GetResponder(resp *http.Response) (result Group, err // List gets all the resource groups for a subscription. // -// filter is the filter to apply on the operation. top is the number of results to return. If null is passed, returns -// all resource groups. +// filter is the filter to apply on the operation. top is the number of results to return. If null is passed, +// returns all resource groups. func (client GroupsClient) List(ctx context.Context, filter string, top *int32) (result GroupListResultPage, err error) { result.fn = client.listNextResults req, err := client.ListPreparer(ctx, filter, top) @@ -524,7 +524,7 @@ func (client GroupsClient) Update(ctx context.Context, resourceGroupName string, 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.NewErrorWithValidationError(err, "resources.GroupsClient", "Update") + return result, validation.NewError("resources.GroupsClient", "Update", err.Error()) } req, err := client.UpdatePreparer(ctx, resourceGroupName, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/models.go index 8deceac67a87..0963e1559e3b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/models.go @@ -18,6 +18,7 @@ package resources // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( + "encoding/json" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/date" @@ -69,12 +70,204 @@ type BasicDependency struct { ResourceName *string `json:"resourceName,omitempty"` } +// CreateOrUpdateByIDFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type CreateOrUpdateByIDFuture struct { + azure.Future + req *http.Request +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future CreateOrUpdateByIDFuture) Result(client Client) (gr GenericResource, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.CreateOrUpdateByIDFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + return gr, azure.NewAsyncOpIncompleteError("resources.CreateOrUpdateByIDFuture") + } + if future.PollingMethod() == azure.PollingLocation { + gr, err = client.CreateOrUpdateByIDResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.CreateOrUpdateByIDFuture", "Result", future.Response(), "Failure responding to request") + } + return + } + var req *http.Request + var resp *http.Response + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.CreateOrUpdateByIDFuture", "Result", resp, "Failure sending request") + return + } + gr, err = client.CreateOrUpdateByIDResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.CreateOrUpdateByIDFuture", "Result", resp, "Failure responding to request") + } + return +} + +// CreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type CreateOrUpdateFuture struct { + azure.Future + req *http.Request +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future CreateOrUpdateFuture) Result(client Client) (gr GenericResource, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.CreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + return gr, azure.NewAsyncOpIncompleteError("resources.CreateOrUpdateFuture") + } + if future.PollingMethod() == azure.PollingLocation { + gr, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.CreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } + return + } + var req *http.Request + var resp *http.Response + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.CreateOrUpdateFuture", "Result", resp, "Failure sending request") + return + } + gr, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.CreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } + return +} + // DebugSetting ... type DebugSetting struct { // DetailLevel - Specifies the type of information to log for debugging. The permitted values are none, requestContent, responseContent, or both requestContent and responseContent separated by a comma. The default is none. When setting this value, carefully consider the type of information you are passing in during deployment. By logging information about the request or response, you could potentially expose sensitive data that is retrieved through the deployment operations. DetailLevel *string `json:"detailLevel,omitempty"` } +// DeleteByIDFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type DeleteByIDFuture struct { + azure.Future + req *http.Request +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future DeleteByIDFuture) Result(client Client) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.DeleteByIDFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + return ar, azure.NewAsyncOpIncompleteError("resources.DeleteByIDFuture") + } + if future.PollingMethod() == azure.PollingLocation { + ar, err = client.DeleteByIDResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.DeleteByIDFuture", "Result", future.Response(), "Failure responding to request") + } + return + } + var req *http.Request + var resp *http.Response + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.DeleteByIDFuture", "Result", resp, "Failure sending request") + return + } + ar, err = client.DeleteByIDResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.DeleteByIDFuture", "Result", resp, "Failure responding to request") + } + return +} + +// DeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type DeleteFuture struct { + azure.Future + req *http.Request +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future DeleteFuture) Result(client Client) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.DeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + return ar, azure.NewAsyncOpIncompleteError("resources.DeleteFuture") + } + if future.PollingMethod() == azure.PollingLocation { + ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.DeleteFuture", "Result", future.Response(), "Failure responding to request") + } + return + } + var req *http.Request + var resp *http.Response + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.DeleteFuture", "Result", resp, "Failure sending request") + return + } + ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.DeleteFuture", "Result", resp, "Failure responding to request") + } + return +} + // Dependency deployment dependency information. type Dependency struct { // DependsOn - The list of dependencies. @@ -97,7 +290,7 @@ type Deployment struct { type DeploymentExportResult struct { autorest.Response `json:"-"` // Template - The template content. - Template *map[string]interface{} `json:"template,omitempty"` + Template interface{} `json:"template,omitempty"` } // DeploymentExtended deployment information. @@ -241,7 +434,7 @@ type DeploymentOperationProperties struct { // StatusCode - Operation status code. StatusCode *string `json:"statusCode,omitempty"` // StatusMessage - Operation status message. - StatusMessage *map[string]interface{} `json:"statusMessage,omitempty"` + StatusMessage interface{} `json:"statusMessage,omitempty"` // TargetResource - The target resource. TargetResource *TargetResource `json:"targetResource,omitempty"` // Request - The HTTP request message. @@ -355,11 +548,11 @@ func (page DeploymentOperationsListResultPage) Values() []DeploymentOperation { // DeploymentProperties deployment properties. type DeploymentProperties struct { // Template - The template content. You use this element when you want to pass the template syntax directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the templateLink property or the template property, but not both. - Template *map[string]interface{} `json:"template,omitempty"` + Template interface{} `json:"template,omitempty"` // TemplateLink - The URI of the template. Use either the templateLink property or the template property, but not both. TemplateLink *TemplateLink `json:"templateLink,omitempty"` // Parameters - Name and value pairs that define the deployment parameters for the template. You use this element when you want to provide the parameter values directly in the request rather than link to an existing parameter file. Use either the parametersLink property or the parameters property, but not both. It can be a JObject or a well formed JSON string. - Parameters *map[string]interface{} `json:"parameters,omitempty"` + Parameters interface{} `json:"parameters,omitempty"` // ParametersLink - The URI of parameters file. You use this element to link to an existing parameters file. Use either the parametersLink property or the parameters property, but not both. ParametersLink *ParametersLink `json:"parametersLink,omitempty"` // Mode - The mode that is used to deploy resources. This value can be either Incremental or Complete. In Incremental mode, resources are deployed without deleting existing resources that are not included in the template. In Complete mode, resources are deployed and existing resources in the resource group that are not included in the template are deleted. Be careful when using Complete mode as you may unintentionally delete resources. Possible values include: 'Incremental', 'Complete' @@ -377,17 +570,17 @@ type DeploymentPropertiesExtended struct { // Timestamp - The timestamp of the template deployment. Timestamp *date.Time `json:"timestamp,omitempty"` // Outputs - Key/value pairs that represent deploymentoutput. - Outputs *map[string]interface{} `json:"outputs,omitempty"` + Outputs interface{} `json:"outputs,omitempty"` // Providers - The list of resource providers needed for the deployment. Providers *[]Provider `json:"providers,omitempty"` // Dependencies - The list of deployment dependencies. Dependencies *[]Dependency `json:"dependencies,omitempty"` // Template - The template content. Use only one of Template or TemplateLink. - Template *map[string]interface{} `json:"template,omitempty"` + Template interface{} `json:"template,omitempty"` // TemplateLink - The URI referencing the template. Use only one of Template or TemplateLink. TemplateLink *TemplateLink `json:"templateLink,omitempty"` // Parameters - Deployment parameters. Use only one of Parameters or ParametersLink. - Parameters *map[string]interface{} `json:"parameters,omitempty"` + Parameters interface{} `json:"parameters,omitempty"` // ParametersLink - The URI referencing the parameters. Use only one of Parameters or ParametersLink. ParametersLink *ParametersLink `json:"parametersLink,omitempty"` // Mode - The deployment mode. Possible values are Incremental and Complete. Possible values include: 'Incremental', 'Complete' @@ -409,22 +602,39 @@ func (future DeploymentsCreateOrUpdateFuture) Result(client DeploymentsClient) ( var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "resources.DeploymentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return de, autorest.NewError("resources.DeploymentsCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return de, azure.NewAsyncOpIncompleteError("resources.DeploymentsCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { de, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.DeploymentsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "resources.DeploymentsCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } de, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.DeploymentsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -440,22 +650,39 @@ func (future DeploymentsDeleteFuture) Result(client DeploymentsClient) (ar autor var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "resources.DeploymentsDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("resources.DeploymentsDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("resources.DeploymentsDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.DeploymentsDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "resources.DeploymentsDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.DeploymentsDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -479,20 +706,10 @@ type ExportTemplateRequest struct { // GenericResource resource information. type GenericResource struct { autorest.Response `json:"-"` - // ID - Resource ID - ID *string `json:"id,omitempty"` - // Name - Resource name - Name *string `json:"name,omitempty"` - // Type - Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` // Plan - The plan of the resource. Plan *Plan `json:"plan,omitempty"` // Properties - The resource properties. - Properties *map[string]interface{} `json:"properties,omitempty"` + Properties interface{} `json:"properties,omitempty"` // Kind - The kind of the resource. Kind *string `json:"kind,omitempty"` // ManagedBy - ID of the resource that manages this resource. @@ -501,6 +718,53 @@ type GenericResource struct { Sku *Sku `json:"sku,omitempty"` // Identity - The identity of the resource. Identity *Identity `json:"identity,omitempty"` + // ID - Resource ID + ID *string `json:"id,omitempty"` + // Name - Resource name + Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for GenericResource. +func (gr GenericResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gr.Plan != nil { + objectMap["plan"] = gr.Plan + } + objectMap["properties"] = gr.Properties + if gr.Kind != nil { + objectMap["kind"] = gr.Kind + } + if gr.ManagedBy != nil { + objectMap["managedBy"] = gr.ManagedBy + } + if gr.Sku != nil { + objectMap["sku"] = gr.Sku + } + if gr.Identity != nil { + objectMap["identity"] = gr.Identity + } + if gr.ID != nil { + objectMap["id"] = gr.ID + } + if gr.Name != nil { + objectMap["name"] = gr.Name + } + if gr.Type != nil { + objectMap["type"] = gr.Type + } + if gr.Location != nil { + objectMap["location"] = gr.Location + } + if gr.Tags != nil { + objectMap["tags"] = gr.Tags + } + return json.Marshal(objectMap) } // GenericResourceFilter resource filter. @@ -521,19 +785,43 @@ type Group struct { // Name - The name of the resource group. Name *string `json:"name,omitempty"` Properties *GroupProperties `json:"properties,omitempty"` - // Location - The location of the resource group. It cannot be changed after the resource group has been created. It muct be one of the supported Azure locations. + // Location - The location of the resource group. It cannot be changed after the resource group has been created. It must be one of the supported Azure locations. Location *string `json:"location,omitempty"` // ManagedBy - The ID of the resource that manages this resource group. ManagedBy *string `json:"managedBy,omitempty"` // Tags - The tags attached to the resource group. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Group. +func (g Group) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if g.ID != nil { + objectMap["id"] = g.ID + } + if g.Name != nil { + objectMap["name"] = g.Name + } + if g.Properties != nil { + objectMap["properties"] = g.Properties + } + if g.Location != nil { + objectMap["location"] = g.Location + } + if g.ManagedBy != nil { + objectMap["managedBy"] = g.ManagedBy + } + if g.Tags != nil { + objectMap["tags"] = g.Tags + } + return json.Marshal(objectMap) } // GroupExportResult resource group export result. type GroupExportResult struct { autorest.Response `json:"-"` // Template - The template content. - Template *map[string]interface{} `json:"template,omitempty"` + Template interface{} `json:"template,omitempty"` // Error - The error. Error *ManagementErrorWithDetails `json:"error,omitempty"` } @@ -656,7 +944,25 @@ type GroupPatchable struct { // ManagedBy - The ID of the resource that manages this resource group. ManagedBy *string `json:"managedBy,omitempty"` // Tags - The tags attached to the resource group. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for GroupPatchable. +func (gp GroupPatchable) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gp.Name != nil { + objectMap["name"] = gp.Name + } + if gp.Properties != nil { + objectMap["properties"] = gp.Properties + } + if gp.ManagedBy != nil { + objectMap["managedBy"] = gp.ManagedBy + } + if gp.Tags != nil { + objectMap["tags"] = gp.Tags + } + return json.Marshal(objectMap) } // GroupProperties the resource group properties. @@ -677,29 +983,46 @@ func (future GroupsDeleteFuture) Result(client GroupsClient) (ar autorest.Respon var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "resources.GroupsDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("resources.GroupsDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("resources.GroupsDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.GroupsDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "resources.GroupsDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.GroupsDeleteFuture", "Result", resp, "Failure responding to request") + } return } // HTTPMessage HTTP message. type HTTPMessage struct { // Content - HTTP message content. - Content *map[string]interface{} `json:"content,omitempty"` + Content interface{} `json:"content,omitempty"` } // Identity identity for the resource. @@ -834,6 +1157,54 @@ type MoveInfo struct { TargetResourceGroup *string `json:"targetResourceGroup,omitempty"` } +// MoveResourcesFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type MoveResourcesFuture struct { + azure.Future + req *http.Request +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future MoveResourcesFuture) Result(client Client) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.MoveResourcesFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + return ar, azure.NewAsyncOpIncompleteError("resources.MoveResourcesFuture") + } + if future.PollingMethod() == azure.PollingLocation { + ar, err = client.MoveResourcesResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.MoveResourcesFuture", "Result", future.Response(), "Failure responding to request") + } + return + } + var req *http.Request + var resp *http.Response + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.MoveResourcesFuture", "Result", resp, "Failure sending request") + return + } + ar, err = client.MoveResourcesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.MoveResourcesFuture", "Result", resp, "Failure responding to request") + } + return +} + // ParametersLink entity representing the reference to the deployment paramaters. type ParametersLink struct { // URI - The URI of the parameters file. @@ -852,6 +1223,8 @@ type Plan struct { Product *string `json:"product,omitempty"` // PromotionCode - The promotion code. PromotionCode *string `json:"promotionCode,omitempty"` + // Version - The plan's version. + Version *string `json:"version,omitempty"` } // Provider resource provider information. @@ -994,7 +1367,28 @@ type ProviderResourceType struct { // APIVersions - The API version. APIVersions *[]string `json:"apiVersions,omitempty"` // Properties - The properties. - Properties *map[string]*string `json:"properties,omitempty"` + Properties map[string]*string `json:"properties"` +} + +// MarshalJSON is the custom marshaler for ProviderResourceType. +func (prt ProviderResourceType) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if prt.ResourceType != nil { + objectMap["resourceType"] = prt.ResourceType + } + if prt.Locations != nil { + objectMap["locations"] = prt.Locations + } + if prt.Aliases != nil { + objectMap["aliases"] = prt.Aliases + } + if prt.APIVersions != nil { + objectMap["apiVersions"] = prt.APIVersions + } + if prt.Properties != nil { + objectMap["properties"] = prt.Properties + } + return json.Marshal(objectMap) } // Resource resource. @@ -1008,257 +1402,28 @@ type Resource struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` -} - -// ResourcesCreateOrUpdateByIDFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ResourcesCreateOrUpdateByIDFuture struct { - azure.Future - req *http.Request + Tags map[string]*string `json:"tags"` } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future ResourcesCreateOrUpdateByIDFuture) Result(client Client) (gr GenericResource, err error) { - var done bool - done, err = future.Done(client) - if err != nil { - return - } - if !done { - return gr, autorest.NewError("resources.ResourcesCreateOrUpdateByIDFuture", "Result", "asynchronous operation has not completed") - } - if future.PollingMethod() == azure.PollingLocation { - gr, err = client.CreateOrUpdateByIDResponder(future.Response()) - return - } - var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if err != nil { - return +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.ID != nil { + objectMap["id"] = r.ID } - gr, err = client.CreateOrUpdateByIDResponder(resp) - return -} - -// ResourcesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type ResourcesCreateOrUpdateFuture struct { - azure.Future - req *http.Request -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future ResourcesCreateOrUpdateFuture) Result(client Client) (gr GenericResource, err error) { - var done bool - done, err = future.Done(client) - if err != nil { - return + if r.Name != nil { + objectMap["name"] = r.Name } - if !done { - return gr, autorest.NewError("resources.ResourcesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + if r.Type != nil { + objectMap["type"] = r.Type } - if future.PollingMethod() == azure.PollingLocation { - gr, err = client.CreateOrUpdateResponder(future.Response()) - return + if r.Location != nil { + objectMap["location"] = r.Location } - var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if err != nil { - return + if r.Tags != nil { + objectMap["tags"] = r.Tags } - gr, err = client.CreateOrUpdateResponder(resp) - return -} - -// ResourcesDeleteByIDFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type ResourcesDeleteByIDFuture struct { - azure.Future - req *http.Request -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future ResourcesDeleteByIDFuture) Result(client Client) (ar autorest.Response, err error) { - var done bool - done, err = future.Done(client) - if err != nil { - return - } - if !done { - return ar, autorest.NewError("resources.ResourcesDeleteByIDFuture", "Result", "asynchronous operation has not completed") - } - if future.PollingMethod() == azure.PollingLocation { - ar, err = client.DeleteByIDResponder(future.Response()) - return - } - var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if err != nil { - return - } - ar, err = client.DeleteByIDResponder(resp) - return -} - -// ResourcesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type ResourcesDeleteFuture struct { - azure.Future - req *http.Request -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future ResourcesDeleteFuture) Result(client Client) (ar autorest.Response, err error) { - var done bool - done, err = future.Done(client) - if err != nil { - return - } - if !done { - return ar, autorest.NewError("resources.ResourcesDeleteFuture", "Result", "asynchronous operation has not completed") - } - if future.PollingMethod() == azure.PollingLocation { - ar, err = client.DeleteResponder(future.Response()) - return - } - var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if err != nil { - return - } - ar, err = client.DeleteResponder(resp) - return -} - -// ResourcesMoveResourcesFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type ResourcesMoveResourcesFuture struct { - azure.Future - req *http.Request -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future ResourcesMoveResourcesFuture) Result(client Client) (ar autorest.Response, err error) { - var done bool - done, err = future.Done(client) - if err != nil { - return - } - if !done { - return ar, autorest.NewError("resources.ResourcesMoveResourcesFuture", "Result", "asynchronous operation has not completed") - } - if future.PollingMethod() == azure.PollingLocation { - ar, err = client.MoveResourcesResponder(future.Response()) - return - } - var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if err != nil { - return - } - ar, err = client.MoveResourcesResponder(resp) - return -} - -// ResourcesUpdateByIDFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type ResourcesUpdateByIDFuture struct { - azure.Future - req *http.Request -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future ResourcesUpdateByIDFuture) Result(client Client) (gr GenericResource, err error) { - var done bool - done, err = future.Done(client) - if err != nil { - return - } - if !done { - return gr, autorest.NewError("resources.ResourcesUpdateByIDFuture", "Result", "asynchronous operation has not completed") - } - if future.PollingMethod() == azure.PollingLocation { - gr, err = client.UpdateByIDResponder(future.Response()) - return - } - var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if err != nil { - return - } - gr, err = client.UpdateByIDResponder(resp) - return -} - -// ResourcesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type ResourcesUpdateFuture struct { - azure.Future - req *http.Request -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future ResourcesUpdateFuture) Result(client Client) (gr GenericResource, err error) { - var done bool - done, err = future.Done(client) - if err != nil { - return - } - if !done { - return gr, autorest.NewError("resources.ResourcesUpdateFuture", "Result", "asynchronous operation has not completed") - } - if future.PollingMethod() == azure.PollingLocation { - gr, err = client.UpdateResponder(future.Response()) - return - } - var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if err != nil { - return - } - gr, err = client.UpdateResponder(resp) - return -} - -// ResourcesValidateMoveResourcesFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ResourcesValidateMoveResourcesFuture struct { - azure.Future - req *http.Request -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future ResourcesValidateMoveResourcesFuture) Result(client Client) (ar autorest.Response, err error) { - var done bool - done, err = future.Done(client) - if err != nil { - return - } - if !done { - return ar, autorest.NewError("resources.ResourcesValidateMoveResourcesFuture", "Result", "asynchronous operation has not completed") - } - if future.PollingMethod() == azure.PollingLocation { - ar, err = client.ValidateMoveResourcesResponder(future.Response()) - return - } - var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if err != nil { - return - } - ar, err = client.ValidateMoveResourcesResponder(resp) - return + return json.Marshal(objectMap) } // Sku SKU for the resource. @@ -1434,3 +1599,148 @@ type TemplateLink struct { // ContentVersion - If included, must match the ContentVersion in the template. ContentVersion *string `json:"contentVersion,omitempty"` } + +// UpdateByIDFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type UpdateByIDFuture struct { + azure.Future + req *http.Request +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future UpdateByIDFuture) Result(client Client) (gr GenericResource, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.UpdateByIDFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + return gr, azure.NewAsyncOpIncompleteError("resources.UpdateByIDFuture") + } + if future.PollingMethod() == azure.PollingLocation { + gr, err = client.UpdateByIDResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.UpdateByIDFuture", "Result", future.Response(), "Failure responding to request") + } + return + } + var req *http.Request + var resp *http.Response + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.UpdateByIDFuture", "Result", resp, "Failure sending request") + return + } + gr, err = client.UpdateByIDResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.UpdateByIDFuture", "Result", resp, "Failure responding to request") + } + return +} + +// UpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type UpdateFuture struct { + azure.Future + req *http.Request +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future UpdateFuture) Result(client Client) (gr GenericResource, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.UpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + return gr, azure.NewAsyncOpIncompleteError("resources.UpdateFuture") + } + if future.PollingMethod() == azure.PollingLocation { + gr, err = client.UpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.UpdateFuture", "Result", future.Response(), "Failure responding to request") + } + return + } + var req *http.Request + var resp *http.Response + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.UpdateFuture", "Result", resp, "Failure sending request") + return + } + gr, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.UpdateFuture", "Result", resp, "Failure responding to request") + } + return +} + +// ValidateMoveResourcesFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ValidateMoveResourcesFuture struct { + azure.Future + req *http.Request +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future ValidateMoveResourcesFuture) Result(client Client) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.ValidateMoveResourcesFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + return ar, azure.NewAsyncOpIncompleteError("resources.ValidateMoveResourcesFuture") + } + if future.PollingMethod() == azure.PollingLocation { + ar, err = client.ValidateMoveResourcesResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.ValidateMoveResourcesFuture", "Result", future.Response(), "Failure responding to request") + } + return + } + var req *http.Request + var resp *http.Response + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.ValidateMoveResourcesFuture", "Result", resp, "Failure sending request") + return + } + ar, err = client.ValidateMoveResourcesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "resources.ValidateMoveResourcesFuture", "Result", resp, "Failure responding to request") + } + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/resources.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/resources.go index 514734038a6f..1e15de210c44 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/resources.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/resources.go @@ -42,17 +42,17 @@ func NewClientWithBaseURI(baseURI string, subscriptionID string) Client { // CheckExistence checks whether a resource exists. // -// resourceGroupName is the name of the resource group containing the resource to check. The name is case insensitive. -// resourceProviderNamespace is the resource provider of the resource to check. parentResourcePath is the parent -// resource identity. resourceType is the resource type. resourceName is the name of the resource to check whether it -// exists. +// resourceGroupName is the name of the resource group containing the resource to check. The name is case +// insensitive. resourceProviderNamespace is the resource provider of the resource to check. parentResourcePath is +// the parent resource identity. resourceType is the resource type. resourceName is the name of the resource to +// check whether it exists. func (client Client) CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "resources.Client", "CheckExistence") + return result, validation.NewError("resources.Client", "CheckExistence", err.Error()) } req, err := client.CheckExistencePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) @@ -121,7 +121,8 @@ func (client Client) CheckExistenceResponder(resp *http.Response) (result autore // CheckExistenceByID checks by ID whether a resource exists. // -// resourceID is the fully qualified ID of the resource, including the resource name and resource type. Use the format, +// resourceID is the fully qualified ID of the resource, including the resource name and resource type. Use the +// format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} func (client Client) CheckExistenceByID(ctx context.Context, resourceID string) (result autorest.Response, err error) { req, err := client.CheckExistenceByIDPreparer(ctx, resourceID) @@ -187,9 +188,9 @@ func (client Client) CheckExistenceByIDResponder(resp *http.Response) (result au // // resourceGroupName is the name of the resource group for the resource. The name is case insensitive. // resourceProviderNamespace is the namespace of the resource provider. parentResourcePath is the parent resource -// identity. resourceType is the resource type of the resource to create. resourceName is the name of the resource to -// create. parameters is parameters for creating or updating the resource. -func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (result ResourcesCreateOrUpdateFuture, err error) { +// identity. resourceType is the resource type of the resource to create. resourceName is the name of the resource +// to create. parameters is parameters for creating or updating the resource. +func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (result CreateOrUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, @@ -198,7 +199,7 @@ func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName strin {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Kind", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.Kind", Name: validation.Pattern, Rule: `^[-\w\._,\(\)]+$`, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "resources.Client", "CreateOrUpdate") + return result, validation.NewError("resources.Client", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, parameters) @@ -244,7 +245,7 @@ func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupNa // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client Client) CreateOrUpdateSender(req *http.Request) (future ResourcesCreateOrUpdateFuture, err error) { +func (client Client) CreateOrUpdateSender(req *http.Request) (future CreateOrUpdateFuture, err error) { sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) future.Future = azure.NewFuture(req) future.req = req @@ -272,15 +273,16 @@ func (client Client) CreateOrUpdateResponder(resp *http.Response) (result Generi // CreateOrUpdateByID create a resource by ID. // -// resourceID is the fully qualified ID of the resource, including the resource name and resource type. Use the format, +// resourceID is the fully qualified ID of the resource, including the resource name and resource type. Use the +// format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} // parameters is create or update resource parameters. -func (client Client) CreateOrUpdateByID(ctx context.Context, resourceID string, parameters GenericResource) (result ResourcesCreateOrUpdateByIDFuture, err error) { +func (client Client) CreateOrUpdateByID(ctx context.Context, resourceID string, parameters GenericResource) (result CreateOrUpdateByIDFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Kind", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.Kind", Name: validation.Pattern, Rule: `^[-\w\._,\(\)]+$`, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "resources.Client", "CreateOrUpdateByID") + return result, validation.NewError("resources.Client", "CreateOrUpdateByID", err.Error()) } req, err := client.CreateOrUpdateByIDPreparer(ctx, resourceID, parameters) @@ -321,7 +323,7 @@ func (client Client) CreateOrUpdateByIDPreparer(ctx context.Context, resourceID // CreateOrUpdateByIDSender sends the CreateOrUpdateByID request. The method will close the // http.Response Body if it receives an error. -func (client Client) CreateOrUpdateByIDSender(req *http.Request) (future ResourcesCreateOrUpdateByIDFuture, err error) { +func (client Client) CreateOrUpdateByIDSender(req *http.Request) (future CreateOrUpdateByIDFuture, err error) { sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) future.Future = azure.NewFuture(req) future.req = req @@ -350,15 +352,15 @@ func (client Client) CreateOrUpdateByIDResponder(resp *http.Response) (result Ge // Delete deletes a resource. // // resourceGroupName is the name of the resource group that contains the resource to delete. The name is case -// insensitive. resourceProviderNamespace is the namespace of the resource provider. parentResourcePath is the parent -// resource identity. resourceType is the resource type. resourceName is the name of the resource to delete. -func (client Client) Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result ResourcesDeleteFuture, err error) { +// insensitive. resourceProviderNamespace is the namespace of the resource provider. parentResourcePath is the +// parent resource identity. resourceType is the resource type. resourceName is the name of the resource to delete. +func (client Client) Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result DeleteFuture, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "resources.Client", "Delete") + return result, validation.NewError("resources.Client", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) @@ -402,7 +404,7 @@ func (client Client) DeletePreparer(ctx context.Context, resourceGroupName strin // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. -func (client Client) DeleteSender(req *http.Request) (future ResourcesDeleteFuture, err error) { +func (client Client) DeleteSender(req *http.Request) (future DeleteFuture, err error) { sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) future.Future = azure.NewFuture(req) future.req = req @@ -429,9 +431,10 @@ func (client Client) DeleteResponder(resp *http.Response) (result autorest.Respo // DeleteByID deletes a resource by ID. // -// resourceID is the fully qualified ID of the resource, including the resource name and resource type. Use the format, +// resourceID is the fully qualified ID of the resource, including the resource name and resource type. Use the +// format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} -func (client Client) DeleteByID(ctx context.Context, resourceID string) (result ResourcesDeleteByIDFuture, err error) { +func (client Client) DeleteByID(ctx context.Context, resourceID string) (result DeleteByIDFuture, err error) { req, err := client.DeleteByIDPreparer(ctx, resourceID) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "DeleteByID", nil, "Failure preparing request") @@ -468,7 +471,7 @@ func (client Client) DeleteByIDPreparer(ctx context.Context, resourceID string) // DeleteByIDSender sends the DeleteByID request. The method will close the // http.Response Body if it receives an error. -func (client Client) DeleteByIDSender(req *http.Request) (future ResourcesDeleteByIDFuture, err error) { +func (client Client) DeleteByIDSender(req *http.Request) (future DeleteByIDFuture, err error) { sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) future.Future = azure.NewFuture(req) future.req = req @@ -495,16 +498,17 @@ func (client Client) DeleteByIDResponder(resp *http.Response) (result autorest.R // Get gets a resource. // -// resourceGroupName is the name of the resource group containing the resource to get. The name is case insensitive. -// resourceProviderNamespace is the namespace of the resource provider. parentResourcePath is the parent resource -// identity. resourceType is the resource type of the resource. resourceName is the name of the resource to get. +// resourceGroupName is the name of the resource group containing the resource to get. The name is case +// insensitive. resourceProviderNamespace is the namespace of the resource provider. parentResourcePath is the +// parent resource identity. resourceType is the resource type of the resource. resourceName is the name of the +// resource to get. func (client Client) Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result GenericResource, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "resources.Client", "Get") + return result, validation.NewError("resources.Client", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) @@ -574,7 +578,8 @@ func (client Client) GetResponder(resp *http.Response) (result GenericResource, // GetByID gets a resource by ID. // -// resourceID is the fully qualified ID of the resource, including the resource name and resource type. Use the format, +// resourceID is the fully qualified ID of the resource, including the resource name and resource type. Use the +// format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} func (client Client) GetByID(ctx context.Context, resourceID string) (result GenericResource, err error) { req, err := client.GetByIDPreparer(ctx, resourceID) @@ -639,8 +644,8 @@ func (client Client) GetByIDResponder(resp *http.Response) (result GenericResour // List get all the resources in a subscription. // -// filter is the filter to apply on the operation. expand is the $expand query parameter. top is the number of results -// to return. If null is passed, returns all resource groups. +// filter is the filter to apply on the operation. expand is the $expand query parameter. top is the number of +// results to return. If null is passed, returns all resource groups. func (client Client) List(ctx context.Context, filter string, expand string, top *int32) (result ListResultPage, err error) { result.fn = client.listNextResults req, err := client.ListPreparer(ctx, filter, expand, top) @@ -741,16 +746,16 @@ func (client Client) ListComplete(ctx context.Context, filter string, expand str // ListByResourceGroup get all the resources for a resource group. // -// resourceGroupName is the resource group with the resources to get. filter is the filter to apply on the operation. -// expand is the $expand query parameter top is the number of results to return. If null is passed, returns all -// resources. +// resourceGroupName is the resource group with the resources to get. filter is the filter to apply on the +// operation. expand is the $expand query parameter top is the number of results to return. If null is passed, +// returns all resources. func (client Client) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, expand string, top *int32) (result ListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "resources.Client", "ListByResourceGroup") + return result, validation.NewError("resources.Client", "ListByResourceGroup", err.Error()) } result.fn = client.listByResourceGroupNextResults @@ -855,15 +860,15 @@ func (client Client) ListByResourceGroupComplete(ctx context.Context, resourceGr // different subscription. When moving resources, both the source group and the target group are locked for the // duration of the operation. Write and delete operations are blocked on the groups until the move completes. // -// sourceResourceGroupName is the name of the resource group containing the resources to move. parameters is parameters -// for moving resources. -func (client Client) MoveResources(ctx context.Context, sourceResourceGroupName string, parameters MoveInfo) (result ResourcesMoveResourcesFuture, err error) { +// sourceResourceGroupName is the name of the resource group containing the resources to move. parameters is +// parameters for moving resources. +func (client Client) MoveResources(ctx context.Context, sourceResourceGroupName string, parameters MoveInfo) (result MoveResourcesFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: sourceResourceGroupName, Constraints: []validation.Constraint{{Target: "sourceResourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "sourceResourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "sourceResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "resources.Client", "MoveResources") + return result, validation.NewError("resources.Client", "MoveResources", err.Error()) } req, err := client.MoveResourcesPreparer(ctx, sourceResourceGroupName, parameters) @@ -905,7 +910,7 @@ func (client Client) MoveResourcesPreparer(ctx context.Context, sourceResourceGr // MoveResourcesSender sends the MoveResources request. The method will close the // http.Response Body if it receives an error. -func (client Client) MoveResourcesSender(req *http.Request) (future ResourcesMoveResourcesFuture, err error) { +func (client Client) MoveResourcesSender(req *http.Request) (future MoveResourcesFuture, err error) { sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) future.Future = azure.NewFuture(req) future.req = req @@ -934,15 +939,15 @@ func (client Client) MoveResourcesResponder(resp *http.Response) (result autores // // resourceGroupName is the name of the resource group for the resource. The name is case insensitive. // resourceProviderNamespace is the namespace of the resource provider. parentResourcePath is the parent resource -// identity. resourceType is the resource type of the resource to update. resourceName is the name of the resource to -// update. parameters is parameters for updating the resource. -func (client Client) Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (result ResourcesUpdateFuture, err error) { +// identity. resourceType is the resource type of the resource to update. resourceName is the name of the resource +// to update. parameters is parameters for updating the resource. +func (client Client) Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (result UpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "resources.Client", "Update") + return result, validation.NewError("resources.Client", "Update", err.Error()) } req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, parameters) @@ -988,7 +993,7 @@ func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName strin // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. -func (client Client) UpdateSender(req *http.Request) (future ResourcesUpdateFuture, err error) { +func (client Client) UpdateSender(req *http.Request) (future UpdateFuture, err error) { sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) future.Future = azure.NewFuture(req) future.req = req @@ -1016,10 +1021,11 @@ func (client Client) UpdateResponder(resp *http.Response) (result GenericResourc // UpdateByID updates a resource by ID. // -// resourceID is the fully qualified ID of the resource, including the resource name and resource type. Use the format, +// resourceID is the fully qualified ID of the resource, including the resource name and resource type. Use the +// format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} // parameters is update resource parameters. -func (client Client) UpdateByID(ctx context.Context, resourceID string, parameters GenericResource) (result ResourcesUpdateByIDFuture, err error) { +func (client Client) UpdateByID(ctx context.Context, resourceID string, parameters GenericResource) (result UpdateByIDFuture, err error) { req, err := client.UpdateByIDPreparer(ctx, resourceID, parameters) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "UpdateByID", nil, "Failure preparing request") @@ -1058,7 +1064,7 @@ func (client Client) UpdateByIDPreparer(ctx context.Context, resourceID string, // UpdateByIDSender sends the UpdateByID request. The method will close the // http.Response Body if it receives an error. -func (client Client) UpdateByIDSender(req *http.Request) (future ResourcesUpdateByIDFuture, err error) { +func (client Client) UpdateByIDSender(req *http.Request) (future UpdateByIDFuture, err error) { sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) future.Future = azure.NewFuture(req) future.req = req @@ -1090,15 +1096,15 @@ func (client Client) UpdateByIDResponder(resp *http.Response) (result GenericRes // returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location header value to // check the result of the long-running operation. // -// sourceResourceGroupName is the name of the resource group containing the resources to validate for move. parameters -// is parameters for moving resources. -func (client Client) ValidateMoveResources(ctx context.Context, sourceResourceGroupName string, parameters MoveInfo) (result ResourcesValidateMoveResourcesFuture, err error) { +// sourceResourceGroupName is the name of the resource group containing the resources to validate for move. +// parameters is parameters for moving resources. +func (client Client) ValidateMoveResources(ctx context.Context, sourceResourceGroupName string, parameters MoveInfo) (result ValidateMoveResourcesFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: sourceResourceGroupName, Constraints: []validation.Constraint{{Target: "sourceResourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "sourceResourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "sourceResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "resources.Client", "ValidateMoveResources") + return result, validation.NewError("resources.Client", "ValidateMoveResources", err.Error()) } req, err := client.ValidateMoveResourcesPreparer(ctx, sourceResourceGroupName, parameters) @@ -1140,7 +1146,7 @@ func (client Client) ValidateMoveResourcesPreparer(ctx context.Context, sourceRe // ValidateMoveResourcesSender sends the ValidateMoveResources request. The method will close the // http.Response Body if it receives an error. -func (client Client) ValidateMoveResourcesSender(req *http.Request) (future ResourcesValidateMoveResourcesFuture, err error) { +func (client Client) ValidateMoveResourcesSender(req *http.Request) (future ValidateMoveResourcesFuture, err error) { sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) future.Future = azure.NewFuture(req) future.req = req diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/version.go index 944c4e6210d1..f8c6aaf16d71 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources/version.go @@ -1,5 +1,7 @@ package resources +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package resources // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta services" + return "Azure-SDK-For-Go/" + version.Number + " resources/2017-05-10" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/scheduler/mgmt/2016-03-01/scheduler/jobcollections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/scheduler/mgmt/2016-03-01/scheduler/jobcollections.go index 5eb1181a8f29..9313f132e8bc 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/scheduler/mgmt/2016-03-01/scheduler/jobcollections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/scheduler/mgmt/2016-03-01/scheduler/jobcollections.go @@ -41,8 +41,8 @@ func NewJobCollectionsClientWithBaseURI(baseURI string, subscriptionID string) J // CreateOrUpdate provisions a new job collection or updates an existing job collection. // -// resourceGroupName is the resource group name. jobCollectionName is the job collection name. jobCollection is the job -// collection definition. +// resourceGroupName is the resource group name. jobCollectionName is the job collection name. jobCollection is the +// job collection definition. func (client JobCollectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, jobCollectionName string, jobCollection JobCollectionDefinition) (result JobCollectionDefinition, err error) { req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, jobCollectionName, jobCollection) if err != nil { @@ -560,8 +560,8 @@ func (client JobCollectionsClient) ListBySubscriptionComplete(ctx context.Contex // Patch patches an existing job collection. // -// resourceGroupName is the resource group name. jobCollectionName is the job collection name. jobCollection is the job -// collection definition. +// resourceGroupName is the resource group name. jobCollectionName is the job collection name. jobCollection is the +// job collection definition. func (client JobCollectionsClient) Patch(ctx context.Context, resourceGroupName string, jobCollectionName string, jobCollection JobCollectionDefinition) (result JobCollectionDefinition, err error) { req, err := client.PatchPreparer(ctx, resourceGroupName, jobCollectionName, jobCollection) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/scheduler/mgmt/2016-03-01/scheduler/jobs.go b/vendor/github.com/Azure/azure-sdk-for-go/services/scheduler/mgmt/2016-03-01/scheduler/jobs.go index caf8f3dc529a..716363e999f0 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/scheduler/mgmt/2016-03-01/scheduler/jobs.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/scheduler/mgmt/2016-03-01/scheduler/jobs.go @@ -42,8 +42,8 @@ func NewJobsClientWithBaseURI(baseURI string, subscriptionID string) JobsClient // CreateOrUpdate provisions a new job or updates an existing job. // -// resourceGroupName is the resource group name. jobCollectionName is the job collection name. jobName is the job name. -// job is the job definition. +// resourceGroupName is the resource group name. jobCollectionName is the job collection name. jobName is the job +// name. job is the job definition. func (client JobsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, jobCollectionName string, jobName string, job JobDefinition) (result JobDefinition, err error) { req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, jobCollectionName, jobName, job) if err != nil { @@ -112,7 +112,8 @@ func (client JobsClient) CreateOrUpdateResponder(resp *http.Response) (result Jo // Delete deletes a job. // -// resourceGroupName is the resource group name. jobCollectionName is the job collection name. jobName is the job name. +// resourceGroupName is the resource group name. jobCollectionName is the job collection name. jobName is the job +// name. func (client JobsClient) Delete(ctx context.Context, resourceGroupName string, jobCollectionName string, jobName string) (result autorest.Response, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, jobCollectionName, jobName) if err != nil { @@ -178,7 +179,8 @@ func (client JobsClient) DeleteResponder(resp *http.Response) (result autorest.R // Get gets a job. // -// resourceGroupName is the resource group name. jobCollectionName is the job collection name. jobName is the job name. +// resourceGroupName is the resource group name. jobCollectionName is the job collection name. jobName is the job +// name. func (client JobsClient) Get(ctx context.Context, resourceGroupName string, jobCollectionName string, jobName string) (result JobDefinition, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, jobCollectionName, jobName) if err != nil { @@ -255,7 +257,7 @@ func (client JobsClient) List(ctx context.Context, resourceGroupName string, job Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "scheduler.JobsClient", "List") + return result, validation.NewError("scheduler.JobsClient", "List", err.Error()) } result.fn = client.listNextResults @@ -359,9 +361,9 @@ func (client JobsClient) ListComplete(ctx context.Context, resourceGroupName str // ListJobHistory lists job history. // -// resourceGroupName is the resource group name. jobCollectionName is the job collection name. jobName is the job name. -// top is the number of job history to request, in the of range of [1..100]. skip is the (0-based) index of the job -// history list from which to begin requesting entries. filter is the filter to apply on the job state. +// resourceGroupName is the resource group name. jobCollectionName is the job collection name. jobName is the job +// name. top is the number of job history to request, in the of range of [1..100]. skip is the (0-based) index of +// the job history list from which to begin requesting entries. filter is the filter to apply on the job state. func (client JobsClient) ListJobHistory(ctx context.Context, resourceGroupName string, jobCollectionName string, jobName string, top *int32, skip *int32, filter string) (result JobHistoryListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: top, @@ -369,7 +371,7 @@ func (client JobsClient) ListJobHistory(ctx context.Context, resourceGroupName s Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, {Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "scheduler.JobsClient", "ListJobHistory") + return result, validation.NewError("scheduler.JobsClient", "ListJobHistory", err.Error()) } result.fn = client.listJobHistoryNextResults @@ -474,8 +476,8 @@ func (client JobsClient) ListJobHistoryComplete(ctx context.Context, resourceGro // Patch patches an existing job. // -// resourceGroupName is the resource group name. jobCollectionName is the job collection name. jobName is the job name. -// job is the job definition. +// resourceGroupName is the resource group name. jobCollectionName is the job collection name. jobName is the job +// name. job is the job definition. func (client JobsClient) Patch(ctx context.Context, resourceGroupName string, jobCollectionName string, jobName string, job JobDefinition) (result JobDefinition, err error) { req, err := client.PatchPreparer(ctx, resourceGroupName, jobCollectionName, jobName, job) if err != nil { @@ -544,7 +546,8 @@ func (client JobsClient) PatchResponder(resp *http.Response) (result JobDefiniti // Run runs a job. // -// resourceGroupName is the resource group name. jobCollectionName is the job collection name. jobName is the job name. +// resourceGroupName is the resource group name. jobCollectionName is the job collection name. jobName is the job +// name. func (client JobsClient) Run(ctx context.Context, resourceGroupName string, jobCollectionName string, jobName string) (result autorest.Response, err error) { req, err := client.RunPreparer(ctx, resourceGroupName, jobCollectionName, jobName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/scheduler/mgmt/2016-03-01/scheduler/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/scheduler/mgmt/2016-03-01/scheduler/models.go index 75d3462ab616..844acdae441a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/scheduler/mgmt/2016-03-01/scheduler/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/scheduler/mgmt/2016-03-01/scheduler/models.go @@ -210,23 +210,26 @@ const ( // BasicAuthentication ... type BasicAuthentication struct { - // Type - Possible values include: 'TypeHTTPAuthentication', 'TypeClientCertificate', 'TypeBasic', 'TypeActiveDirectoryOAuth' - Type Type `json:"type,omitempty"` // Username - Gets or sets the username. Username *string `json:"username,omitempty"` // Password - Gets or sets the password, return value will always be empty. Password *string `json:"password,omitempty"` + // Type - Possible values include: 'TypeHTTPAuthentication', 'TypeClientCertificate', 'TypeBasic', 'TypeActiveDirectoryOAuth' + Type Type `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for BasicAuthentication. func (ba BasicAuthentication) MarshalJSON() ([]byte, error) { ba.Type = TypeBasic - type Alias BasicAuthentication - return json.Marshal(&struct { - Alias - }{ - Alias: (Alias)(ba), - }) + objectMap := make(map[string]interface{}) + if ba.Username != nil { + objectMap["username"] = ba.Username + } + if ba.Password != nil { + objectMap["password"] = ba.Password + } + objectMap["type"] = ba.Type + return json.Marshal(objectMap) } // AsClientCertAuthentication is the BasicHTTPAuthentication implementation for BasicAuthentication. @@ -256,8 +259,6 @@ func (ba BasicAuthentication) AsBasicHTTPAuthentication() (BasicHTTPAuthenticati // ClientCertAuthentication ... type ClientCertAuthentication struct { - // Type - Possible values include: 'TypeHTTPAuthentication', 'TypeClientCertificate', 'TypeBasic', 'TypeActiveDirectoryOAuth' - Type Type `json:"type,omitempty"` // Password - Gets or sets the certificate password, return value will always be empty. Password *string `json:"password,omitempty"` // Pfx - Gets or sets the pfx certificate. Accepts certification in base64 encoding, return value will always be empty. @@ -268,17 +269,31 @@ type ClientCertAuthentication struct { CertificateExpirationDate *date.Time `json:"certificateExpirationDate,omitempty"` // CertificateSubjectName - Gets or sets the certificate subject name. CertificateSubjectName *string `json:"certificateSubjectName,omitempty"` + // Type - Possible values include: 'TypeHTTPAuthentication', 'TypeClientCertificate', 'TypeBasic', 'TypeActiveDirectoryOAuth' + Type Type `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for ClientCertAuthentication. func (cca ClientCertAuthentication) MarshalJSON() ([]byte, error) { cca.Type = TypeClientCertificate - type Alias ClientCertAuthentication - return json.Marshal(&struct { - Alias - }{ - Alias: (Alias)(cca), - }) + objectMap := make(map[string]interface{}) + if cca.Password != nil { + objectMap["password"] = cca.Password + } + if cca.Pfx != nil { + objectMap["pfx"] = cca.Pfx + } + if cca.CertificateThumbprint != nil { + objectMap["certificateThumbprint"] = cca.CertificateThumbprint + } + if cca.CertificateExpirationDate != nil { + objectMap["certificateExpirationDate"] = cca.CertificateExpirationDate + } + if cca.CertificateSubjectName != nil { + objectMap["certificateSubjectName"] = cca.CertificateSubjectName + } + objectMap["type"] = cca.Type + return json.Marshal(objectMap) } // AsClientCertAuthentication is the BasicHTTPAuthentication implementation for ClientCertAuthentication. @@ -306,7 +321,7 @@ func (cca ClientCertAuthentication) AsBasicHTTPAuthentication() (BasicHTTPAuthen return &cca, true } -// BasicHTTPAuthentication +// BasicHTTPAuthentication ... type BasicHTTPAuthentication interface { AsClientCertAuthentication() (*ClientCertAuthentication, bool) AsBasicAuthentication() (*BasicAuthentication, bool) @@ -314,7 +329,7 @@ type BasicHTTPAuthentication interface { AsHTTPAuthentication() (*HTTPAuthentication, bool) } -// HTTPAuthentication +// HTTPAuthentication ... type HTTPAuthentication struct { // Type - Possible values include: 'TypeHTTPAuthentication', 'TypeClientCertificate', 'TypeBasic', 'TypeActiveDirectoryOAuth' Type Type `json:"type,omitempty"` @@ -368,12 +383,9 @@ func unmarshalBasicHTTPAuthenticationArray(body []byte) ([]BasicHTTPAuthenticati // MarshalJSON is the custom marshaler for HTTPAuthentication. func (ha HTTPAuthentication) MarshalJSON() ([]byte, error) { ha.Type = TypeHTTPAuthentication - type Alias HTTPAuthentication - return json.Marshal(&struct { - Alias - }{ - Alias: (Alias)(ha), - }) + objectMap := make(map[string]interface{}) + objectMap["type"] = ha.Type + return json.Marshal(objectMap) } // AsClientCertAuthentication is the BasicHTTPAuthentication implementation for HTTPAuthentication. @@ -412,7 +424,26 @@ type HTTPRequest struct { // Body - Gets or sets the request body. Body *string `json:"body,omitempty"` // Headers - Gets or sets the headers. - Headers *map[string]*string `json:"headers,omitempty"` + Headers map[string]*string `json:"headers"` +} + +// MarshalJSON is the custom marshaler for HTTPRequest. +func (hr HTTPRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["authentication"] = hr.Authentication + if hr.URI != nil { + objectMap["uri"] = hr.URI + } + if hr.Method != nil { + objectMap["method"] = hr.Method + } + if hr.Body != nil { + objectMap["body"] = hr.Body + } + if hr.Headers != nil { + objectMap["headers"] = hr.Headers + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for HTTPRequest struct. @@ -422,55 +453,53 @@ func (hr *HTTPRequest) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["authentication"] - if v != nil { - authentication, err := unmarshalBasicHTTPAuthentication(*m["authentication"]) - if err != nil { - return err - } - hr.Authentication = authentication - } - - v = m["uri"] - if v != nil { - var URI string - err = json.Unmarshal(*m["uri"], &URI) - if err != nil { - return err - } - hr.URI = &URI - } - - v = m["method"] - if v != nil { - var method string - err = json.Unmarshal(*m["method"], &method) - if err != nil { - return err - } - hr.Method = &method - } - - v = m["body"] - if v != nil { - var body string - err = json.Unmarshal(*m["body"], &body) - if err != nil { - return err - } - hr.Body = &body - } - - v = m["headers"] - if v != nil { - var headers map[string]*string - err = json.Unmarshal(*m["headers"], &headers) - if err != nil { - return err + for k, v := range m { + switch k { + case "authentication": + if v != nil { + authentication, err := unmarshalBasicHTTPAuthentication(*v) + if err != nil { + return err + } + hr.Authentication = authentication + } + case "uri": + if v != nil { + var URI string + err = json.Unmarshal(*v, &URI) + if err != nil { + return err + } + hr.URI = &URI + } + case "method": + if v != nil { + var method string + err = json.Unmarshal(*v, &method) + if err != nil { + return err + } + hr.Method = &method + } + case "body": + if v != nil { + var body string + err = json.Unmarshal(*v, &body) + if err != nil { + return err + } + hr.Body = &body + } + case "headers": + if v != nil { + var headers map[string]*string + err = json.Unmarshal(*v, &headers) + if err != nil { + return err + } + hr.Headers = headers + } } - hr.Headers = &headers } return nil @@ -506,11 +535,35 @@ type JobCollectionDefinition struct { // Location - Gets or sets the storage account location. Location *string `json:"location,omitempty"` // Tags - Gets or sets the tags. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` // Properties - Gets or sets the job collection properties. Properties *JobCollectionProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for JobCollectionDefinition. +func (jcd JobCollectionDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jcd.ID != nil { + objectMap["id"] = jcd.ID + } + if jcd.Type != nil { + objectMap["type"] = jcd.Type + } + if jcd.Name != nil { + objectMap["name"] = jcd.Name + } + if jcd.Location != nil { + objectMap["location"] = jcd.Location + } + if jcd.Tags != nil { + objectMap["tags"] = jcd.Tags + } + if jcd.Properties != nil { + objectMap["properties"] = jcd.Properties + } + return json.Marshal(objectMap) +} + // JobCollectionListResult ... type JobCollectionListResult struct { autorest.Response `json:"-"` @@ -645,26 +698,44 @@ func (future JobCollectionsDeleteFuture) Result(client JobCollectionsClient) (ar var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "scheduler.JobCollectionsDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("scheduler.JobCollectionsDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("scheduler.JobCollectionsDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "scheduler.JobCollectionsDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "scheduler.JobCollectionsDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "scheduler.JobCollectionsDeleteFuture", "Result", resp, "Failure responding to request") + } return } -// JobCollectionsDisableFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// JobCollectionsDisableFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type JobCollectionsDisableFuture struct { azure.Future req *http.Request @@ -676,22 +747,39 @@ func (future JobCollectionsDisableFuture) Result(client JobCollectionsClient) (a var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "scheduler.JobCollectionsDisableFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("scheduler.JobCollectionsDisableFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("scheduler.JobCollectionsDisableFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DisableResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "scheduler.JobCollectionsDisableFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "scheduler.JobCollectionsDisableFuture", "Result", resp, "Failure sending request") return } ar, err = client.DisableResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "scheduler.JobCollectionsDisableFuture", "Result", resp, "Failure responding to request") + } return } @@ -707,22 +795,39 @@ func (future JobCollectionsEnableFuture) Result(client JobCollectionsClient) (ar var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "scheduler.JobCollectionsEnableFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("scheduler.JobCollectionsEnableFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("scheduler.JobCollectionsEnableFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.EnableResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "scheduler.JobCollectionsEnableFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "scheduler.JobCollectionsEnableFuture", "Result", resp, "Failure sending request") return } ar, err = client.EnableResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "scheduler.JobCollectionsEnableFuture", "Result", resp, "Failure responding to request") + } return } @@ -1076,8 +1181,6 @@ type JobStatus struct { // OAuthAuthentication ... type OAuthAuthentication struct { - // Type - Possible values include: 'TypeHTTPAuthentication', 'TypeClientCertificate', 'TypeBasic', 'TypeActiveDirectoryOAuth' - Type Type `json:"type,omitempty"` // Secret - Gets or sets the secret, return value will always be empty. Secret *string `json:"secret,omitempty"` // Tenant - Gets or sets the tenant. @@ -1086,17 +1189,28 @@ type OAuthAuthentication struct { Audience *string `json:"audience,omitempty"` // ClientID - Gets or sets the client identifier. ClientID *string `json:"clientId,omitempty"` + // Type - Possible values include: 'TypeHTTPAuthentication', 'TypeClientCertificate', 'TypeBasic', 'TypeActiveDirectoryOAuth' + Type Type `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for OAuthAuthentication. func (oaa OAuthAuthentication) MarshalJSON() ([]byte, error) { oaa.Type = TypeActiveDirectoryOAuth - type Alias OAuthAuthentication - return json.Marshal(&struct { - Alias - }{ - Alias: (Alias)(oaa), - }) + objectMap := make(map[string]interface{}) + if oaa.Secret != nil { + objectMap["secret"] = oaa.Secret + } + if oaa.Tenant != nil { + objectMap["tenant"] = oaa.Tenant + } + if oaa.Audience != nil { + objectMap["audience"] = oaa.Audience + } + if oaa.ClientID != nil { + objectMap["clientId"] = oaa.ClientID + } + objectMap["type"] = oaa.Type + return json.Marshal(objectMap) } // AsClientCertAuthentication is the BasicHTTPAuthentication implementation for OAuthAuthentication. @@ -1181,7 +1295,7 @@ type ServiceBusMessage struct { // BrokeredMessageProperties - Gets or sets the brokered message properties. BrokeredMessageProperties *ServiceBusBrokeredMessageProperties `json:"brokeredMessageProperties,omitempty"` // CustomMessageProperties - Gets or sets the custom message properties. - CustomMessageProperties *map[string]*string `json:"customMessageProperties,omitempty"` + CustomMessageProperties map[string]*string `json:"customMessageProperties"` // Message - Gets or sets the message. Message *string `json:"message,omitempty"` // Namespace - Gets or sets the namespace. @@ -1190,40 +1304,112 @@ type ServiceBusMessage struct { TransportType ServiceBusTransportType `json:"transportType,omitempty"` } +// MarshalJSON is the custom marshaler for ServiceBusMessage. +func (sbm ServiceBusMessage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sbm.Authentication != nil { + objectMap["authentication"] = sbm.Authentication + } + if sbm.BrokeredMessageProperties != nil { + objectMap["brokeredMessageProperties"] = sbm.BrokeredMessageProperties + } + if sbm.CustomMessageProperties != nil { + objectMap["customMessageProperties"] = sbm.CustomMessageProperties + } + if sbm.Message != nil { + objectMap["message"] = sbm.Message + } + if sbm.Namespace != nil { + objectMap["namespace"] = sbm.Namespace + } + objectMap["transportType"] = sbm.TransportType + return json.Marshal(objectMap) +} + // ServiceBusQueueMessage ... type ServiceBusQueueMessage struct { + // QueueName - Gets or sets the queue name. + QueueName *string `json:"queueName,omitempty"` // Authentication - Gets or sets the Service Bus authentication. Authentication *ServiceBusAuthentication `json:"authentication,omitempty"` // BrokeredMessageProperties - Gets or sets the brokered message properties. BrokeredMessageProperties *ServiceBusBrokeredMessageProperties `json:"brokeredMessageProperties,omitempty"` // CustomMessageProperties - Gets or sets the custom message properties. - CustomMessageProperties *map[string]*string `json:"customMessageProperties,omitempty"` + CustomMessageProperties map[string]*string `json:"customMessageProperties"` // Message - Gets or sets the message. Message *string `json:"message,omitempty"` // Namespace - Gets or sets the namespace. Namespace *string `json:"namespace,omitempty"` // TransportType - Gets or sets the transport type. Possible values include: 'ServiceBusTransportTypeNotSpecified', 'ServiceBusTransportTypeNetMessaging', 'ServiceBusTransportTypeAMQP' TransportType ServiceBusTransportType `json:"transportType,omitempty"` - // QueueName - Gets or sets the queue name. - QueueName *string `json:"queueName,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServiceBusQueueMessage. +func (sbqm ServiceBusQueueMessage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sbqm.QueueName != nil { + objectMap["queueName"] = sbqm.QueueName + } + if sbqm.Authentication != nil { + objectMap["authentication"] = sbqm.Authentication + } + if sbqm.BrokeredMessageProperties != nil { + objectMap["brokeredMessageProperties"] = sbqm.BrokeredMessageProperties + } + if sbqm.CustomMessageProperties != nil { + objectMap["customMessageProperties"] = sbqm.CustomMessageProperties + } + if sbqm.Message != nil { + objectMap["message"] = sbqm.Message + } + if sbqm.Namespace != nil { + objectMap["namespace"] = sbqm.Namespace + } + objectMap["transportType"] = sbqm.TransportType + return json.Marshal(objectMap) } // ServiceBusTopicMessage ... type ServiceBusTopicMessage struct { + // TopicPath - Gets or sets the topic path. + TopicPath *string `json:"topicPath,omitempty"` // Authentication - Gets or sets the Service Bus authentication. Authentication *ServiceBusAuthentication `json:"authentication,omitempty"` // BrokeredMessageProperties - Gets or sets the brokered message properties. BrokeredMessageProperties *ServiceBusBrokeredMessageProperties `json:"brokeredMessageProperties,omitempty"` // CustomMessageProperties - Gets or sets the custom message properties. - CustomMessageProperties *map[string]*string `json:"customMessageProperties,omitempty"` + CustomMessageProperties map[string]*string `json:"customMessageProperties"` // Message - Gets or sets the message. Message *string `json:"message,omitempty"` // Namespace - Gets or sets the namespace. Namespace *string `json:"namespace,omitempty"` // TransportType - Gets or sets the transport type. Possible values include: 'ServiceBusTransportTypeNotSpecified', 'ServiceBusTransportTypeNetMessaging', 'ServiceBusTransportTypeAMQP' TransportType ServiceBusTransportType `json:"transportType,omitempty"` - // TopicPath - Gets or sets the topic path. - TopicPath *string `json:"topicPath,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServiceBusTopicMessage. +func (sbtm ServiceBusTopicMessage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sbtm.TopicPath != nil { + objectMap["topicPath"] = sbtm.TopicPath + } + if sbtm.Authentication != nil { + objectMap["authentication"] = sbtm.Authentication + } + if sbtm.BrokeredMessageProperties != nil { + objectMap["brokeredMessageProperties"] = sbtm.BrokeredMessageProperties + } + if sbtm.CustomMessageProperties != nil { + objectMap["customMessageProperties"] = sbtm.CustomMessageProperties + } + if sbtm.Message != nil { + objectMap["message"] = sbtm.Message + } + if sbtm.Namespace != nil { + objectMap["namespace"] = sbtm.Namespace + } + objectMap["transportType"] = sbtm.TransportType + return json.Marshal(objectMap) } // Sku ... diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/scheduler/mgmt/2016-03-01/scheduler/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/scheduler/mgmt/2016-03-01/scheduler/version.go index 43e24730f319..6fcf2020c240 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/scheduler/mgmt/2016-03-01/scheduler/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/scheduler/mgmt/2016-03-01/scheduler/version.go @@ -1,5 +1,7 @@ package scheduler +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package scheduler // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta services" + return "Azure-SDK-For-Go/" + version.Number + " scheduler/2016-03-01" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/search/mgmt/2015-08-19/search/adminkeys.go b/vendor/github.com/Azure/azure-sdk-for-go/services/search/mgmt/2015-08-19/search/adminkeys.go index 78bdf82763fe..44a870417c91 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/search/mgmt/2015-08-19/search/adminkeys.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/search/mgmt/2015-08-19/search/adminkeys.go @@ -42,10 +42,10 @@ func NewAdminKeysClientWithBaseURI(baseURI string, subscriptionID string) AdminK // Get gets the primary and secondary admin API keys for the specified Azure Search service. // -// resourceGroupName is the name of the resource group within the current subscription. You can obtain this value from -// the Azure Resource Manager API or the portal. searchServiceName is the name of the Azure Search service associated -// with the specified resource group. clientRequestID is a client-generated GUID value that identifies this request. If -// specified, this will be included in response information as a way to track the request. +// resourceGroupName is the name of the resource group within the current subscription. You can obtain this value +// from the Azure Resource Manager API or the portal. searchServiceName is the name of the Azure Search service +// associated with the specified resource group. clientRequestID is a client-generated GUID value that identifies +// this request. If specified, this will be included in response information as a way to track the request. func (client AdminKeysClient) Get(ctx context.Context, resourceGroupName string, searchServiceName string, clientRequestID *uuid.UUID) (result AdminKeyResult, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, searchServiceName, clientRequestID) if err != nil { @@ -115,11 +115,11 @@ func (client AdminKeysClient) GetResponder(resp *http.Response) (result AdminKey // Regenerate regenerates either the primary or secondary admin API key. You can only regenerate one key at a time. // -// resourceGroupName is the name of the resource group within the current subscription. You can obtain this value from -// the Azure Resource Manager API or the portal. searchServiceName is the name of the Azure Search service associated -// with the specified resource group. keyKind is specifies which key to regenerate. Valid values include 'primary' and -// 'secondary'. clientRequestID is a client-generated GUID value that identifies this request. If specified, this will -// be included in response information as a way to track the request. +// resourceGroupName is the name of the resource group within the current subscription. You can obtain this value +// from the Azure Resource Manager API or the portal. searchServiceName is the name of the Azure Search service +// associated with the specified resource group. keyKind is specifies which key to regenerate. Valid values include +// 'primary' and 'secondary'. clientRequestID is a client-generated GUID value that identifies this request. If +// specified, this will be included in response information as a way to track the request. func (client AdminKeysClient) Regenerate(ctx context.Context, resourceGroupName string, searchServiceName string, keyKind AdminKeyKind, clientRequestID *uuid.UUID) (result AdminKeyResult, err error) { req, err := client.RegeneratePreparer(ctx, resourceGroupName, searchServiceName, keyKind, clientRequestID) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/search/mgmt/2015-08-19/search/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/search/mgmt/2015-08-19/search/models.go index efa1f9831ee7..ddbd09e2f982 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/search/mgmt/2015-08-19/search/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/search/mgmt/2015-08-19/search/models.go @@ -130,6 +130,7 @@ type CheckNameAvailabilityOutput struct { // CloudError contains information about an API error. type CloudError struct { + // Error - Describes a particular API error with an error code and a message. Error *CloudErrorBody `json:"error,omitempty"` } @@ -152,6 +153,36 @@ type ListQueryKeysResult struct { Value *[]QueryKey `json:"value,omitempty"` } +// Operation describes a REST API operation. +type Operation struct { + // Name - The name of the operation. This name is of the form {provider}/{resource}/{operation}. + Name *string `json:"name,omitempty"` + // Display - The object that describes the operation. + Display *OperationDisplay `json:"display,omitempty"` +} + +// OperationDisplay the object that describes the operation. +type OperationDisplay struct { + // Provider - The friendly name of the resource provider. + Provider *string `json:"provider,omitempty"` + // Operation - The operation type: read, write, delete, listKeys/action, etc. + Operation *string `json:"operation,omitempty"` + // Resource - The resource type on which the operation is performed. + Resource *string `json:"resource,omitempty"` + // Description - The friendly name of the operation. + Description *string `json:"description,omitempty"` +} + +// OperationListResult the result of the request to list REST API operations. It contains a list of operations and +// a URL to get the next set of results. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - The list of operations supported by the resource provider. + Value *[]Operation `json:"value,omitempty"` + // NextLink - The URL to get the next set of operation list results, if any. + NextLink *string `json:"nextLink,omitempty"` +} + // QueryKey describes an API key for a given Azure Search service that has permissions for query operations only. type QueryKey struct { autorest.Response `json:"-"` @@ -169,108 +200,152 @@ type Resource struct { Name *string `json:"name,omitempty"` // Type - The resource type. Type *string `json:"type,omitempty"` - // Location - The geographic location of the resource. This must be one of the supported and registered Azure Geo Regions (for example, West US, East US, Southeast Asia, and so forth). + // Location - The geographic location of the resource. This must be one of the supported and registered Azure Geo Regions (for example, West US, East US, Southeast Asia, and so forth). This property is required when creating a new resource. Location *string `json:"location,omitempty"` // Tags - Tags to help categorize the resource in the Azure portal. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.ID != nil { + objectMap["id"] = r.ID + } + if r.Name != nil { + objectMap["name"] = r.Name + } + if r.Type != nil { + objectMap["type"] = r.Type + } + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) } // Service describes an Azure Search service and its current state. type Service struct { autorest.Response `json:"-"` + // ServiceProperties - Properties of the Search service. + *ServiceProperties `json:"properties,omitempty"` + // Sku - The SKU of the Search Service, which determines price tier and capacity limits. This property is required when creating a new Search Service. + Sku *Sku `json:"sku,omitempty"` // ID - The ID of the resource. This can be used with the Azure Resource Manager to link resources together. ID *string `json:"id,omitempty"` // Name - The name of the resource. Name *string `json:"name,omitempty"` // Type - The resource type. Type *string `json:"type,omitempty"` - // Location - The geographic location of the resource. This must be one of the supported and registered Azure Geo Regions (for example, West US, East US, Southeast Asia, and so forth). + // Location - The geographic location of the resource. This must be one of the supported and registered Azure Geo Regions (for example, West US, East US, Southeast Asia, and so forth). This property is required when creating a new resource. Location *string `json:"location,omitempty"` // Tags - Tags to help categorize the resource in the Azure portal. - Tags *map[string]*string `json:"tags,omitempty"` - // ServiceProperties - Properties of the Search service. - *ServiceProperties `json:"properties,omitempty"` - // Sku - The SKU of the Search Service, which determines price tier and capacity limits. - Sku *Sku `json:"sku,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for Service struct. -func (s *Service) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for Service. +func (s Service) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.ServiceProperties != nil { + objectMap["properties"] = s.ServiceProperties } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ServiceProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - s.ServiceProperties = &properties + if s.Sku != nil { + objectMap["sku"] = s.Sku } - - v = m["sku"] - if v != nil { - var sku Sku - err = json.Unmarshal(*m["sku"], &sku) - if err != nil { - return err - } - s.Sku = &sku + if s.ID != nil { + objectMap["id"] = s.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - s.ID = &ID + if s.Name != nil { + objectMap["name"] = s.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - s.Name = &name + if s.Type != nil { + objectMap["type"] = s.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - s.Type = &typeVar + if s.Location != nil { + objectMap["location"] = s.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - s.Location = &location + if s.Tags != nil { + objectMap["tags"] = s.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for Service struct. +func (s *Service) 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 "properties": + if v != nil { + var serviceProperties ServiceProperties + err = json.Unmarshal(*v, &serviceProperties) + if err != nil { + return err + } + s.ServiceProperties = &serviceProperties + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + s.Sku = &sku + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + s.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + s.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + s.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + s.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + s.Tags = tags + } } - s.Tags = &tags } return nil @@ -299,7 +374,8 @@ type ServiceProperties struct { ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } -// ServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// ServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type ServicesCreateOrUpdateFuture struct { azure.Future req *http.Request @@ -311,22 +387,39 @@ func (future ServicesCreateOrUpdateFuture) Result(client ServicesClient) (s Serv var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "search.ServicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return s, autorest.NewError("search.ServicesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return s, azure.NewAsyncOpIncompleteError("search.ServicesCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { s, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "search.ServicesCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "search.ServicesCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } s, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "search.ServicesCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/search/mgmt/2015-08-19/search/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/search/mgmt/2015-08-19/search/operations.go new file mode 100644 index 000000000000..bcb4c831b1eb --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/search/mgmt/2015-08-19/search/operations.go @@ -0,0 +1,98 @@ +package search + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" + "net/http" +) + +// OperationsClient is the client that can be used to manage Azure Search services and API keys. +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client. +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all of the available REST API operations of the Microsoft.Search provider. +func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) { + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "search.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "search.OperationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "search.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2015-08-19" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Search/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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/search/mgmt/2015-08-19/search/querykeys.go b/vendor/github.com/Azure/azure-sdk-for-go/services/search/mgmt/2015-08-19/search/querykeys.go index 9df74ef13316..f997840bd21a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/search/mgmt/2015-08-19/search/querykeys.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/search/mgmt/2015-08-19/search/querykeys.go @@ -42,11 +42,11 @@ func NewQueryKeysClientWithBaseURI(baseURI string, subscriptionID string) QueryK // Create generates a new query key for the specified Search service. You can create up to 50 query keys per service. // -// resourceGroupName is the name of the resource group within the current subscription. You can obtain this value from -// the Azure Resource Manager API or the portal. searchServiceName is the name of the Azure Search service associated -// with the specified resource group. name is the name of the new query API key. clientRequestID is a client-generated -// GUID value that identifies this request. If specified, this will be included in response information as a way to -// track the request. +// resourceGroupName is the name of the resource group within the current subscription. You can obtain this value +// from the Azure Resource Manager API or the portal. searchServiceName is the name of the Azure Search service +// associated with the specified resource group. name is the name of the new query API key. clientRequestID is a +// client-generated GUID value that identifies this request. If specified, this will be included in response +// information as a way to track the request. func (client QueryKeysClient) Create(ctx context.Context, resourceGroupName string, searchServiceName string, name string, clientRequestID *uuid.UUID) (result QueryKey, err error) { req, err := client.CreatePreparer(ctx, resourceGroupName, searchServiceName, name, clientRequestID) if err != nil { @@ -118,11 +118,11 @@ func (client QueryKeysClient) CreateResponder(resp *http.Response) (result Query // Delete deletes the specified query key. Unlike admin keys, query keys are not regenerated. The process for // regenerating a query key is to delete and then recreate it. // -// resourceGroupName is the name of the resource group within the current subscription. You can obtain this value from -// the Azure Resource Manager API or the portal. searchServiceName is the name of the Azure Search service associated -// with the specified resource group. key is the query key to be deleted. Query keys are identified by value, not by -// name. clientRequestID is a client-generated GUID value that identifies this request. If specified, this will be -// included in response information as a way to track the request. +// resourceGroupName is the name of the resource group within the current subscription. You can obtain this value +// from the Azure Resource Manager API or the portal. searchServiceName is the name of the Azure Search service +// associated with the specified resource group. key is the query key to be deleted. Query keys are identified by +// value, not by name. clientRequestID is a client-generated GUID value that identifies this request. If specified, +// this will be included in response information as a way to track the request. func (client QueryKeysClient) Delete(ctx context.Context, resourceGroupName string, searchServiceName string, key string, clientRequestID *uuid.UUID) (result autorest.Response, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, searchServiceName, key, clientRequestID) if err != nil { @@ -192,10 +192,10 @@ func (client QueryKeysClient) DeleteResponder(resp *http.Response) (result autor // ListBySearchService returns the list of query API keys for the given Azure Search service. // -// resourceGroupName is the name of the resource group within the current subscription. You can obtain this value from -// the Azure Resource Manager API or the portal. searchServiceName is the name of the Azure Search service associated -// with the specified resource group. clientRequestID is a client-generated GUID value that identifies this request. If -// specified, this will be included in response information as a way to track the request. +// resourceGroupName is the name of the resource group within the current subscription. You can obtain this value +// from the Azure Resource Manager API or the portal. searchServiceName is the name of the Azure Search service +// associated with the specified resource group. clientRequestID is a client-generated GUID value that identifies +// this request. If specified, this will be included in response information as a way to track the request. func (client QueryKeysClient) ListBySearchService(ctx context.Context, resourceGroupName string, searchServiceName string, clientRequestID *uuid.UUID) (result ListQueryKeysResult, err error) { req, err := client.ListBySearchServicePreparer(ctx, resourceGroupName, searchServiceName, clientRequestID) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/search/mgmt/2015-08-19/search/services.go b/vendor/github.com/Azure/azure-sdk-for-go/services/search/mgmt/2015-08-19/search/services.go index 69f8b1c5aa83..e006d04b6bfd 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/search/mgmt/2015-08-19/search/services.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/search/mgmt/2015-08-19/search/services.go @@ -44,15 +44,15 @@ func NewServicesClientWithBaseURI(baseURI string, subscriptionID string) Service // CheckNameAvailability checks whether or not the given Search service name is available for use. Search service names // must be globally unique since they are part of the service URI (https://.search.windows.net). // -// checkNameAvailabilityInput is the resource name and type to check. clientRequestID is a client-generated GUID value -// that identifies this request. If specified, this will be included in response information as a way to track the -// request. +// checkNameAvailabilityInput is the resource name and type to check. clientRequestID is a client-generated GUID +// value that identifies this request. If specified, this will be included in response information as a way to +// track the request. func (client ServicesClient) CheckNameAvailability(ctx context.Context, checkNameAvailabilityInput CheckNameAvailabilityInput, clientRequestID *uuid.UUID) (result CheckNameAvailabilityOutput, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: checkNameAvailabilityInput, Constraints: []validation.Constraint{{Target: "checkNameAvailabilityInput.Name", Name: validation.Null, Rule: true, Chain: nil}, {Target: "checkNameAvailabilityInput.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "search.ServicesClient", "CheckNameAvailability") + return result, validation.NewError("search.ServicesClient", "CheckNameAvailability", err.Error()) } req, err := client.CheckNameAvailabilityPreparer(ctx, checkNameAvailabilityInput, clientRequestID) @@ -124,14 +124,15 @@ func (client ServicesClient) CheckNameAvailabilityResponder(resp *http.Response) // CreateOrUpdate creates or updates a Search service in the given resource group. If the Search service already // exists, all properties will be updated with the given values. // -// resourceGroupName is the name of the resource group within the current subscription. You can obtain this value from -// the Azure Resource Manager API or the portal. searchServiceName is the name of the Azure Search service to create or -// update. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two -// or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. Search -// service names must be globally unique since they are part of the service URI (https://.search.windows.net). -// You cannot change the service name after the service is created. service is the definition of the Search service to -// create or update. clientRequestID is a client-generated GUID value that identifies this request. If specified, this -// will be included in response information as a way to track the request. +// resourceGroupName is the name of the resource group within the current subscription. You can obtain this value +// from the Azure Resource Manager API or the portal. searchServiceName is the name of the Azure Search service to +// create or update. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as +// the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters +// in length. Search service names must be globally unique since they are part of the service URI +// (https://.search.windows.net). You cannot change the service name after the service is created. service is +// the definition of the Search service to create or update. clientRequestID is a client-generated GUID value that +// identifies this request. If specified, this will be included in response information as a way to track the +// request. func (client ServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, searchServiceName string, service Service, clientRequestID *uuid.UUID) (result ServicesCreateOrUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: service, @@ -144,9 +145,8 @@ func (client ServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupNa Chain: []validation.Constraint{{Target: "service.ServiceProperties.PartitionCount", Name: validation.InclusiveMaximum, Rule: 12, Chain: nil}, {Target: "service.ServiceProperties.PartitionCount", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, - }}, - {Target: "service.Sku", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "search.ServicesClient", "CreateOrUpdate") + }}}}}); err != nil { + return result, validation.NewError("search.ServicesClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, searchServiceName, service, clientRequestID) @@ -221,10 +221,10 @@ func (client ServicesClient) CreateOrUpdateResponder(resp *http.Response) (resul // Delete deletes a Search service in the given resource group, along with its associated resources. // -// resourceGroupName is the name of the resource group within the current subscription. You can obtain this value from -// the Azure Resource Manager API or the portal. searchServiceName is the name of the Azure Search service associated -// with the specified resource group. clientRequestID is a client-generated GUID value that identifies this request. If -// specified, this will be included in response information as a way to track the request. +// resourceGroupName is the name of the resource group within the current subscription. You can obtain this value +// from the Azure Resource Manager API or the portal. searchServiceName is the name of the Azure Search service +// associated with the specified resource group. clientRequestID is a client-generated GUID value that identifies +// this request. If specified, this will be included in response information as a way to track the request. func (client ServicesClient) Delete(ctx context.Context, resourceGroupName string, searchServiceName string, clientRequestID *uuid.UUID) (result autorest.Response, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, searchServiceName, clientRequestID) if err != nil { @@ -293,10 +293,10 @@ func (client ServicesClient) DeleteResponder(resp *http.Response) (result autore // Get gets the Search service with the given name in the given resource group. // -// resourceGroupName is the name of the resource group within the current subscription. You can obtain this value from -// the Azure Resource Manager API or the portal. searchServiceName is the name of the Azure Search service associated -// with the specified resource group. clientRequestID is a client-generated GUID value that identifies this request. If -// specified, this will be included in response information as a way to track the request. +// resourceGroupName is the name of the resource group within the current subscription. You can obtain this value +// from the Azure Resource Manager API or the portal. searchServiceName is the name of the Azure Search service +// associated with the specified resource group. clientRequestID is a client-generated GUID value that identifies +// this request. If specified, this will be included in response information as a way to track the request. func (client ServicesClient) Get(ctx context.Context, resourceGroupName string, searchServiceName string, clientRequestID *uuid.UUID) (result Service, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, searchServiceName, clientRequestID) if err != nil { @@ -366,9 +366,10 @@ func (client ServicesClient) GetResponder(resp *http.Response) (result Service, // ListByResourceGroup gets a list of all Search services in the given resource group. // -// resourceGroupName is the name of the resource group within the current subscription. You can obtain this value from -// the Azure Resource Manager API or the portal. clientRequestID is a client-generated GUID value that identifies this -// request. If specified, this will be included in response information as a way to track the request. +// resourceGroupName is the name of the resource group within the current subscription. You can obtain this value +// from the Azure Resource Manager API or the portal. clientRequestID is a client-generated GUID value that +// identifies this request. If specified, this will be included in response information as a way to track the +// request. func (client ServicesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, clientRequestID *uuid.UUID) (result ServiceListResult, err error) { req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, clientRequestID) if err != nil { @@ -434,3 +435,79 @@ func (client ServicesClient) ListByResourceGroupResponder(resp *http.Response) ( result.Response = autorest.Response{Response: resp} return } + +// Update updates an existing Search service in the given resource group. +// +// resourceGroupName is the name of the resource group within the current subscription. You can obtain this value +// from the Azure Resource Manager API or the portal. searchServiceName is the name of the Azure Search service to +// update. service is the definition of the Search service to update. clientRequestID is a client-generated GUID +// value that identifies this request. If specified, this will be included in response information as a way to +// track the request. +func (client ServicesClient) Update(ctx context.Context, resourceGroupName string, searchServiceName string, service Service, clientRequestID *uuid.UUID) (result Service, err error) { + req, err := client.UpdatePreparer(ctx, resourceGroupName, searchServiceName, service, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "search.ServicesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "search.ServicesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "search.ServicesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ServicesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, searchServiceName string, service Service, clientRequestID *uuid.UUID) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "searchServiceName": autorest.Encode("path", searchServiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-08-19" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}", pathParameters), + autorest.WithJSON(service), + autorest.WithQueryParameters(queryParameters)) + if clientRequestID != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("x-ms-client-request-id", autorest.String(clientRequestID))) + } + 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 ServicesClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ServicesClient) UpdateResponder(resp *http.Response) (result Service, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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/search/mgmt/2015-08-19/search/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/search/mgmt/2015-08-19/search/version.go index ef646d6933d3..a9fc5c0240b2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/search/mgmt/2015-08-19/search/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/search/mgmt/2015-08-19/search/version.go @@ -1,5 +1,7 @@ package search +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package search // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta services" + return "Azure-SDK-For-Go/" + version.Number + " search/2015-08-19" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/disasterrecoveryconfigs.go b/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/disasterrecoveryconfigs.go index 6a25bd66635f..a1c9f4e575ce 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/disasterrecoveryconfigs.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/disasterrecoveryconfigs.go @@ -43,8 +43,8 @@ func NewDisasterRecoveryConfigsClientWithBaseURI(baseURI string, subscriptionID // BreakPairing this operation disables the Disaster Recovery and stops replicating changes from primary to secondary // namespaces // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// alias is the Disaster Recovery configuration name +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name alias is the Disaster Recovery configuration name func (client DisasterRecoveryConfigsClient) BreakPairing(ctx context.Context, resourceGroupName string, namespaceName string, alias string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -56,7 +56,7 @@ func (client DisasterRecoveryConfigsClient) BreakPairing(ctx context.Context, re {TargetValue: alias, Constraints: []validation.Constraint{{Target: "alias", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "alias", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.DisasterRecoveryConfigsClient", "BreakPairing") + return result, validation.NewError("servicebus.DisasterRecoveryConfigsClient", "BreakPairing", err.Error()) } req, err := client.BreakPairingPreparer(ctx, resourceGroupName, namespaceName, alias) @@ -123,8 +123,8 @@ func (client DisasterRecoveryConfigsClient) BreakPairingResponder(resp *http.Res // CheckNameAvailabilityMethod check the give namespace name availability. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// parameters is parameters to check availability of the given namespace name +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name parameters is parameters to check availability of the given namespace name func (client DisasterRecoveryConfigsClient) CheckNameAvailabilityMethod(ctx context.Context, resourceGroupName string, namespaceName string, parameters CheckNameAvailability) (result CheckNameAvailabilityResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -135,7 +135,7 @@ func (client DisasterRecoveryConfigsClient) CheckNameAvailabilityMethod(ctx cont {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.DisasterRecoveryConfigsClient", "CheckNameAvailabilityMethod") + return result, validation.NewError("servicebus.DisasterRecoveryConfigsClient", "CheckNameAvailabilityMethod", err.Error()) } req, err := client.CheckNameAvailabilityMethodPreparer(ctx, resourceGroupName, namespaceName, parameters) @@ -204,9 +204,9 @@ func (client DisasterRecoveryConfigsClient) CheckNameAvailabilityMethodResponder // CreateOrUpdate creates or updates a new Alias(Disaster Recovery configuration) // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// alias is the Disaster Recovery configuration name parameters is parameters required to create an Alias(Disaster -// Recovery configuration) +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name alias is the Disaster Recovery configuration name parameters is parameters required to create an +// Alias(Disaster Recovery configuration) func (client DisasterRecoveryConfigsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, alias string, parameters ArmDisasterRecovery) (result ArmDisasterRecovery, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -218,7 +218,7 @@ func (client DisasterRecoveryConfigsClient) CreateOrUpdate(ctx context.Context, {TargetValue: alias, Constraints: []validation.Constraint{{Target: "alias", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "alias", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.DisasterRecoveryConfigsClient", "CreateOrUpdate") + return result, validation.NewError("servicebus.DisasterRecoveryConfigsClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, namespaceName, alias, parameters) @@ -288,8 +288,8 @@ func (client DisasterRecoveryConfigsClient) CreateOrUpdateResponder(resp *http.R // Delete deletes an Alias(Disaster Recovery configuration) // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// alias is the Disaster Recovery configuration name +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name alias is the Disaster Recovery configuration name func (client DisasterRecoveryConfigsClient) Delete(ctx context.Context, resourceGroupName string, namespaceName string, alias string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -301,7 +301,7 @@ func (client DisasterRecoveryConfigsClient) Delete(ctx context.Context, resource {TargetValue: alias, Constraints: []validation.Constraint{{Target: "alias", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "alias", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.DisasterRecoveryConfigsClient", "Delete") + return result, validation.NewError("servicebus.DisasterRecoveryConfigsClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, namespaceName, alias) @@ -368,8 +368,8 @@ func (client DisasterRecoveryConfigsClient) DeleteResponder(resp *http.Response) // FailOver envokes GEO DR failover and reconfigure the alias to point to the secondary namespace // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// alias is the Disaster Recovery configuration name +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name alias is the Disaster Recovery configuration name func (client DisasterRecoveryConfigsClient) FailOver(ctx context.Context, resourceGroupName string, namespaceName string, alias string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -381,7 +381,7 @@ func (client DisasterRecoveryConfigsClient) FailOver(ctx context.Context, resour {TargetValue: alias, Constraints: []validation.Constraint{{Target: "alias", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "alias", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.DisasterRecoveryConfigsClient", "FailOver") + return result, validation.NewError("servicebus.DisasterRecoveryConfigsClient", "FailOver", err.Error()) } req, err := client.FailOverPreparer(ctx, resourceGroupName, namespaceName, alias) @@ -448,8 +448,8 @@ func (client DisasterRecoveryConfigsClient) FailOverResponder(resp *http.Respons // Get retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// alias is the Disaster Recovery configuration name +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name alias is the Disaster Recovery configuration name func (client DisasterRecoveryConfigsClient) Get(ctx context.Context, resourceGroupName string, namespaceName string, alias string) (result ArmDisasterRecovery, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -461,7 +461,7 @@ func (client DisasterRecoveryConfigsClient) Get(ctx context.Context, resourceGro {TargetValue: alias, Constraints: []validation.Constraint{{Target: "alias", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "alias", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.DisasterRecoveryConfigsClient", "Get") + return result, validation.NewError("servicebus.DisasterRecoveryConfigsClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, namespaceName, alias) @@ -529,8 +529,8 @@ func (client DisasterRecoveryConfigsClient) GetResponder(resp *http.Response) (r // GetAuthorizationRule gets an authorization rule for a namespace by rule name. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// alias is the Disaster Recovery configuration name authorizationRuleName is the authorizationrule name. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name alias is the Disaster Recovery configuration name authorizationRuleName is the authorizationrule name. func (client DisasterRecoveryConfigsClient) GetAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, alias string, authorizationRuleName string) (result SBAuthorizationRule, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -545,7 +545,7 @@ func (client DisasterRecoveryConfigsClient) GetAuthorizationRule(ctx context.Con {TargetValue: authorizationRuleName, Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.DisasterRecoveryConfigsClient", "GetAuthorizationRule") + return result, validation.NewError("servicebus.DisasterRecoveryConfigsClient", "GetAuthorizationRule", err.Error()) } req, err := client.GetAuthorizationRulePreparer(ctx, resourceGroupName, namespaceName, alias, authorizationRuleName) @@ -614,7 +614,8 @@ func (client DisasterRecoveryConfigsClient) GetAuthorizationRuleResponder(resp * // List gets all Alias(Disaster Recovery configurations) // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name func (client DisasterRecoveryConfigsClient) List(ctx context.Context, resourceGroupName string, namespaceName string) (result ArmDisasterRecoveryListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -623,7 +624,7 @@ func (client DisasterRecoveryConfigsClient) List(ctx context.Context, resourceGr {TargetValue: namespaceName, Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.DisasterRecoveryConfigsClient", "List") + return result, validation.NewError("servicebus.DisasterRecoveryConfigsClient", "List", err.Error()) } result.fn = client.listNextResults @@ -718,8 +719,8 @@ func (client DisasterRecoveryConfigsClient) ListComplete(ctx context.Context, re // ListAuthorizationRules gets the authorization rules for a namespace. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// alias is the Disaster Recovery configuration name +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name alias is the Disaster Recovery configuration name func (client DisasterRecoveryConfigsClient) ListAuthorizationRules(ctx context.Context, resourceGroupName string, namespaceName string, alias string) (result SBAuthorizationRuleListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -731,7 +732,7 @@ func (client DisasterRecoveryConfigsClient) ListAuthorizationRules(ctx context.C {TargetValue: alias, Constraints: []validation.Constraint{{Target: "alias", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "alias", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.DisasterRecoveryConfigsClient", "ListAuthorizationRules") + return result, validation.NewError("servicebus.DisasterRecoveryConfigsClient", "ListAuthorizationRules", err.Error()) } result.fn = client.listAuthorizationRulesNextResults @@ -827,8 +828,8 @@ func (client DisasterRecoveryConfigsClient) ListAuthorizationRulesComplete(ctx c // ListKeys gets the primary and secondary connection strings for the namespace. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// alias is the Disaster Recovery configuration name authorizationRuleName is the authorizationrule name. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name alias is the Disaster Recovery configuration name authorizationRuleName is the authorizationrule name. func (client DisasterRecoveryConfigsClient) ListKeys(ctx context.Context, resourceGroupName string, namespaceName string, alias string, authorizationRuleName string) (result AccessKeys, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -843,7 +844,7 @@ func (client DisasterRecoveryConfigsClient) ListKeys(ctx context.Context, resour {TargetValue: authorizationRuleName, Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.DisasterRecoveryConfigsClient", "ListKeys") + return result, validation.NewError("servicebus.DisasterRecoveryConfigsClient", "ListKeys", err.Error()) } req, err := client.ListKeysPreparer(ctx, resourceGroupName, namespaceName, alias, authorizationRuleName) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/eventhubs.go b/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/eventhubs.go index 9e64ab97666e..c1cabbfc1027 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/eventhubs.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/eventhubs.go @@ -42,7 +42,8 @@ func NewEventHubsClientWithBaseURI(baseURI string, subscriptionID string) EventH // ListByNamespace gets all the Event Hubs in a service bus Namespace. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name func (client EventHubsClient) ListByNamespace(ctx context.Context, resourceGroupName string, namespaceName string) (result EventHubListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -51,7 +52,7 @@ func (client EventHubsClient) ListByNamespace(ctx context.Context, resourceGroup {TargetValue: namespaceName, Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.EventHubsClient", "ListByNamespace") + return result, validation.NewError("servicebus.EventHubsClient", "ListByNamespace", err.Error()) } result.fn = client.listByNamespaceNextResults diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/models.go index 300d673cf981..5864568056ce 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/models.go @@ -177,8 +177,8 @@ type AccessKeys struct { KeyName *string `json:"keyName,omitempty"` } -// Action represents the filter actions which are allowed for the transformation of a message that have been matched by -// a filter expression. +// Action represents the filter actions which are allowed for the transformation of a message that have been +// matched by a filter expression. type Action struct { // SQLExpression - SQL expression. e.g. MyProperty='ABC' SQLExpression *string `json:"sqlExpression,omitempty"` @@ -191,14 +191,14 @@ type Action struct { // ArmDisasterRecovery single item in List or Get Alias(Disaster Recovery configuration) operation type ArmDisasterRecovery struct { autorest.Response `json:"-"` + // ArmDisasterRecoveryProperties - Properties required to the Create Or Update Alias(Disaster Recovery configurations) + *ArmDisasterRecoveryProperties `json:"properties,omitempty"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name Name *string `json:"name,omitempty"` // Type - Resource type Type *string `json:"type,omitempty"` - // ArmDisasterRecoveryProperties - Properties required to the Create Or Update Alias(Disaster Recovery configurations) - *ArmDisasterRecoveryProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ArmDisasterRecovery struct. @@ -208,46 +208,45 @@ func (adr *ArmDisasterRecovery) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ArmDisasterRecoveryProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - adr.ArmDisasterRecoveryProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - adr.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - adr.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var armDisasterRecoveryProperties ArmDisasterRecoveryProperties + err = json.Unmarshal(*v, &armDisasterRecoveryProperties) + if err != nil { + return err + } + adr.ArmDisasterRecoveryProperties = &armDisasterRecoveryProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + adr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + adr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + adr.Type = &typeVar + } } - adr.Type = &typeVar } return nil @@ -355,7 +354,8 @@ func (page ArmDisasterRecoveryListResultPage) Values() []ArmDisasterRecovery { return *page.adrlr.Value } -// ArmDisasterRecoveryProperties properties required to the Create Or Update Alias(Disaster Recovery configurations) +// ArmDisasterRecoveryProperties properties required to the Create Or Update Alias(Disaster Recovery +// configurations) type ArmDisasterRecoveryProperties struct { // ProvisioningState - Provisioning state of the Alias(Disaster Recovery configuration) - possible values 'Accepted' or 'Succeeded' or 'Failed'. Possible values include: 'Accepted', 'Succeeded', 'Failed' ProvisioningState ProvisioningStateDR `json:"provisioningState,omitempty"` @@ -441,33 +441,34 @@ func (d *Destination) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - 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 + } + d.Name = &name + } + case "properties": + if v != nil { + var destinationProperties DestinationProperties + err = json.Unmarshal(*v, &destinationProperties) + if err != nil { + return err + } + d.DestinationProperties = &destinationProperties + } } - d.Name = &name - } - - v = m["properties"] - if v != nil { - var properties DestinationProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - d.DestinationProperties = &properties } return nil } -// DestinationProperties properties describing the storage account, blob container and acrchive name format for capture -// destination +// DestinationProperties properties describing the storage account, blob container and acrchive name format for +// capture destination type DestinationProperties struct { // StorageAccountResourceID - Resource id of the storage account to be used to create the blobs StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"` @@ -477,8 +478,8 @@ type DestinationProperties struct { ArchiveNameFormat *string `json:"archiveNameFormat,omitempty"` } -// ErrorResponse error reponse indicates ServiceBus service is not able to process the incoming request. The reason is -// provided in the error message. +// ErrorResponse error reponse indicates ServiceBus service is not able to process the incoming request. The reason +// is provided in the error message. type ErrorResponse struct { // Code - Error code. Code *string `json:"code,omitempty"` @@ -488,14 +489,14 @@ type ErrorResponse struct { // Eventhub single item in List or Get Event Hub operation type Eventhub struct { + // EventhubProperties - Properties supplied to the Create Or Update Event Hub operation. + *EventhubProperties `json:"properties,omitempty"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name Name *string `json:"name,omitempty"` // Type - Resource type Type *string `json:"type,omitempty"` - // EventhubProperties - Properties supplied to the Create Or Update Event Hub operation. - *EventhubProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for Eventhub struct. @@ -505,46 +506,45 @@ func (e *Eventhub) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties EventhubProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var eventhubProperties EventhubProperties + err = json.Unmarshal(*v, &eventhubProperties) + if err != nil { + return err + } + e.EventhubProperties = &eventhubProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + e.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + e.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + e.Type = &typeVar + } } - e.EventhubProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - e.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - e.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - e.Type = &typeVar } return nil @@ -684,7 +684,8 @@ type MessageCountDetails struct { TransferDeadLetterMessageCount *int64 `json:"transferDeadLetterMessageCount,omitempty"` } -// NamespacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// NamespacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type NamespacesCreateOrUpdateFuture struct { azure.Future req *http.Request @@ -696,22 +697,39 @@ func (future NamespacesCreateOrUpdateFuture) Result(client NamespacesClient) (sn var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "servicebus.NamespacesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return sn, autorest.NewError("servicebus.NamespacesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return sn, azure.NewAsyncOpIncompleteError("servicebus.NamespacesCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { sn, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "servicebus.NamespacesCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "servicebus.NamespacesCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } sn, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicebus.NamespacesCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -727,22 +745,39 @@ func (future NamespacesDeleteFuture) Result(client NamespacesClient) (ar autores var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "servicebus.NamespacesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("servicebus.NamespacesDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("servicebus.NamespacesDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "servicebus.NamespacesDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "servicebus.NamespacesDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "servicebus.NamespacesDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -764,8 +799,8 @@ type OperationDisplay struct { Operation *string `json:"operation,omitempty"` } -// OperationListResult result of the request to list ServiceBus operations. It contains a list of operations and a URL -// link to get the next set of results. +// OperationListResult result of the request to list ServiceBus operations. It contains a list of operations and a +// URL link to get the next set of results. type OperationListResult struct { autorest.Response `json:"-"` // Value - List of ServiceBus operations supported by the Microsoft.ServiceBus resource provider. @@ -869,17 +904,41 @@ func (page OperationListResultPage) Values() []Operation { // PremiumMessagingRegions premium Messaging Region type PremiumMessagingRegions struct { + Properties *PremiumMessagingRegionsProperties `json:"properties,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name Name *string `json:"name,omitempty"` // Type - Resource type Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - Properties *PremiumMessagingRegionsProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for PremiumMessagingRegions. +func (pmr PremiumMessagingRegions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pmr.Properties != nil { + objectMap["properties"] = pmr.Properties + } + if pmr.Location != nil { + objectMap["location"] = pmr.Location + } + if pmr.Tags != nil { + objectMap["tags"] = pmr.Tags + } + if pmr.ID != nil { + objectMap["id"] = pmr.ID + } + if pmr.Name != nil { + objectMap["name"] = pmr.Name + } + if pmr.Type != nil { + objectMap["type"] = pmr.Type + } + return json.Marshal(objectMap) } // PremiumMessagingRegionsListResult the response of the List PremiumMessagingRegions operation. @@ -891,7 +950,8 @@ type PremiumMessagingRegionsListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// PremiumMessagingRegionsListResultIterator provides access to a complete listing of PremiumMessagingRegions values. +// PremiumMessagingRegionsListResultIterator provides access to a complete listing of PremiumMessagingRegions +// values. type PremiumMessagingRegionsListResultIterator struct { i int page PremiumMessagingRegionsListResultPage @@ -992,8 +1052,8 @@ type PremiumMessagingRegionsProperties struct { FullName *string `json:"fullName,omitempty"` } -// RegenerateAccessKeyParameters parameters supplied to the Regenerate Authorization Rule operation, specifies which -// key neeeds to be reset. +// RegenerateAccessKeyParameters parameters supplied to the Regenerate Authorization Rule operation, specifies +// which key neeeds to be reset. type RegenerateAccessKeyParameters struct { // KeyType - The access key to regenerate. Possible values include: 'PrimaryKey', 'SecondaryKey' KeyType KeyType `json:"keyType,omitempty"` @@ -1013,29 +1073,50 @@ type Resource struct { // ResourceNamespacePatch the Resource definition. type ResourceNamespacePatch struct { + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name Name *string `json:"name,omitempty"` // Type - Resource type Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceNamespacePatch. +func (rnp ResourceNamespacePatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rnp.Location != nil { + objectMap["location"] = rnp.Location + } + if rnp.Tags != nil { + objectMap["tags"] = rnp.Tags + } + if rnp.ID != nil { + objectMap["id"] = rnp.ID + } + if rnp.Name != nil { + objectMap["name"] = rnp.Name + } + if rnp.Type != nil { + objectMap["type"] = rnp.Type + } + return json.Marshal(objectMap) } // Rule description of Rule Resource. type Rule struct { autorest.Response `json:"-"` + // Ruleproperties - Properties of Rule resource + *Ruleproperties `json:"properties,omitempty"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name Name *string `json:"name,omitempty"` // Type - Resource type Type *string `json:"type,omitempty"` - // Ruleproperties - Properties of Rule resource - *Ruleproperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for Rule struct. @@ -1045,46 +1126,45 @@ func (r *Rule) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties Ruleproperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var ruleproperties Ruleproperties + err = json.Unmarshal(*v, &ruleproperties) + if err != nil { + return err + } + r.Ruleproperties = &ruleproperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + r.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + r.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + r.Type = &typeVar + } } - r.Ruleproperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - r.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - r.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - r.Type = &typeVar } return nil @@ -1207,14 +1287,14 @@ type Ruleproperties struct { // SBAuthorizationRule description of a namespace authorization rule. type SBAuthorizationRule struct { autorest.Response `json:"-"` + // SBAuthorizationRuleProperties - AuthorizationRule properties. + *SBAuthorizationRuleProperties `json:"properties,omitempty"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name Name *string `json:"name,omitempty"` // Type - Resource type Type *string `json:"type,omitempty"` - // SBAuthorizationRuleProperties - AuthorizationRule properties. - *SBAuthorizationRuleProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for SBAuthorizationRule struct. @@ -1224,46 +1304,45 @@ func (sar *SBAuthorizationRule) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties SBAuthorizationRuleProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - sar.SBAuthorizationRuleProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - sar.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var sBAuthorizationRuleProperties SBAuthorizationRuleProperties + err = json.Unmarshal(*v, &sBAuthorizationRuleProperties) + if err != nil { + return err + } + sar.SBAuthorizationRuleProperties = &sBAuthorizationRuleProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sar.Type = &typeVar + } } - sar.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - sar.Type = &typeVar } return nil @@ -1380,99 +1459,122 @@ type SBAuthorizationRuleProperties struct { // SBNamespace description of a namespace resource. type SBNamespace struct { autorest.Response `json:"-"` + // Sku - Porperties of Sku + Sku *SBSku `json:"sku,omitempty"` + // SBNamespaceProperties - Properties of the namespace. + *SBNamespaceProperties `json:"properties,omitempty"` + // Location - The Geo-location where the resource lives + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name Name *string `json:"name,omitempty"` // Type - Resource type Type *string `json:"type,omitempty"` - // Location - The Geo-location where the resource lives - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - // Sku - Porperties of Sku - Sku *SBSku `json:"sku,omitempty"` - // SBNamespaceProperties - Properties of the namespace. - *SBNamespaceProperties `json:"properties,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for SBNamespace struct. -func (sn *SBNamespace) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for SBNamespace. +func (sn SBNamespace) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sn.Sku != nil { + objectMap["sku"] = sn.Sku } - var v *json.RawMessage - - v = m["sku"] - if v != nil { - var sku SBSku - err = json.Unmarshal(*m["sku"], &sku) - if err != nil { - return err - } - sn.Sku = &sku + if sn.SBNamespaceProperties != nil { + objectMap["properties"] = sn.SBNamespaceProperties } - - v = m["properties"] - if v != nil { - var properties SBNamespaceProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - sn.SBNamespaceProperties = &properties + if sn.Location != nil { + objectMap["location"] = sn.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - sn.Location = &location + if sn.Tags != nil { + objectMap["tags"] = sn.Tags } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - sn.Tags = &tags + if sn.ID != nil { + objectMap["id"] = sn.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - sn.ID = &ID + if sn.Name != nil { + objectMap["name"] = sn.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - sn.Name = &name + if sn.Type != nil { + objectMap["type"] = sn.Type } + return json.Marshal(objectMap) +} - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for SBNamespace struct. +func (sn *SBNamespace) 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 "sku": + if v != nil { + var sku SBSku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + sn.Sku = &sku + } + case "properties": + if v != nil { + var sBNamespaceProperties SBNamespaceProperties + err = json.Unmarshal(*v, &sBNamespaceProperties) + if err != nil { + return err + } + sn.SBNamespaceProperties = &sBNamespaceProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + sn.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + sn.Tags = tags + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sn.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sn.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sn.Type = &typeVar + } } - sn.Type = &typeVar } return nil @@ -1596,99 +1698,122 @@ type SBNamespaceProperties struct { // SBNamespaceUpdateParameters description of a namespace resource. type SBNamespaceUpdateParameters struct { + // Sku - Porperties of Sku + Sku *SBSku `json:"sku,omitempty"` + // SBNamespaceProperties - Properties of the namespace. + *SBNamespaceProperties `json:"properties,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name Name *string `json:"name,omitempty"` // Type - Resource type Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - // Sku - Porperties of Sku - Sku *SBSku `json:"sku,omitempty"` - // SBNamespaceProperties - Properties of the namespace. - *SBNamespaceProperties `json:"properties,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for SBNamespaceUpdateParameters struct. -func (snup *SBNamespaceUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for SBNamespaceUpdateParameters. +func (snup SBNamespaceUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if snup.Sku != nil { + objectMap["sku"] = snup.Sku } - var v *json.RawMessage - - v = m["sku"] - if v != nil { - var sku SBSku - err = json.Unmarshal(*m["sku"], &sku) - if err != nil { - return err - } - snup.Sku = &sku + if snup.SBNamespaceProperties != nil { + objectMap["properties"] = snup.SBNamespaceProperties } - - v = m["properties"] - if v != nil { - var properties SBNamespaceProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - snup.SBNamespaceProperties = &properties + if snup.Location != nil { + objectMap["location"] = snup.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - snup.Location = &location + if snup.Tags != nil { + objectMap["tags"] = snup.Tags } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - snup.Tags = &tags + if snup.ID != nil { + objectMap["id"] = snup.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - snup.ID = &ID + if snup.Name != nil { + objectMap["name"] = snup.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - snup.Name = &name + if snup.Type != nil { + objectMap["type"] = snup.Type } + return json.Marshal(objectMap) +} - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for SBNamespaceUpdateParameters struct. +func (snup *SBNamespaceUpdateParameters) 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 "sku": + if v != nil { + var sku SBSku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + snup.Sku = &sku + } + case "properties": + if v != nil { + var sBNamespaceProperties SBNamespaceProperties + err = json.Unmarshal(*v, &sBNamespaceProperties) + if err != nil { + return err + } + snup.SBNamespaceProperties = &sBNamespaceProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + snup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + snup.Tags = tags + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + snup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + snup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + snup.Type = &typeVar + } } - snup.Type = &typeVar } return nil @@ -1697,14 +1822,14 @@ func (snup *SBNamespaceUpdateParameters) UnmarshalJSON(body []byte) error { // SBQueue description of queue Resource. type SBQueue struct { autorest.Response `json:"-"` + // SBQueueProperties - Queue Properties + *SBQueueProperties `json:"properties,omitempty"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name Name *string `json:"name,omitempty"` // Type - Resource type Type *string `json:"type,omitempty"` - // SBQueueProperties - Queue Properties - *SBQueueProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for SBQueue struct. @@ -1714,46 +1839,45 @@ func (sq *SBQueue) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties SBQueueProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - sq.SBQueueProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var sBQueueProperties SBQueueProperties + err = json.Unmarshal(*v, &sBQueueProperties) + if err != nil { + return err + } + sq.SBQueueProperties = &sBQueueProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sq.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sq.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sq.Type = &typeVar + } } - sq.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - sq.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - sq.Type = &typeVar } return nil @@ -1918,14 +2042,14 @@ type SBSku struct { // SBSubscription description of subscription resource. type SBSubscription struct { autorest.Response `json:"-"` + // SBSubscriptionProperties - Properties of subscriptions resource. + *SBSubscriptionProperties `json:"properties,omitempty"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name Name *string `json:"name,omitempty"` // Type - Resource type Type *string `json:"type,omitempty"` - // SBSubscriptionProperties - Properties of subscriptions resource. - *SBSubscriptionProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for SBSubscription struct. @@ -1935,46 +2059,45 @@ func (ss *SBSubscription) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties SBSubscriptionProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - ss.SBSubscriptionProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - ss.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - ss.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var sBSubscriptionProperties SBSubscriptionProperties + err = json.Unmarshal(*v, &sBSubscriptionProperties) + if err != nil { + return err + } + ss.SBSubscriptionProperties = &sBSubscriptionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ss.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ss.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ss.Type = &typeVar + } } - ss.Type = &typeVar } return nil @@ -2100,6 +2223,8 @@ type SBSubscriptionProperties struct { RequiresSession *bool `json:"requiresSession,omitempty"` // DefaultMessageTimeToLive - ISO 8061 Default message timespan to live value. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself. DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + // DeadLetteringOnFilterEvaluationExceptions - Value that indicates whether a subscription has dead letter support on filter evaluation exceptions. + DeadLetteringOnFilterEvaluationExceptions *bool `json:"deadLetteringOnFilterEvaluationExceptions,omitempty"` // DeadLetteringOnMessageExpiration - Value that indicates whether a subscription has dead letter support when a message expires. DeadLetteringOnMessageExpiration *bool `json:"deadLetteringOnMessageExpiration,omitempty"` // DuplicateDetectionHistoryTimeWindow - ISO 8601 timeSpan structure that defines the duration of the duplicate detection history. The default value is 10 minutes. @@ -2121,14 +2246,14 @@ type SBSubscriptionProperties struct { // SBTopic description of topic resource. type SBTopic struct { autorest.Response `json:"-"` + // SBTopicProperties - Properties of topic resource. + *SBTopicProperties `json:"properties,omitempty"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name Name *string `json:"name,omitempty"` // Type - Resource type Type *string `json:"type,omitempty"` - // SBTopicProperties - Properties of topic resource. - *SBTopicProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for SBTopic struct. @@ -2138,46 +2263,45 @@ func (st *SBTopic) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties SBTopicProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - st.SBTopicProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - st.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var sBTopicProperties SBTopicProperties + err = json.Unmarshal(*v, &sBTopicProperties) + if err != nil { + return err + } + st.SBTopicProperties = &sBTopicProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + st.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + st.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + st.Type = &typeVar + } } - st.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - st.Type = &typeVar } return nil @@ -2321,8 +2445,8 @@ type SBTopicProperties struct { EnableExpress *bool `json:"enableExpress,omitempty"` } -// SQLFilter represents a filter which is a composition of an expression and an action that is executed in the pub/sub -// pipeline. +// SQLFilter represents a filter which is a composition of an expression and an action that is executed in the +// pub/sub pipeline. type SQLFilter struct { // SQLExpression - The SQL expression. e.g. MyProperty='ABC' SQLExpression *string `json:"sqlExpression,omitempty"` @@ -2345,14 +2469,35 @@ type SQLRuleAction struct { // TrackedResource the Resource definition. type TrackedResource struct { + // Location - The Geo-location where the resource lives + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` // ID - Resource Id ID *string `json:"id,omitempty"` // Name - Resource name Name *string `json:"name,omitempty"` // Type - Resource type Type *string `json:"type,omitempty"` - // Location - The Geo-location where the resource lives - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` +} + +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Location != nil { + objectMap["location"] = tr.Location + } + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.ID != nil { + objectMap["id"] = tr.ID + } + if tr.Name != nil { + objectMap["name"] = tr.Name + } + if tr.Type != nil { + objectMap["type"] = tr.Type + } + return json.Marshal(objectMap) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/namespaces.go b/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/namespaces.go index 16d4dc571eb5..613eeae6e8de 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/namespaces.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/namespaces.go @@ -47,7 +47,7 @@ func (client NamespacesClient) CheckNameAvailabilityMethod(ctx context.Context, if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.NamespacesClient", "CheckNameAvailabilityMethod") + return result, validation.NewError("servicebus.NamespacesClient", "CheckNameAvailabilityMethod", err.Error()) } req, err := client.CheckNameAvailabilityMethodPreparer(ctx, parameters) @@ -115,14 +115,14 @@ func (client NamespacesClient) CheckNameAvailabilityMethodResponder(resp *http.R // CreateOrUpdate creates or updates a service namespace. Once created, this namespace's resource manifest is // immutable. This operation is idempotent. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name. -// parameters is parameters supplied to create a namespace resource. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name. parameters is parameters supplied to create a namespace resource. func (client NamespacesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, parameters SBNamespace) (result NamespacesCreateOrUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.NamespacesClient", "CreateOrUpdate") + return result, validation.NewError("servicebus.NamespacesClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, namespaceName, parameters) @@ -193,8 +193,8 @@ func (client NamespacesClient) CreateOrUpdateResponder(resp *http.Response) (res // CreateOrUpdateAuthorizationRule creates or updates an authorization rule for a namespace. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// authorizationRuleName is the authorizationrule name. parameters is the shared access authorization rule. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name authorizationRuleName is the authorizationrule name. parameters is the shared access authorization rule. func (client NamespacesClient) CreateOrUpdateAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, parameters SBAuthorizationRule) (result SBAuthorizationRule, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -209,7 +209,7 @@ func (client NamespacesClient) CreateOrUpdateAuthorizationRule(ctx context.Conte {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.SBAuthorizationRuleProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.SBAuthorizationRuleProperties.Rights", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.NamespacesClient", "CreateOrUpdateAuthorizationRule") + return result, validation.NewError("servicebus.NamespacesClient", "CreateOrUpdateAuthorizationRule", err.Error()) } req, err := client.CreateOrUpdateAuthorizationRulePreparer(ctx, resourceGroupName, namespaceName, authorizationRuleName, parameters) @@ -279,7 +279,8 @@ func (client NamespacesClient) CreateOrUpdateAuthorizationRuleResponder(resp *ht // Delete deletes an existing namespace. This operation also removes all associated resources under the namespace. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name func (client NamespacesClient) Delete(ctx context.Context, resourceGroupName string, namespaceName string) (result NamespacesDeleteFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -288,7 +289,7 @@ func (client NamespacesClient) Delete(ctx context.Context, resourceGroupName str {TargetValue: namespaceName, Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.NamespacesClient", "Delete") + return result, validation.NewError("servicebus.NamespacesClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, namespaceName) @@ -356,8 +357,8 @@ func (client NamespacesClient) DeleteResponder(resp *http.Response) (result auto // DeleteAuthorizationRule deletes a namespace authorization rule. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// authorizationRuleName is the authorizationrule name. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name authorizationRuleName is the authorizationrule name. func (client NamespacesClient) DeleteAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -369,7 +370,7 @@ func (client NamespacesClient) DeleteAuthorizationRule(ctx context.Context, reso {TargetValue: authorizationRuleName, Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.NamespacesClient", "DeleteAuthorizationRule") + return result, validation.NewError("servicebus.NamespacesClient", "DeleteAuthorizationRule", err.Error()) } req, err := client.DeleteAuthorizationRulePreparer(ctx, resourceGroupName, namespaceName, authorizationRuleName) @@ -436,7 +437,8 @@ func (client NamespacesClient) DeleteAuthorizationRuleResponder(resp *http.Respo // Get gets a description for the specified namespace. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name func (client NamespacesClient) Get(ctx context.Context, resourceGroupName string, namespaceName string) (result SBNamespace, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -445,7 +447,7 @@ func (client NamespacesClient) Get(ctx context.Context, resourceGroupName string {TargetValue: namespaceName, Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.NamespacesClient", "Get") + return result, validation.NewError("servicebus.NamespacesClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, namespaceName) @@ -512,8 +514,8 @@ func (client NamespacesClient) GetResponder(resp *http.Response) (result SBNames // GetAuthorizationRule gets an authorization rule for a namespace by rule name. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// authorizationRuleName is the authorizationrule name. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name authorizationRuleName is the authorizationrule name. func (client NamespacesClient) GetAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string) (result SBAuthorizationRule, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -525,7 +527,7 @@ func (client NamespacesClient) GetAuthorizationRule(ctx context.Context, resourc {TargetValue: authorizationRuleName, Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.NamespacesClient", "GetAuthorizationRule") + return result, validation.NewError("servicebus.NamespacesClient", "GetAuthorizationRule", err.Error()) } req, err := client.GetAuthorizationRulePreparer(ctx, resourceGroupName, namespaceName, authorizationRuleName) @@ -683,7 +685,8 @@ func (client NamespacesClient) ListComplete(ctx context.Context) (result SBNames // ListAuthorizationRules gets the authorization rules for a namespace. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name func (client NamespacesClient) ListAuthorizationRules(ctx context.Context, resourceGroupName string, namespaceName string) (result SBAuthorizationRuleListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -692,7 +695,7 @@ func (client NamespacesClient) ListAuthorizationRules(ctx context.Context, resou {TargetValue: namespaceName, Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.NamespacesClient", "ListAuthorizationRules") + return result, validation.NewError("servicebus.NamespacesClient", "ListAuthorizationRules", err.Error()) } result.fn = client.listAuthorizationRulesNextResults @@ -793,7 +796,7 @@ func (client NamespacesClient) ListByResourceGroup(ctx context.Context, resource {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.NamespacesClient", "ListByResourceGroup") + return result, validation.NewError("servicebus.NamespacesClient", "ListByResourceGroup", err.Error()) } result.fn = client.listByResourceGroupNextResults @@ -887,8 +890,8 @@ func (client NamespacesClient) ListByResourceGroupComplete(ctx context.Context, // ListKeys gets the primary and secondary connection strings for the namespace. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// authorizationRuleName is the authorizationrule name. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name authorizationRuleName is the authorizationrule name. func (client NamespacesClient) ListKeys(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string) (result AccessKeys, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -900,7 +903,7 @@ func (client NamespacesClient) ListKeys(ctx context.Context, resourceGroupName s {TargetValue: authorizationRuleName, Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.NamespacesClient", "ListKeys") + return result, validation.NewError("servicebus.NamespacesClient", "ListKeys", err.Error()) } req, err := client.ListKeysPreparer(ctx, resourceGroupName, namespaceName, authorizationRuleName) @@ -968,8 +971,8 @@ func (client NamespacesClient) ListKeysResponder(resp *http.Response) (result Ac // RegenerateKeys regenerates the primary or secondary connection strings for the namespace. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// authorizationRuleName is the authorizationrule name. parameters is parameters supplied to regenerate the +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name authorizationRuleName is the authorizationrule name. parameters is parameters supplied to regenerate the // authorization rule. func (client NamespacesClient) RegenerateKeys(ctx context.Context, resourceGroupName string, namespaceName string, authorizationRuleName string, parameters RegenerateAccessKeyParameters) (result AccessKeys, err error) { if err := validation.Validate([]validation.Validation{ @@ -982,7 +985,7 @@ func (client NamespacesClient) RegenerateKeys(ctx context.Context, resourceGroup {TargetValue: authorizationRuleName, Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.NamespacesClient", "RegenerateKeys") + return result, validation.NewError("servicebus.NamespacesClient", "RegenerateKeys", err.Error()) } req, err := client.RegenerateKeysPreparer(ctx, resourceGroupName, namespaceName, authorizationRuleName, parameters) @@ -1053,8 +1056,8 @@ func (client NamespacesClient) RegenerateKeysResponder(resp *http.Response) (res // Update updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is // idempotent. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// parameters is parameters supplied to update a namespace resource. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name parameters is parameters supplied to update a namespace resource. func (client NamespacesClient) Update(ctx context.Context, resourceGroupName string, namespaceName string, parameters SBNamespaceUpdateParameters) (result SBNamespace, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -1063,7 +1066,7 @@ func (client NamespacesClient) Update(ctx context.Context, resourceGroupName str {TargetValue: namespaceName, Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.NamespacesClient", "Update") + return result, validation.NewError("servicebus.NamespacesClient", "Update", err.Error()) } req, err := client.UpdatePreparer(ctx, resourceGroupName, namespaceName, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/queues.go b/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/queues.go index 8c62cade0c46..0171094a0572 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/queues.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/queues.go @@ -42,8 +42,8 @@ func NewQueuesClientWithBaseURI(baseURI string, subscriptionID string) QueuesCli // CreateOrUpdate creates or updates a Service Bus queue. This operation is idempotent. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// queueName is the queue name. parameters is parameters supplied to create or update a queue resource. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name queueName is the queue name. parameters is parameters supplied to create or update a queue resource. func (client QueuesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, parameters SBQueue) (result SBQueue, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -54,7 +54,7 @@ func (client QueuesClient) CreateOrUpdate(ctx context.Context, resourceGroupName {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: queueName, Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.QueuesClient", "CreateOrUpdate") + return result, validation.NewError("servicebus.QueuesClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, namespaceName, queueName, parameters) @@ -124,9 +124,9 @@ func (client QueuesClient) CreateOrUpdateResponder(resp *http.Response) (result // CreateOrUpdateAuthorizationRule creates an authorization rule for a queue. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// queueName is the queue name. authorizationRuleName is the authorizationrule name. parameters is the shared access -// authorization rule. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name queueName is the queue name. authorizationRuleName is the authorizationrule name. parameters is the shared +// access authorization rule. func (client QueuesClient) CreateOrUpdateAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string, parameters SBAuthorizationRule) (result SBAuthorizationRule, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -143,7 +143,7 @@ func (client QueuesClient) CreateOrUpdateAuthorizationRule(ctx context.Context, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.SBAuthorizationRuleProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.SBAuthorizationRuleProperties.Rights", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.QueuesClient", "CreateOrUpdateAuthorizationRule") + return result, validation.NewError("servicebus.QueuesClient", "CreateOrUpdateAuthorizationRule", err.Error()) } req, err := client.CreateOrUpdateAuthorizationRulePreparer(ctx, resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters) @@ -214,8 +214,8 @@ func (client QueuesClient) CreateOrUpdateAuthorizationRuleResponder(resp *http.R // Delete deletes a queue from the specified namespace in a resource group. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// queueName is the queue name. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name queueName is the queue name. func (client QueuesClient) Delete(ctx context.Context, resourceGroupName string, namespaceName string, queueName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -226,7 +226,7 @@ func (client QueuesClient) Delete(ctx context.Context, resourceGroupName string, {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: queueName, Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.QueuesClient", "Delete") + return result, validation.NewError("servicebus.QueuesClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, namespaceName, queueName) @@ -293,8 +293,8 @@ func (client QueuesClient) DeleteResponder(resp *http.Response) (result autorest // DeleteAuthorizationRule deletes a queue authorization rule. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// queueName is the queue name. authorizationRuleName is the authorizationrule name. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name queueName is the queue name. authorizationRuleName is the authorizationrule name. func (client QueuesClient) DeleteAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -308,7 +308,7 @@ func (client QueuesClient) DeleteAuthorizationRule(ctx context.Context, resource {TargetValue: authorizationRuleName, Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.QueuesClient", "DeleteAuthorizationRule") + return result, validation.NewError("servicebus.QueuesClient", "DeleteAuthorizationRule", err.Error()) } req, err := client.DeleteAuthorizationRulePreparer(ctx, resourceGroupName, namespaceName, queueName, authorizationRuleName) @@ -376,8 +376,8 @@ func (client QueuesClient) DeleteAuthorizationRuleResponder(resp *http.Response) // Get returns a description for the specified queue. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// queueName is the queue name. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name queueName is the queue name. func (client QueuesClient) Get(ctx context.Context, resourceGroupName string, namespaceName string, queueName string) (result SBQueue, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -388,7 +388,7 @@ func (client QueuesClient) Get(ctx context.Context, resourceGroupName string, na {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: queueName, Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.QueuesClient", "Get") + return result, validation.NewError("servicebus.QueuesClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, namespaceName, queueName) @@ -456,8 +456,8 @@ func (client QueuesClient) GetResponder(resp *http.Response) (result SBQueue, er // GetAuthorizationRule gets an authorization rule for a queue by rule name. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// queueName is the queue name. authorizationRuleName is the authorizationrule name. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name queueName is the queue name. authorizationRuleName is the authorizationrule name. func (client QueuesClient) GetAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string) (result SBAuthorizationRule, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -471,7 +471,7 @@ func (client QueuesClient) GetAuthorizationRule(ctx context.Context, resourceGro {TargetValue: authorizationRuleName, Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.QueuesClient", "GetAuthorizationRule") + return result, validation.NewError("servicebus.QueuesClient", "GetAuthorizationRule", err.Error()) } req, err := client.GetAuthorizationRulePreparer(ctx, resourceGroupName, namespaceName, queueName, authorizationRuleName) @@ -540,8 +540,8 @@ func (client QueuesClient) GetAuthorizationRuleResponder(resp *http.Response) (r // ListAuthorizationRules gets all authorization rules for a queue. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// queueName is the queue name. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name queueName is the queue name. func (client QueuesClient) ListAuthorizationRules(ctx context.Context, resourceGroupName string, namespaceName string, queueName string) (result SBAuthorizationRuleListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -552,7 +552,7 @@ func (client QueuesClient) ListAuthorizationRules(ctx context.Context, resourceG {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: queueName, Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.QueuesClient", "ListAuthorizationRules") + return result, validation.NewError("servicebus.QueuesClient", "ListAuthorizationRules", err.Error()) } result.fn = client.listAuthorizationRulesNextResults @@ -648,7 +648,8 @@ func (client QueuesClient) ListAuthorizationRulesComplete(ctx context.Context, r // ListByNamespace gets the queues within a namespace. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name func (client QueuesClient) ListByNamespace(ctx context.Context, resourceGroupName string, namespaceName string) (result SBQueueListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -657,7 +658,7 @@ func (client QueuesClient) ListByNamespace(ctx context.Context, resourceGroupNam {TargetValue: namespaceName, Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.QueuesClient", "ListByNamespace") + return result, validation.NewError("servicebus.QueuesClient", "ListByNamespace", err.Error()) } result.fn = client.listByNamespaceNextResults @@ -752,8 +753,8 @@ func (client QueuesClient) ListByNamespaceComplete(ctx context.Context, resource // ListKeys primary and secondary connection strings to the queue. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// queueName is the queue name. authorizationRuleName is the authorizationrule name. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name queueName is the queue name. authorizationRuleName is the authorizationrule name. func (client QueuesClient) ListKeys(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string) (result AccessKeys, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -767,7 +768,7 @@ func (client QueuesClient) ListKeys(ctx context.Context, resourceGroupName strin {TargetValue: authorizationRuleName, Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.QueuesClient", "ListKeys") + return result, validation.NewError("servicebus.QueuesClient", "ListKeys", err.Error()) } req, err := client.ListKeysPreparer(ctx, resourceGroupName, namespaceName, queueName, authorizationRuleName) @@ -836,9 +837,9 @@ func (client QueuesClient) ListKeysResponder(resp *http.Response) (result Access // RegenerateKeys regenerates the primary or secondary connection strings to the queue. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// queueName is the queue name. authorizationRuleName is the authorizationrule name. parameters is parameters supplied -// to regenerate the authorization rule. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name queueName is the queue name. authorizationRuleName is the authorizationrule name. parameters is parameters +// supplied to regenerate the authorization rule. func (client QueuesClient) RegenerateKeys(ctx context.Context, resourceGroupName string, namespaceName string, queueName string, authorizationRuleName string, parameters RegenerateAccessKeyParameters) (result AccessKeys, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -852,7 +853,7 @@ func (client QueuesClient) RegenerateKeys(ctx context.Context, resourceGroupName {TargetValue: authorizationRuleName, Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.QueuesClient", "RegenerateKeys") + return result, validation.NewError("servicebus.QueuesClient", "RegenerateKeys", err.Error()) } req, err := client.RegenerateKeysPreparer(ctx, resourceGroupName, namespaceName, queueName, authorizationRuleName, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/regions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/regions.go index a07762d164af..cacff1f5f776 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/regions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/regions.go @@ -48,7 +48,7 @@ func (client RegionsClient) ListBySku(ctx context.Context, sku string) (result P {TargetValue: sku, Constraints: []validation.Constraint{{Target: "sku", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "sku", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.RegionsClient", "ListBySku") + return result, validation.NewError("servicebus.RegionsClient", "ListBySku", err.Error()) } result.fn = client.listBySkuNextResults diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/rules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/rules.go index 3d17f58537e9..cec6c78b22b8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/rules.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/rules.go @@ -42,9 +42,9 @@ func NewRulesClientWithBaseURI(baseURI string, subscriptionID string) RulesClien // CreateOrUpdate creates a new rule and updates an existing rule // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// topicName is the topic name. subscriptionName is the subscription name. ruleName is the rule name. parameters is -// parameters supplied to create a rule. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name topicName is the topic name. subscriptionName is the subscription name. ruleName is the rule name. +// parameters is parameters supplied to create a rule. func (client RulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, subscriptionName string, ruleName string, parameters Rule) (result Rule, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -61,7 +61,7 @@ func (client RulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName {TargetValue: ruleName, Constraints: []validation.Constraint{{Target: "ruleName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "ruleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.RulesClient", "CreateOrUpdate") + return result, validation.NewError("servicebus.RulesClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, namespaceName, topicName, subscriptionName, ruleName, parameters) @@ -133,8 +133,8 @@ func (client RulesClient) CreateOrUpdateResponder(resp *http.Response) (result R // Delete deletes an existing rule. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// topicName is the topic name. subscriptionName is the subscription name. ruleName is the rule name. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name topicName is the topic name. subscriptionName is the subscription name. ruleName is the rule name. func (client RulesClient) Delete(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, subscriptionName string, ruleName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -151,7 +151,7 @@ func (client RulesClient) Delete(ctx context.Context, resourceGroupName string, {TargetValue: ruleName, Constraints: []validation.Constraint{{Target: "ruleName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "ruleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.RulesClient", "Delete") + return result, validation.NewError("servicebus.RulesClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, namespaceName, topicName, subscriptionName, ruleName) @@ -220,8 +220,8 @@ func (client RulesClient) DeleteResponder(resp *http.Response) (result autorest. // Get retrieves the description for the specified rule. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// topicName is the topic name. subscriptionName is the subscription name. ruleName is the rule name. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name topicName is the topic name. subscriptionName is the subscription name. ruleName is the rule name. func (client RulesClient) Get(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, subscriptionName string, ruleName string) (result Rule, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -238,7 +238,7 @@ func (client RulesClient) Get(ctx context.Context, resourceGroupName string, nam {TargetValue: ruleName, Constraints: []validation.Constraint{{Target: "ruleName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "ruleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.RulesClient", "Get") + return result, validation.NewError("servicebus.RulesClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, namespaceName, topicName, subscriptionName, ruleName) @@ -308,8 +308,8 @@ func (client RulesClient) GetResponder(resp *http.Response) (result Rule, err er // ListBySubscriptions list all the rules within given topic-subscription // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// topicName is the topic name. subscriptionName is the subscription name. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name topicName is the topic name. subscriptionName is the subscription name. func (client RulesClient) ListBySubscriptions(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, subscriptionName string) (result RuleListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -323,7 +323,7 @@ func (client RulesClient) ListBySubscriptions(ctx context.Context, resourceGroup {TargetValue: subscriptionName, Constraints: []validation.Constraint{{Target: "subscriptionName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "subscriptionName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.RulesClient", "ListBySubscriptions") + return result, validation.NewError("servicebus.RulesClient", "ListBySubscriptions", err.Error()) } result.fn = client.listBySubscriptionsNextResults diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/subscriptions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/subscriptions.go index e2f87fc62b0f..2f37ceb71582 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/subscriptions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/subscriptions.go @@ -42,9 +42,9 @@ func NewSubscriptionsClientWithBaseURI(baseURI string, subscriptionID string) Su // CreateOrUpdate creates a topic subscription. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// topicName is the topic name. subscriptionName is the subscription name. parameters is parameters supplied to create -// a subscription resource. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name topicName is the topic name. subscriptionName is the subscription name. parameters is parameters supplied +// to create a subscription resource. func (client SubscriptionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, subscriptionName string, parameters SBSubscription) (result SBSubscription, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -58,7 +58,7 @@ func (client SubscriptionsClient) CreateOrUpdate(ctx context.Context, resourceGr {TargetValue: subscriptionName, Constraints: []validation.Constraint{{Target: "subscriptionName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "subscriptionName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.SubscriptionsClient", "CreateOrUpdate") + return result, validation.NewError("servicebus.SubscriptionsClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, namespaceName, topicName, subscriptionName, parameters) @@ -129,8 +129,8 @@ func (client SubscriptionsClient) CreateOrUpdateResponder(resp *http.Response) ( // Delete deletes a subscription from the specified topic. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// topicName is the topic name. subscriptionName is the subscription name. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name topicName is the topic name. subscriptionName is the subscription name. func (client SubscriptionsClient) Delete(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, subscriptionName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -144,7 +144,7 @@ func (client SubscriptionsClient) Delete(ctx context.Context, resourceGroupName {TargetValue: subscriptionName, Constraints: []validation.Constraint{{Target: "subscriptionName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "subscriptionName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.SubscriptionsClient", "Delete") + return result, validation.NewError("servicebus.SubscriptionsClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, namespaceName, topicName, subscriptionName) @@ -212,8 +212,8 @@ func (client SubscriptionsClient) DeleteResponder(resp *http.Response) (result a // Get returns a subscription description for the specified topic. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// topicName is the topic name. subscriptionName is the subscription name. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name topicName is the topic name. subscriptionName is the subscription name. func (client SubscriptionsClient) Get(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, subscriptionName string) (result SBSubscription, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -227,7 +227,7 @@ func (client SubscriptionsClient) Get(ctx context.Context, resourceGroupName str {TargetValue: subscriptionName, Constraints: []validation.Constraint{{Target: "subscriptionName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "subscriptionName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.SubscriptionsClient", "Get") + return result, validation.NewError("servicebus.SubscriptionsClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, namespaceName, topicName, subscriptionName) @@ -296,8 +296,8 @@ func (client SubscriptionsClient) GetResponder(resp *http.Response) (result SBSu // ListByTopic list all the subscriptions under a specified topic. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// topicName is the topic name. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name topicName is the topic name. func (client SubscriptionsClient) ListByTopic(ctx context.Context, resourceGroupName string, namespaceName string, topicName string) (result SBSubscriptionListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -308,7 +308,7 @@ func (client SubscriptionsClient) ListByTopic(ctx context.Context, resourceGroup {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: topicName, Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.SubscriptionsClient", "ListByTopic") + return result, validation.NewError("servicebus.SubscriptionsClient", "ListByTopic", err.Error()) } result.fn = client.listByTopicNextResults diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/topics.go b/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/topics.go index b6a0c7b42b04..253429ac2b13 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/topics.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/topics.go @@ -42,8 +42,8 @@ func NewTopicsClientWithBaseURI(baseURI string, subscriptionID string) TopicsCli // CreateOrUpdate creates a topic in the specified namespace. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// topicName is the topic name. parameters is parameters supplied to create a topic resource. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name topicName is the topic name. parameters is parameters supplied to create a topic resource. func (client TopicsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, parameters SBTopic) (result SBTopic, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -54,7 +54,7 @@ func (client TopicsClient) CreateOrUpdate(ctx context.Context, resourceGroupName {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: topicName, Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.TopicsClient", "CreateOrUpdate") + return result, validation.NewError("servicebus.TopicsClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, namespaceName, topicName, parameters) @@ -124,9 +124,9 @@ func (client TopicsClient) CreateOrUpdateResponder(resp *http.Response) (result // CreateOrUpdateAuthorizationRule creates an authorizatio rule for the specified topic. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// topicName is the topic name. authorizationRuleName is the authorizationrule name. parameters is the shared access -// authorization rule. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name topicName is the topic name. authorizationRuleName is the authorizationrule name. parameters is the shared +// access authorization rule. func (client TopicsClient) CreateOrUpdateAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string, parameters SBAuthorizationRule) (result SBAuthorizationRule, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -143,7 +143,7 @@ func (client TopicsClient) CreateOrUpdateAuthorizationRule(ctx context.Context, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.SBAuthorizationRuleProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.SBAuthorizationRuleProperties.Rights", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.TopicsClient", "CreateOrUpdateAuthorizationRule") + return result, validation.NewError("servicebus.TopicsClient", "CreateOrUpdateAuthorizationRule", err.Error()) } req, err := client.CreateOrUpdateAuthorizationRulePreparer(ctx, resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters) @@ -214,8 +214,8 @@ func (client TopicsClient) CreateOrUpdateAuthorizationRuleResponder(resp *http.R // Delete deletes a topic from the specified namespace and resource group. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// topicName is the topic name. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name topicName is the topic name. func (client TopicsClient) Delete(ctx context.Context, resourceGroupName string, namespaceName string, topicName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -226,7 +226,7 @@ func (client TopicsClient) Delete(ctx context.Context, resourceGroupName string, {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: topicName, Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.TopicsClient", "Delete") + return result, validation.NewError("servicebus.TopicsClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, namespaceName, topicName) @@ -293,8 +293,8 @@ func (client TopicsClient) DeleteResponder(resp *http.Response) (result autorest // DeleteAuthorizationRule deletes a topic authorization rule. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// topicName is the topic name. authorizationRuleName is the authorizationrule name. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name topicName is the topic name. authorizationRuleName is the authorizationrule name. func (client TopicsClient) DeleteAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -308,7 +308,7 @@ func (client TopicsClient) DeleteAuthorizationRule(ctx context.Context, resource {TargetValue: authorizationRuleName, Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.TopicsClient", "DeleteAuthorizationRule") + return result, validation.NewError("servicebus.TopicsClient", "DeleteAuthorizationRule", err.Error()) } req, err := client.DeleteAuthorizationRulePreparer(ctx, resourceGroupName, namespaceName, topicName, authorizationRuleName) @@ -376,8 +376,8 @@ func (client TopicsClient) DeleteAuthorizationRuleResponder(resp *http.Response) // Get returns a description for the specified topic. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// topicName is the topic name. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name topicName is the topic name. func (client TopicsClient) Get(ctx context.Context, resourceGroupName string, namespaceName string, topicName string) (result SBTopic, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -388,7 +388,7 @@ func (client TopicsClient) Get(ctx context.Context, resourceGroupName string, na {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: topicName, Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.TopicsClient", "Get") + return result, validation.NewError("servicebus.TopicsClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, namespaceName, topicName) @@ -456,8 +456,8 @@ func (client TopicsClient) GetResponder(resp *http.Response) (result SBTopic, er // GetAuthorizationRule returns the specified authorization rule. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// topicName is the topic name. authorizationRuleName is the authorizationrule name. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name topicName is the topic name. authorizationRuleName is the authorizationrule name. func (client TopicsClient) GetAuthorizationRule(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string) (result SBAuthorizationRule, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -471,7 +471,7 @@ func (client TopicsClient) GetAuthorizationRule(ctx context.Context, resourceGro {TargetValue: authorizationRuleName, Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.TopicsClient", "GetAuthorizationRule") + return result, validation.NewError("servicebus.TopicsClient", "GetAuthorizationRule", err.Error()) } req, err := client.GetAuthorizationRulePreparer(ctx, resourceGroupName, namespaceName, topicName, authorizationRuleName) @@ -540,8 +540,8 @@ func (client TopicsClient) GetAuthorizationRuleResponder(resp *http.Response) (r // ListAuthorizationRules gets authorization rules for a topic. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// topicName is the topic name. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name topicName is the topic name. func (client TopicsClient) ListAuthorizationRules(ctx context.Context, resourceGroupName string, namespaceName string, topicName string) (result SBAuthorizationRuleListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -552,7 +552,7 @@ func (client TopicsClient) ListAuthorizationRules(ctx context.Context, resourceG {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, {TargetValue: topicName, Constraints: []validation.Constraint{{Target: "topicName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.TopicsClient", "ListAuthorizationRules") + return result, validation.NewError("servicebus.TopicsClient", "ListAuthorizationRules", err.Error()) } result.fn = client.listAuthorizationRulesNextResults @@ -648,7 +648,8 @@ func (client TopicsClient) ListAuthorizationRulesComplete(ctx context.Context, r // ListByNamespace gets all the topics in a namespace. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name func (client TopicsClient) ListByNamespace(ctx context.Context, resourceGroupName string, namespaceName string) (result SBTopicListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -657,7 +658,7 @@ func (client TopicsClient) ListByNamespace(ctx context.Context, resourceGroupNam {TargetValue: namespaceName, Constraints: []validation.Constraint{{Target: "namespaceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "namespaceName", Name: validation.MinLength, Rule: 6, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.TopicsClient", "ListByNamespace") + return result, validation.NewError("servicebus.TopicsClient", "ListByNamespace", err.Error()) } result.fn = client.listByNamespaceNextResults @@ -752,8 +753,8 @@ func (client TopicsClient) ListByNamespaceComplete(ctx context.Context, resource // ListKeys gets the primary and secondary connection strings for the topic. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// topicName is the topic name. authorizationRuleName is the authorizationrule name. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name topicName is the topic name. authorizationRuleName is the authorizationrule name. func (client TopicsClient) ListKeys(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string) (result AccessKeys, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -767,7 +768,7 @@ func (client TopicsClient) ListKeys(ctx context.Context, resourceGroupName strin {TargetValue: authorizationRuleName, Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.TopicsClient", "ListKeys") + return result, validation.NewError("servicebus.TopicsClient", "ListKeys", err.Error()) } req, err := client.ListKeysPreparer(ctx, resourceGroupName, namespaceName, topicName, authorizationRuleName) @@ -836,9 +837,9 @@ func (client TopicsClient) ListKeysResponder(resp *http.Response) (result Access // RegenerateKeys regenerates primary or secondary connection strings for the topic. // -// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace name -// topicName is the topic name. authorizationRuleName is the authorizationrule name. parameters is parameters supplied -// to regenerate the authorization rule. +// resourceGroupName is name of the Resource group within the Azure subscription. namespaceName is the namespace +// name topicName is the topic name. authorizationRuleName is the authorizationrule name. parameters is parameters +// supplied to regenerate the authorization rule. func (client TopicsClient) RegenerateKeys(ctx context.Context, resourceGroupName string, namespaceName string, topicName string, authorizationRuleName string, parameters RegenerateAccessKeyParameters) (result AccessKeys, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -852,7 +853,7 @@ func (client TopicsClient) RegenerateKeys(ctx context.Context, resourceGroupName {TargetValue: authorizationRuleName, Constraints: []validation.Constraint{{Target: "authorizationRuleName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "authorizationRuleName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "servicebus.TopicsClient", "RegenerateKeys") + return result, validation.NewError("servicebus.TopicsClient", "RegenerateKeys", err.Error()) } req, err := client.RegenerateKeysPreparer(ctx, resourceGroupName, namespaceName, topicName, authorizationRuleName, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/version.go index a6ab7215117d..f9c6735b2807 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus/version.go @@ -1,5 +1,7 @@ package servicebus +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package servicebus // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta services" + return "Azure-SDK-For-Go/" + version.Number + " servicebus/2017-04-01" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/backuplongtermretentionpolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/backuplongtermretentionpolicies.go index ce724bad1693..0460e4ed5451 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/backuplongtermretentionpolicies.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/backuplongtermretentionpolicies.go @@ -45,19 +45,18 @@ func NewBackupLongTermRetentionPoliciesClientWithBaseURI(baseURI string, subscri // CreateOrUpdate creates or updates a database backup long term retention policy // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database backupLongTermRetentionPolicyName is the name of the backup long term retention policy parameters is the -// required parameters to update a backup long term retention policy -func (client BackupLongTermRetentionPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, backupLongTermRetentionPolicyName string, parameters BackupLongTermRetentionPolicy) (result BackupLongTermRetentionPoliciesCreateOrUpdateFuture, err error) { +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database parameters is the required parameters to update a backup long term retention policy +func (client BackupLongTermRetentionPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters BackupLongTermRetentionPolicy) (result BackupLongTermRetentionPoliciesCreateOrUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.BackupLongTermRetentionPolicyProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.BackupLongTermRetentionPolicyProperties.RecoveryServicesBackupPolicyResourceID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "sql.BackupLongTermRetentionPoliciesClient", "CreateOrUpdate") + return result, validation.NewError("sql.BackupLongTermRetentionPoliciesClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, backupLongTermRetentionPolicyName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -73,9 +72,9 @@ func (client BackupLongTermRetentionPoliciesClient) CreateOrUpdate(ctx context.C } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client BackupLongTermRetentionPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, backupLongTermRetentionPolicyName string, parameters BackupLongTermRetentionPolicy) (*http.Request, error) { +func (client BackupLongTermRetentionPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters BackupLongTermRetentionPolicy) (*http.Request, error) { pathParameters := map[string]interface{}{ - "backupLongTermRetentionPolicyName": autorest.Encode("path", backupLongTermRetentionPolicyName), + "backupLongTermRetentionPolicyName": autorest.Encode("path", "Default"), "databaseName": autorest.Encode("path", databaseName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serverName": autorest.Encode("path", serverName), @@ -127,11 +126,11 @@ func (client BackupLongTermRetentionPoliciesClient) CreateOrUpdateResponder(resp // Get returns a database backup long term retention policy // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database. backupLongTermRetentionPolicyName is the name of the backup long term retention policy -func (client BackupLongTermRetentionPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, backupLongTermRetentionPolicyName string) (result BackupLongTermRetentionPolicy, err error) { - req, err := client.GetPreparer(ctx, resourceGroupName, serverName, databaseName, backupLongTermRetentionPolicyName) +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database. +func (client BackupLongTermRetentionPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result BackupLongTermRetentionPolicy, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, serverName, databaseName) if err != nil { err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionPoliciesClient", "Get", nil, "Failure preparing request") return @@ -153,9 +152,9 @@ func (client BackupLongTermRetentionPoliciesClient) Get(ctx context.Context, res } // GetPreparer prepares the Get request. -func (client BackupLongTermRetentionPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, backupLongTermRetentionPolicyName string) (*http.Request, error) { +func (client BackupLongTermRetentionPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "backupLongTermRetentionPolicyName": autorest.Encode("path", backupLongTermRetentionPolicyName), + "backupLongTermRetentionPolicyName": autorest.Encode("path", "Default"), "databaseName": autorest.Encode("path", databaseName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serverName": autorest.Encode("path", serverName), @@ -197,9 +196,9 @@ func (client BackupLongTermRetentionPoliciesClient) GetResponder(resp *http.Resp // ListByDatabase returns a database backup long term retention policy // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database. func (client BackupLongTermRetentionPoliciesClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result BackupLongTermRetentionPolicyListResult, err error) { req, err := client.ListByDatabasePreparer(ctx, resourceGroupName, serverName, databaseName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/backuplongtermretentionvaults.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/backuplongtermretentionvaults.go index 5fc0996b13d2..b85c4d5bfc73 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/backuplongtermretentionvaults.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/backuplongtermretentionvaults.go @@ -45,19 +45,18 @@ func NewBackupLongTermRetentionVaultsClientWithBaseURI(baseURI string, subscript // CreateOrUpdate updates a server backup long term retention vault // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. backupLongTermRetentionVaultName is -// the name of the backup long term retention vault parameters is the required parameters to update a backup long term -// retention vault -func (client BackupLongTermRetentionVaultsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, backupLongTermRetentionVaultName string, parameters BackupLongTermRetentionVault) (result BackupLongTermRetentionVaultsCreateOrUpdateFuture, err error) { +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. parameters is the required +// parameters to update a backup long term retention vault +func (client BackupLongTermRetentionVaultsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters BackupLongTermRetentionVault) (result BackupLongTermRetentionVaultsCreateOrUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.BackupLongTermRetentionVaultProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.BackupLongTermRetentionVaultProperties.RecoveryServicesVaultResourceID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "sql.BackupLongTermRetentionVaultsClient", "CreateOrUpdate") + return result, validation.NewError("sql.BackupLongTermRetentionVaultsClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, backupLongTermRetentionVaultName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionVaultsClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -73,9 +72,9 @@ func (client BackupLongTermRetentionVaultsClient) CreateOrUpdate(ctx context.Con } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client BackupLongTermRetentionVaultsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, backupLongTermRetentionVaultName string, parameters BackupLongTermRetentionVault) (*http.Request, error) { +func (client BackupLongTermRetentionVaultsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, parameters BackupLongTermRetentionVault) (*http.Request, error) { pathParameters := map[string]interface{}{ - "backupLongTermRetentionVaultName": autorest.Encode("path", backupLongTermRetentionVaultName), + "backupLongTermRetentionVaultName": autorest.Encode("path", "RegisteredVault"), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -126,11 +125,10 @@ func (client BackupLongTermRetentionVaultsClient) CreateOrUpdateResponder(resp * // Get gets a server backup long term retention vault // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. backupLongTermRetentionVaultName is -// the name of the Azure SQL Server backup LongTermRetention vault -func (client BackupLongTermRetentionVaultsClient) Get(ctx context.Context, resourceGroupName string, serverName string, backupLongTermRetentionVaultName string) (result BackupLongTermRetentionVault, err error) { - req, err := client.GetPreparer(ctx, resourceGroupName, serverName, backupLongTermRetentionVaultName) +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. +func (client BackupLongTermRetentionVaultsClient) Get(ctx context.Context, resourceGroupName string, serverName string) (result BackupLongTermRetentionVault, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, serverName) if err != nil { err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionVaultsClient", "Get", nil, "Failure preparing request") return @@ -152,9 +150,9 @@ func (client BackupLongTermRetentionVaultsClient) Get(ctx context.Context, resou } // GetPreparer prepares the Get request. -func (client BackupLongTermRetentionVaultsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, backupLongTermRetentionVaultName string) (*http.Request, error) { +func (client BackupLongTermRetentionVaultsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "backupLongTermRetentionVaultName": autorest.Encode("path", backupLongTermRetentionVaultName), + "backupLongTermRetentionVaultName": autorest.Encode("path", "RegisteredVault"), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -195,8 +193,8 @@ func (client BackupLongTermRetentionVaultsClient) GetResponder(resp *http.Respon // ListByServer gets server backup long term retention vaults in a server // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. func (client BackupLongTermRetentionVaultsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result BackupLongTermRetentionVaultListResult, err error) { req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/databaseblobauditingpolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/databaseblobauditingpolicies.go index 4069ae7692c6..7354545df042 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/databaseblobauditingpolicies.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/databaseblobauditingpolicies.go @@ -44,12 +44,12 @@ func NewDatabaseBlobAuditingPoliciesClientWithBaseURI(baseURI string, subscripti // CreateOrUpdate creates or updates a database's blob auditing policy. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database for which the blob auditing policy will be defined. blobAuditingPolicyName is the name of the blob auditing -// policy. parameters is the database blob auditing policy. -func (client DatabaseBlobAuditingPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, blobAuditingPolicyName string, parameters DatabaseBlobAuditingPolicy) (result DatabaseBlobAuditingPolicy, err error) { - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, blobAuditingPolicyName, parameters) +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database for which the blob auditing policy will be defined. parameters is the database blob auditing +// policy. +func (client DatabaseBlobAuditingPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DatabaseBlobAuditingPolicy) (result DatabaseBlobAuditingPolicy, err error) { + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "sql.DatabaseBlobAuditingPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -71,9 +71,9 @@ func (client DatabaseBlobAuditingPoliciesClient) CreateOrUpdate(ctx context.Cont } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DatabaseBlobAuditingPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, blobAuditingPolicyName string, parameters DatabaseBlobAuditingPolicy) (*http.Request, error) { +func (client DatabaseBlobAuditingPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DatabaseBlobAuditingPolicy) (*http.Request, error) { pathParameters := map[string]interface{}{ - "blobAuditingPolicyName": autorest.Encode("path", blobAuditingPolicyName), + "blobAuditingPolicyName": autorest.Encode("path", "default"), "databaseName": autorest.Encode("path", databaseName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serverName": autorest.Encode("path", serverName), @@ -117,11 +117,11 @@ func (client DatabaseBlobAuditingPoliciesClient) CreateOrUpdateResponder(resp *h // Get gets a database's blob auditing policy. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database for which the blob audit policy is defined. blobAuditingPolicyName is the name of the blob auditing policy. -func (client DatabaseBlobAuditingPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, blobAuditingPolicyName string) (result DatabaseBlobAuditingPolicy, err error) { - req, err := client.GetPreparer(ctx, resourceGroupName, serverName, databaseName, blobAuditingPolicyName) +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database for which the blob audit policy is defined. +func (client DatabaseBlobAuditingPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DatabaseBlobAuditingPolicy, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, serverName, databaseName) if err != nil { err = autorest.NewErrorWithError(err, "sql.DatabaseBlobAuditingPoliciesClient", "Get", nil, "Failure preparing request") return @@ -143,9 +143,9 @@ func (client DatabaseBlobAuditingPoliciesClient) Get(ctx context.Context, resour } // GetPreparer prepares the Get request. -func (client DatabaseBlobAuditingPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, blobAuditingPolicyName string) (*http.Request, error) { +func (client DatabaseBlobAuditingPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "blobAuditingPolicyName": autorest.Encode("path", blobAuditingPolicyName), + "blobAuditingPolicyName": autorest.Encode("path", "default"), "databaseName": autorest.Encode("path", databaseName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serverName": autorest.Encode("path", serverName), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/databases.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/databases.go index f6dbab180c29..dd0b7b0967c2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/databases.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/databases.go @@ -45,19 +45,18 @@ func NewDatabasesClientWithBaseURI(baseURI string, subscriptionID string) Databa // CreateImportOperation creates an import operation that imports a bacpac into an existing database. The existing // database must be empty. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database to import into extensionName is the name of the operation to perform parameters is the required parameters -// for importing a Bacpac into a database. -func (client DatabasesClient) CreateImportOperation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, extensionName string, parameters ImportExtensionRequest) (result DatabasesCreateImportOperationFuture, err error) { +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database to import into parameters is the required parameters for importing a Bacpac into a database. +func (client DatabasesClient) CreateImportOperation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters ImportExtensionRequest) (result DatabasesCreateImportOperationFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.ImportExtensionProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.ImportExtensionProperties.OperationMode", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "sql.DatabasesClient", "CreateImportOperation") + return result, validation.NewError("sql.DatabasesClient", "CreateImportOperation", err.Error()) } - req, err := client.CreateImportOperationPreparer(ctx, resourceGroupName, serverName, databaseName, extensionName, parameters) + req, err := client.CreateImportOperationPreparer(ctx, resourceGroupName, serverName, databaseName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "CreateImportOperation", nil, "Failure preparing request") return @@ -73,10 +72,10 @@ func (client DatabasesClient) CreateImportOperation(ctx context.Context, resourc } // CreateImportOperationPreparer prepares the CreateImportOperation request. -func (client DatabasesClient) CreateImportOperationPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, extensionName string, parameters ImportExtensionRequest) (*http.Request, error) { +func (client DatabasesClient) CreateImportOperationPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters ImportExtensionRequest) (*http.Request, error) { pathParameters := map[string]interface{}{ "databaseName": autorest.Encode("path", databaseName), - "extensionName": autorest.Encode("path", extensionName), + "extensionName": autorest.Encode("path", "import"), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -127,10 +126,10 @@ func (client DatabasesClient) CreateImportOperationResponder(resp *http.Response // CreateOrUpdate creates a new database or updates an existing database. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database to be operated on (updated or created). parameters is the required parameters for creating or updating a -// database. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database to be operated on (updated or created). parameters is the required parameters for creating or +// updating a database. func (client DatabasesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters Database) (result DatabasesCreateOrUpdateFuture, err error) { req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, parameters) if err != nil { @@ -201,9 +200,9 @@ func (client DatabasesClient) CreateOrUpdateResponder(resp *http.Response) (resu // Delete deletes a database. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database to be deleted. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database to be deleted. func (client DatabasesClient) Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result autorest.Response, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, databaseName) if err != nil { @@ -269,9 +268,9 @@ func (client DatabasesClient) DeleteResponder(resp *http.Response) (result autor // Export exports a database to a bacpac. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database to be exported. parameters is the required parameters for exporting a database. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database to be exported. parameters is the required parameters for exporting a database. func (client DatabasesClient) Export(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters ExportRequest) (result DatabasesExportFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -279,7 +278,7 @@ func (client DatabasesClient) Export(ctx context.Context, resourceGroupName stri {Target: "parameters.StorageURI", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.AdministratorLogin", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.AdministratorLoginPassword", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "sql.DatabasesClient", "Export") + return result, validation.NewError("sql.DatabasesClient", "Export", err.Error()) } req, err := client.ExportPreparer(ctx, resourceGroupName, serverName, databaseName, parameters) @@ -351,10 +350,10 @@ func (client DatabasesClient) ExportResponder(resp *http.Response) (result Impor // Get gets a database. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database to be retrieved. expand is a comma separated list of child objects to expand in the response. Possible -// properties: serviceTierAdvisors, transparentDataEncryption. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database to be retrieved. expand is a comma separated list of child objects to expand in the response. +// Possible properties: serviceTierAdvisors, transparentDataEncryption. func (client DatabasesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, expand string) (result Database, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, serverName, databaseName, expand) if err != nil { @@ -424,9 +423,9 @@ func (client DatabasesClient) GetResponder(resp *http.Response) (result Database // GetByElasticPool gets a database inside of an elastic pool. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. elasticPoolName is the name of the -// elastic pool to be retrieved. databaseName is the name of the database to be retrieved. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. elasticPoolName is the name +// of the elastic pool to be retrieved. databaseName is the name of the database to be retrieved. func (client DatabasesClient) GetByElasticPool(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, databaseName string) (result Database, err error) { req, err := client.GetByElasticPoolPreparer(ctx, resourceGroupName, serverName, elasticPoolName, databaseName) if err != nil { @@ -494,9 +493,9 @@ func (client DatabasesClient) GetByElasticPoolResponder(resp *http.Response) (re // GetByRecommendedElasticPool gets a database inside of a recommented elastic pool. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. recommendedElasticPoolName is the -// name of the elastic pool to be retrieved. databaseName is the name of the database to be retrieved. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. recommendedElasticPoolName +// is the name of the elastic pool to be retrieved. databaseName is the name of the database to be retrieved. func (client DatabasesClient) GetByRecommendedElasticPool(ctx context.Context, resourceGroupName string, serverName string, recommendedElasticPoolName string, databaseName string) (result Database, err error) { req, err := client.GetByRecommendedElasticPoolPreparer(ctx, resourceGroupName, serverName, recommendedElasticPoolName, databaseName) if err != nil { @@ -564,15 +563,15 @@ func (client DatabasesClient) GetByRecommendedElasticPoolResponder(resp *http.Re // Import imports a bacpac into a new database. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. parameters is the required +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. parameters is the required // parameters for importing a Bacpac into a database. func (client DatabasesClient) Import(ctx context.Context, resourceGroupName string, serverName string, parameters ImportRequest) (result DatabasesImportFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.DatabaseName", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.MaxSizeBytes", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "sql.DatabasesClient", "Import") + return result, validation.NewError("sql.DatabasesClient", "Import", err.Error()) } req, err := client.ImportPreparer(ctx, resourceGroupName, serverName, parameters) @@ -643,9 +642,9 @@ func (client DatabasesClient) ImportResponder(resp *http.Response) (result Impor // ListByElasticPool returns a list of databases in an elastic pool. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. elasticPoolName is the name of the -// elastic pool to be retrieved. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. elasticPoolName is the name +// of the elastic pool to be retrieved. func (client DatabasesClient) ListByElasticPool(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result DatabaseListResult, err error) { req, err := client.ListByElasticPoolPreparer(ctx, resourceGroupName, serverName, elasticPoolName) if err != nil { @@ -712,9 +711,9 @@ func (client DatabasesClient) ListByElasticPoolResponder(resp *http.Response) (r // ListByRecommendedElasticPool returns a list of databases inside a recommented elastic pool. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. recommendedElasticPoolName is the -// name of the recommended elastic pool to be retrieved. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. recommendedElasticPoolName +// is the name of the recommended elastic pool to be retrieved. func (client DatabasesClient) ListByRecommendedElasticPool(ctx context.Context, resourceGroupName string, serverName string, recommendedElasticPoolName string) (result DatabaseListResult, err error) { req, err := client.ListByRecommendedElasticPoolPreparer(ctx, resourceGroupName, serverName, recommendedElasticPoolName) if err != nil { @@ -781,10 +780,10 @@ func (client DatabasesClient) ListByRecommendedElasticPoolResponder(resp *http.R // ListByServer returns a list of databases in a server. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. expand is a comma separated list of -// child objects to expand in the response. Possible properties: serviceTierAdvisors, transparentDataEncryption. filter -// is an OData filter expression that describes a subset of databases to return. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. expand is a comma separated +// list of child objects to expand in the response. Possible properties: serviceTierAdvisors, +// transparentDataEncryption. filter is an OData filter expression that describes a subset of databases to return. func (client DatabasesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string, expand string, filter string) (result DatabaseListResult, err error) { req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName, expand, filter) if err != nil { @@ -856,9 +855,9 @@ func (client DatabasesClient) ListByServerResponder(resp *http.Response) (result // ListMetricDefinitions returns database metric definitions. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database. func (client DatabasesClient) ListMetricDefinitions(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result MetricDefinitionListResult, err error) { req, err := client.ListMetricDefinitionsPreparer(ctx, resourceGroupName, serverName, databaseName) if err != nil { @@ -925,9 +924,9 @@ func (client DatabasesClient) ListMetricDefinitionsResponder(resp *http.Response // ListMetrics returns database metrics. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database. filter is an OData filter expression that describes a subset of metrics to return. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database. filter is an OData filter expression that describes a subset of metrics to return. func (client DatabasesClient) ListMetrics(ctx context.Context, resourceGroupName string, serverName string, databaseName string, filter string) (result MetricListResult, err error) { req, err := client.ListMetricsPreparer(ctx, resourceGroupName, serverName, databaseName, filter) if err != nil { @@ -995,9 +994,9 @@ func (client DatabasesClient) ListMetricsResponder(resp *http.Response) (result // Pause pauses a data warehouse. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the data -// warehouse to pause. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the data warehouse to pause. func (client DatabasesClient) Pause(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DatabasesPauseFuture, err error) { req, err := client.PausePreparer(ctx, resourceGroupName, serverName, databaseName) if err != nil { @@ -1065,9 +1064,9 @@ func (client DatabasesClient) PauseResponder(resp *http.Response) (result autore // Resume resumes a data warehouse. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the data -// warehouse to resume. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the data warehouse to resume. func (client DatabasesClient) Resume(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DatabasesResumeFuture, err error) { req, err := client.ResumePreparer(ctx, resourceGroupName, serverName, databaseName) if err != nil { @@ -1135,9 +1134,9 @@ func (client DatabasesClient) ResumeResponder(resp *http.Response) (result autor // Update updates an existing database. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database to be updated. parameters is the required parameters for updating a database. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database to be updated. parameters is the required parameters for updating a database. func (client DatabasesClient) Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DatabaseUpdate) (result DatabasesUpdateFuture, err error) { req, err := client.UpdatePreparer(ctx, resourceGroupName, serverName, databaseName, parameters) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/databasethreatdetectionpolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/databasethreatdetectionpolicies.go index 3a9b5f882323..44612e04ac90 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/databasethreatdetectionpolicies.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/databasethreatdetectionpolicies.go @@ -44,12 +44,12 @@ func NewDatabaseThreatDetectionPoliciesClientWithBaseURI(baseURI string, subscri // CreateOrUpdate creates or updates a database's threat detection policy. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database for which database Threat Detection policy is defined. securityAlertPolicyName is the name of the security -// alert policy. parameters is the database Threat Detection policy. -func (client DatabaseThreatDetectionPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, securityAlertPolicyName string, parameters DatabaseSecurityAlertPolicy) (result DatabaseSecurityAlertPolicy, err error) { - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, securityAlertPolicyName, parameters) +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database for which database Threat Detection policy is defined. parameters is the database Threat Detection +// policy. +func (client DatabaseThreatDetectionPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DatabaseSecurityAlertPolicy) (result DatabaseSecurityAlertPolicy, err error) { + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "sql.DatabaseThreatDetectionPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -71,11 +71,11 @@ func (client DatabaseThreatDetectionPoliciesClient) CreateOrUpdate(ctx context.C } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DatabaseThreatDetectionPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, securityAlertPolicyName string, parameters DatabaseSecurityAlertPolicy) (*http.Request, error) { +func (client DatabaseThreatDetectionPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DatabaseSecurityAlertPolicy) (*http.Request, error) { pathParameters := map[string]interface{}{ "databaseName": autorest.Encode("path", databaseName), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "securityAlertPolicyName": autorest.Encode("path", securityAlertPolicyName), + "securityAlertPolicyName": autorest.Encode("path", "default"), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -117,12 +117,11 @@ func (client DatabaseThreatDetectionPoliciesClient) CreateOrUpdateResponder(resp // Get gets a database's threat detection policy. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database for which database Threat Detection policy is defined. securityAlertPolicyName is the name of the security -// alert policy. -func (client DatabaseThreatDetectionPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, securityAlertPolicyName string) (result DatabaseSecurityAlertPolicy, err error) { - req, err := client.GetPreparer(ctx, resourceGroupName, serverName, databaseName, securityAlertPolicyName) +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database for which database Threat Detection policy is defined. +func (client DatabaseThreatDetectionPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DatabaseSecurityAlertPolicy, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, serverName, databaseName) if err != nil { err = autorest.NewErrorWithError(err, "sql.DatabaseThreatDetectionPoliciesClient", "Get", nil, "Failure preparing request") return @@ -144,11 +143,11 @@ func (client DatabaseThreatDetectionPoliciesClient) Get(ctx context.Context, res } // GetPreparer prepares the Get request. -func (client DatabaseThreatDetectionPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, securityAlertPolicyName string) (*http.Request, error) { +func (client DatabaseThreatDetectionPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "databaseName": autorest.Encode("path", databaseName), "resourceGroupName": autorest.Encode("path", resourceGroupName), - "securityAlertPolicyName": autorest.Encode("path", securityAlertPolicyName), + "securityAlertPolicyName": autorest.Encode("path", "default"), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/databaseusages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/databaseusages.go index b890c81ecdfb..2d531bfa202a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/databaseusages.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/databaseusages.go @@ -43,9 +43,9 @@ func NewDatabaseUsagesClientWithBaseURI(baseURI string, subscriptionID string) D // ListByDatabase returns database usages. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database. func (client DatabaseUsagesClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DatabaseUsageListResult, err error) { req, err := client.ListByDatabasePreparer(ctx, resourceGroupName, serverName, databaseName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/datamaskingpolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/datamaskingpolicies.go index 12e5043bd130..daa9c81420eb 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/datamaskingpolicies.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/datamaskingpolicies.go @@ -43,12 +43,11 @@ func NewDataMaskingPoliciesClientWithBaseURI(baseURI string, subscriptionID stri // CreateOrUpdate creates or updates a database data masking policy // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database. dataMaskingPolicyName is the name of the database for which the data masking rule applies. parameters is -// parameters for creating or updating a data masking policy. -func (client DataMaskingPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingPolicyName string, parameters DataMaskingPolicy) (result DataMaskingPolicy, err error) { - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, dataMaskingPolicyName, parameters) +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database. parameters is parameters for creating or updating a data masking policy. +func (client DataMaskingPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DataMaskingPolicy) (result DataMaskingPolicy, err error) { + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "sql.DataMaskingPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -70,10 +69,10 @@ func (client DataMaskingPoliciesClient) CreateOrUpdate(ctx context.Context, reso } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DataMaskingPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingPolicyName string, parameters DataMaskingPolicy) (*http.Request, error) { +func (client DataMaskingPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DataMaskingPolicy) (*http.Request, error) { pathParameters := map[string]interface{}{ "databaseName": autorest.Encode("path", databaseName), - "dataMaskingPolicyName": autorest.Encode("path", dataMaskingPolicyName), + "dataMaskingPolicyName": autorest.Encode("path", "Default"), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -116,11 +115,11 @@ func (client DataMaskingPoliciesClient) CreateOrUpdateResponder(resp *http.Respo // Get gets a database data masking policy. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database. dataMaskingPolicyName is the name of the database for which the data masking rule applies. -func (client DataMaskingPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingPolicyName string) (result DataMaskingPolicy, err error) { - req, err := client.GetPreparer(ctx, resourceGroupName, serverName, databaseName, dataMaskingPolicyName) +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database. +func (client DataMaskingPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DataMaskingPolicy, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, serverName, databaseName) if err != nil { err = autorest.NewErrorWithError(err, "sql.DataMaskingPoliciesClient", "Get", nil, "Failure preparing request") return @@ -142,10 +141,10 @@ func (client DataMaskingPoliciesClient) Get(ctx context.Context, resourceGroupNa } // GetPreparer prepares the Get request. -func (client DataMaskingPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingPolicyName string) (*http.Request, error) { +func (client DataMaskingPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "databaseName": autorest.Encode("path", databaseName), - "dataMaskingPolicyName": autorest.Encode("path", dataMaskingPolicyName), + "dataMaskingPolicyName": autorest.Encode("path", "Default"), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/datamaskingrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/datamaskingrules.go index e8301a4b2f96..bf8c621a2c2c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/datamaskingrules.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/datamaskingrules.go @@ -44,12 +44,11 @@ func NewDataMaskingRulesClientWithBaseURI(baseURI string, subscriptionID string) // CreateOrUpdate creates or updates a database data masking rule. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database. dataMaskingPolicyName is the name of the database for which the data masking rule applies. -// dataMaskingRuleName is the name of the data masking rule. parameters is the required parameters for creating or -// updating a data masking rule. -func (client DataMaskingRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingPolicyName string, dataMaskingRuleName string, parameters DataMaskingRule) (result DataMaskingRule, err error) { +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database. dataMaskingRuleName is the name of the data masking rule. parameters is the required parameters +// for creating or updating a data masking rule. +func (client DataMaskingRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingRuleName string, parameters DataMaskingRule) (result DataMaskingRule, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.DataMaskingRuleProperties", Name: validation.Null, Rule: false, @@ -57,10 +56,10 @@ func (client DataMaskingRulesClient) CreateOrUpdate(ctx context.Context, resourc {Target: "parameters.DataMaskingRuleProperties.TableName", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.DataMaskingRuleProperties.ColumnName", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "sql.DataMaskingRulesClient", "CreateOrUpdate") + return result, validation.NewError("sql.DataMaskingRulesClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, dataMaskingPolicyName, dataMaskingRuleName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, dataMaskingRuleName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "sql.DataMaskingRulesClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -82,10 +81,10 @@ func (client DataMaskingRulesClient) CreateOrUpdate(ctx context.Context, resourc } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DataMaskingRulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingPolicyName string, dataMaskingRuleName string, parameters DataMaskingRule) (*http.Request, error) { +func (client DataMaskingRulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingRuleName string, parameters DataMaskingRule) (*http.Request, error) { pathParameters := map[string]interface{}{ "databaseName": autorest.Encode("path", databaseName), - "dataMaskingPolicyName": autorest.Encode("path", dataMaskingPolicyName), + "dataMaskingPolicyName": autorest.Encode("path", "Default"), "dataMaskingRuleName": autorest.Encode("path", dataMaskingRuleName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serverName": autorest.Encode("path", serverName), @@ -129,11 +128,11 @@ func (client DataMaskingRulesClient) CreateOrUpdateResponder(resp *http.Response // ListByDatabase gets a list of database data masking rules. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database. dataMaskingPolicyName is the name of the database for which the data masking rule applies. -func (client DataMaskingRulesClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingPolicyName string) (result DataMaskingRuleListResult, err error) { - req, err := client.ListByDatabasePreparer(ctx, resourceGroupName, serverName, databaseName, dataMaskingPolicyName) +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database. +func (client DataMaskingRulesClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DataMaskingRuleListResult, err error) { + req, err := client.ListByDatabasePreparer(ctx, resourceGroupName, serverName, databaseName) if err != nil { err = autorest.NewErrorWithError(err, "sql.DataMaskingRulesClient", "ListByDatabase", nil, "Failure preparing request") return @@ -155,10 +154,10 @@ func (client DataMaskingRulesClient) ListByDatabase(ctx context.Context, resourc } // ListByDatabasePreparer prepares the ListByDatabase request. -func (client DataMaskingRulesClient) ListByDatabasePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingPolicyName string) (*http.Request, error) { +func (client DataMaskingRulesClient) ListByDatabasePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "databaseName": autorest.Encode("path", databaseName), - "dataMaskingPolicyName": autorest.Encode("path", dataMaskingPolicyName), + "dataMaskingPolicyName": autorest.Encode("path", "Default"), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/elasticpoolactivities.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/elasticpoolactivities.go index 3ded5a4eb669..207c81fcc0b2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/elasticpoolactivities.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/elasticpoolactivities.go @@ -43,9 +43,9 @@ func NewElasticPoolActivitiesClientWithBaseURI(baseURI string, subscriptionID st // ListByElasticPool returns elastic pool activities. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. elasticPoolName is the name of the -// elastic pool for which to get the current activity. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. elasticPoolName is the name +// of the elastic pool for which to get the current activity. func (client ElasticPoolActivitiesClient) ListByElasticPool(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result ElasticPoolActivityListResult, err error) { req, err := client.ListByElasticPoolPreparer(ctx, resourceGroupName, serverName, elasticPoolName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/elasticpooldatabaseactivities.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/elasticpooldatabaseactivities.go index 17a4e476dc6c..ce30d93c6839 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/elasticpooldatabaseactivities.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/elasticpooldatabaseactivities.go @@ -44,9 +44,9 @@ func NewElasticPoolDatabaseActivitiesClientWithBaseURI(baseURI string, subscript // ListByElasticPool returns activity on databases inside of an elastic pool. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. elasticPoolName is the name of the -// elastic pool. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. elasticPoolName is the name +// of the elastic pool. func (client ElasticPoolDatabaseActivitiesClient) ListByElasticPool(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result ElasticPoolDatabaseActivityListResult, err error) { req, err := client.ListByElasticPoolPreparer(ctx, resourceGroupName, serverName, elasticPoolName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/elasticpools.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/elasticpools.go index 1085578315cd..346b129a74a1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/elasticpools.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/elasticpools.go @@ -43,10 +43,10 @@ func NewElasticPoolsClientWithBaseURI(baseURI string, subscriptionID string) Ela // CreateOrUpdate creates a new elastic pool or updates an existing elastic pool. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. elasticPoolName is the name of the -// elastic pool to be operated on (updated or created). parameters is the required parameters for creating or updating -// an elastic pool. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. elasticPoolName is the name +// of the elastic pool to be operated on (updated or created). parameters is the required parameters for creating +// or updating an elastic pool. func (client ElasticPoolsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, parameters ElasticPool) (result ElasticPoolsCreateOrUpdateFuture, err error) { req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, elasticPoolName, parameters) if err != nil { @@ -117,9 +117,9 @@ func (client ElasticPoolsClient) CreateOrUpdateResponder(resp *http.Response) (r // Delete deletes the elastic pool. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. elasticPoolName is the name of the -// elastic pool to be deleted. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. elasticPoolName is the name +// of the elastic pool to be deleted. func (client ElasticPoolsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result autorest.Response, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, elasticPoolName) if err != nil { @@ -185,9 +185,9 @@ func (client ElasticPoolsClient) DeleteResponder(resp *http.Response) (result au // Get gets an elastic pool. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. elasticPoolName is the name of the -// elastic pool to be retrieved. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. elasticPoolName is the name +// of the elastic pool to be retrieved. func (client ElasticPoolsClient) Get(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result ElasticPool, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, serverName, elasticPoolName) if err != nil { @@ -254,8 +254,8 @@ func (client ElasticPoolsClient) GetResponder(resp *http.Response) (result Elast // ListByServer returns a list of elastic pools in a server. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. func (client ElasticPoolsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result ElasticPoolListResult, err error) { req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) if err != nil { @@ -321,9 +321,9 @@ func (client ElasticPoolsClient) ListByServerResponder(resp *http.Response) (res // ListMetricDefinitions returns elastic pool metric definitions. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. elasticPoolName is the name of the -// elastic pool. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. elasticPoolName is the name +// of the elastic pool. func (client ElasticPoolsClient) ListMetricDefinitions(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string) (result MetricDefinitionListResult, err error) { req, err := client.ListMetricDefinitionsPreparer(ctx, resourceGroupName, serverName, elasticPoolName) if err != nil { @@ -390,9 +390,9 @@ func (client ElasticPoolsClient) ListMetricDefinitionsResponder(resp *http.Respo // ListMetrics returns elastic pool metrics. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. elasticPoolName is the name of the -// elastic pool. filter is an OData filter expression that describes a subset of metrics to return. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. elasticPoolName is the name +// of the elastic pool. filter is an OData filter expression that describes a subset of metrics to return. func (client ElasticPoolsClient) ListMetrics(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, filter string) (result MetricListResult, err error) { req, err := client.ListMetricsPreparer(ctx, resourceGroupName, serverName, elasticPoolName, filter) if err != nil { @@ -460,9 +460,9 @@ func (client ElasticPoolsClient) ListMetricsResponder(resp *http.Response) (resu // Update updates an existing elastic pool. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. elasticPoolName is the name of the -// elastic pool to be updated. parameters is the required parameters for updating an elastic pool. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. elasticPoolName is the name +// of the elastic pool to be updated. parameters is the required parameters for updating an elastic pool. func (client ElasticPoolsClient) Update(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, parameters ElasticPoolUpdate) (result ElasticPoolsUpdateFuture, err error) { req, err := client.UpdatePreparer(ctx, resourceGroupName, serverName, elasticPoolName, parameters) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/encryptionprotectors.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/encryptionprotectors.go index e92d75304872..04f006862648 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/encryptionprotectors.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/encryptionprotectors.go @@ -43,11 +43,11 @@ func NewEncryptionProtectorsClientWithBaseURI(baseURI string, subscriptionID str // CreateOrUpdate updates an existing encryption protector. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. encryptionProtectorName is the name -// of the encryption protector to be updated. parameters is the requested encryption protector resource state. -func (client EncryptionProtectorsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, encryptionProtectorName string, parameters EncryptionProtector) (result EncryptionProtectorsCreateOrUpdateFuture, err error) { - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, encryptionProtectorName, parameters) +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. parameters is the requested +// encryption protector resource state. +func (client EncryptionProtectorsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters EncryptionProtector) (result EncryptionProtectorsCreateOrUpdateFuture, err error) { + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -63,9 +63,9 @@ func (client EncryptionProtectorsClient) CreateOrUpdate(ctx context.Context, res } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client EncryptionProtectorsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, encryptionProtectorName string, parameters EncryptionProtector) (*http.Request, error) { +func (client EncryptionProtectorsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, parameters EncryptionProtector) (*http.Request, error) { pathParameters := map[string]interface{}{ - "encryptionProtectorName": autorest.Encode("path", encryptionProtectorName), + "encryptionProtectorName": autorest.Encode("path", "current"), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -116,11 +116,10 @@ func (client EncryptionProtectorsClient) CreateOrUpdateResponder(resp *http.Resp // Get gets a server encryption protector. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. encryptionProtectorName is the name -// of the encryption protector to be retrieved. -func (client EncryptionProtectorsClient) Get(ctx context.Context, resourceGroupName string, serverName string, encryptionProtectorName string) (result EncryptionProtector, err error) { - req, err := client.GetPreparer(ctx, resourceGroupName, serverName, encryptionProtectorName) +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. +func (client EncryptionProtectorsClient) Get(ctx context.Context, resourceGroupName string, serverName string) (result EncryptionProtector, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, serverName) if err != nil { err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsClient", "Get", nil, "Failure preparing request") return @@ -142,9 +141,9 @@ func (client EncryptionProtectorsClient) Get(ctx context.Context, resourceGroupN } // GetPreparer prepares the Get request. -func (client EncryptionProtectorsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, encryptionProtectorName string) (*http.Request, error) { +func (client EncryptionProtectorsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "encryptionProtectorName": autorest.Encode("path", encryptionProtectorName), + "encryptionProtectorName": autorest.Encode("path", "current"), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -185,8 +184,8 @@ func (client EncryptionProtectorsClient) GetResponder(resp *http.Response) (resu // ListByServer gets a list of server encryption protectors // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. func (client EncryptionProtectorsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result EncryptionProtectorListResultPage, err error) { result.fn = client.listByServerNextResults req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/failovergroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/failovergroups.go index 0e2fc81a524b..2dedd9309226 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/failovergroups.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/failovergroups.go @@ -44,9 +44,9 @@ func NewFailoverGroupsClientWithBaseURI(baseURI string, subscriptionID string) F // CreateOrUpdate creates or updates a failover group. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server containing the failover group. -// failoverGroupName is the name of the failover group. parameters is the failover group parameters. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server containing the failover +// group. failoverGroupName is the name of the failover group. parameters is the failover group parameters. func (client FailoverGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, parameters FailoverGroup) (result FailoverGroupsCreateOrUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -54,7 +54,7 @@ func (client FailoverGroupsClient) CreateOrUpdate(ctx context.Context, resourceG Chain: []validation.Constraint{{Target: "parameters.FailoverGroupProperties.ReadWriteEndpoint", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.FailoverGroupProperties.PartnerServers", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "sql.FailoverGroupsClient", "CreateOrUpdate") + return result, validation.NewError("sql.FailoverGroupsClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, failoverGroupName, parameters) @@ -126,9 +126,9 @@ func (client FailoverGroupsClient) CreateOrUpdateResponder(resp *http.Response) // Delete deletes a failover group. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server containing the failover group. -// failoverGroupName is the name of the failover group. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server containing the failover +// group. failoverGroupName is the name of the failover group. func (client FailoverGroupsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string) (result FailoverGroupsDeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, failoverGroupName) if err != nil { @@ -196,9 +196,9 @@ func (client FailoverGroupsClient) DeleteResponder(resp *http.Response) (result // Failover fails over from the current primary server to this server. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server containing the failover group. -// failoverGroupName is the name of the failover group. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server containing the failover +// group. failoverGroupName is the name of the failover group. func (client FailoverGroupsClient) Failover(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string) (result FailoverGroupsFailoverFuture, err error) { req, err := client.FailoverPreparer(ctx, resourceGroupName, serverName, failoverGroupName) if err != nil { @@ -268,9 +268,9 @@ func (client FailoverGroupsClient) FailoverResponder(resp *http.Response) (resul // ForceFailoverAllowDataLoss fails over from the current primary server to this server. This operation might result in // data loss. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server containing the failover group. -// failoverGroupName is the name of the failover group. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server containing the failover +// group. failoverGroupName is the name of the failover group. func (client FailoverGroupsClient) ForceFailoverAllowDataLoss(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string) (result FailoverGroupsForceFailoverAllowDataLossFuture, err error) { req, err := client.ForceFailoverAllowDataLossPreparer(ctx, resourceGroupName, serverName, failoverGroupName) if err != nil { @@ -339,9 +339,9 @@ func (client FailoverGroupsClient) ForceFailoverAllowDataLossResponder(resp *htt // Get gets a failover group. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server containing the failover group. -// failoverGroupName is the name of the failover group. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server containing the failover +// group. failoverGroupName is the name of the failover group. func (client FailoverGroupsClient) Get(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string) (result FailoverGroup, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, serverName, failoverGroupName) if err != nil { @@ -408,8 +408,9 @@ func (client FailoverGroupsClient) GetResponder(resp *http.Response) (result Fai // ListByServer lists the failover groups in a server. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server containing the failover group. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server containing the failover +// group. func (client FailoverGroupsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result FailoverGroupListResultPage, err error) { result.fn = client.listByServerNextResults req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) @@ -503,9 +504,9 @@ func (client FailoverGroupsClient) ListByServerComplete(ctx context.Context, res // Update updates a failover group. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server containing the failover group. -// failoverGroupName is the name of the failover group. parameters is the failover group parameters. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server containing the failover +// group. failoverGroupName is the name of the failover group. parameters is the failover group parameters. func (client FailoverGroupsClient) Update(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, parameters FailoverGroupUpdate) (result FailoverGroupsUpdateFuture, err error) { req, err := client.UpdatePreparer(ctx, resourceGroupName, serverName, failoverGroupName, parameters) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/firewallrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/firewallrules.go index 5c8e3e364057..340af9848382 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/firewallrules.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/firewallrules.go @@ -44,9 +44,9 @@ func NewFirewallRulesClientWithBaseURI(baseURI string, subscriptionID string) Fi // CreateOrUpdate creates or updates a firewall rule. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. firewallRuleName is the name of the -// firewall rule. parameters is the required parameters for creating or updating a firewall rule. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. firewallRuleName is the name +// of the firewall rule. parameters is the required parameters for creating or updating a firewall rule. func (client FirewallRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters FirewallRule) (result FirewallRule, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -54,7 +54,7 @@ func (client FirewallRulesClient) CreateOrUpdate(ctx context.Context, resourceGr Chain: []validation.Constraint{{Target: "parameters.FirewallRuleProperties.StartIPAddress", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.FirewallRuleProperties.EndIPAddress", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "sql.FirewallRulesClient", "CreateOrUpdate") + return result, validation.NewError("sql.FirewallRulesClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, firewallRuleName, parameters) @@ -124,9 +124,9 @@ func (client FirewallRulesClient) CreateOrUpdateResponder(resp *http.Response) ( // Delete deletes a firewall rule. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. firewallRuleName is the name of the -// firewall rule. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. firewallRuleName is the name +// of the firewall rule. func (client FirewallRulesClient) Delete(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string) (result autorest.Response, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, firewallRuleName) if err != nil { @@ -192,9 +192,9 @@ func (client FirewallRulesClient) DeleteResponder(resp *http.Response) (result a // Get gets a firewall rule. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. firewallRuleName is the name of the -// firewall rule. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. firewallRuleName is the name +// of the firewall rule. func (client FirewallRulesClient) Get(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string) (result FirewallRule, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, serverName, firewallRuleName) if err != nil { @@ -261,8 +261,8 @@ func (client FirewallRulesClient) GetResponder(resp *http.Response) (result Fire // ListByServer returns a list of firewall rules. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. func (client FirewallRulesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result FirewallRuleListResult, err error) { req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/geobackuppolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/geobackuppolicies.go index 6b764ae56aac..f8aa8e753799 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/geobackuppolicies.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/geobackuppolicies.go @@ -44,18 +44,17 @@ func NewGeoBackupPoliciesClientWithBaseURI(baseURI string, subscriptionID string // CreateOrUpdate updates a database geo backup policy. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database. geoBackupPolicyName is the name of the geo backup policy. parameters is the required parameters for -// creating or updating the geo backup policy. -func (client GeoBackupPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, geoBackupPolicyName string, parameters GeoBackupPolicy) (result GeoBackupPolicy, err error) { +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database. parameters is the required parameters for creating or updating the geo backup policy. +func (client GeoBackupPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters GeoBackupPolicy) (result GeoBackupPolicy, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.GeoBackupPolicyProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "sql.GeoBackupPoliciesClient", "CreateOrUpdate") + return result, validation.NewError("sql.GeoBackupPoliciesClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, geoBackupPolicyName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "sql.GeoBackupPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -77,10 +76,10 @@ func (client GeoBackupPoliciesClient) CreateOrUpdate(ctx context.Context, resour } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client GeoBackupPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, geoBackupPolicyName string, parameters GeoBackupPolicy) (*http.Request, error) { +func (client GeoBackupPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters GeoBackupPolicy) (*http.Request, error) { pathParameters := map[string]interface{}{ "databaseName": autorest.Encode("path", databaseName), - "geoBackupPolicyName": autorest.Encode("path", geoBackupPolicyName), + "geoBackupPolicyName": autorest.Encode("path", "Default"), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -123,11 +122,11 @@ func (client GeoBackupPoliciesClient) CreateOrUpdateResponder(resp *http.Respons // Get gets a geo backup policy. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database. geoBackupPolicyName is the name of the geo backup policy. -func (client GeoBackupPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, geoBackupPolicyName string) (result GeoBackupPolicy, err error) { - req, err := client.GetPreparer(ctx, resourceGroupName, serverName, databaseName, geoBackupPolicyName) +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database. +func (client GeoBackupPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result GeoBackupPolicy, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, serverName, databaseName) if err != nil { err = autorest.NewErrorWithError(err, "sql.GeoBackupPoliciesClient", "Get", nil, "Failure preparing request") return @@ -149,10 +148,10 @@ func (client GeoBackupPoliciesClient) Get(ctx context.Context, resourceGroupName } // GetPreparer prepares the Get request. -func (client GeoBackupPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, geoBackupPolicyName string) (*http.Request, error) { +func (client GeoBackupPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "databaseName": autorest.Encode("path", databaseName), - "geoBackupPolicyName": autorest.Encode("path", geoBackupPolicyName), + "geoBackupPolicyName": autorest.Encode("path", "Default"), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -193,9 +192,9 @@ func (client GeoBackupPoliciesClient) GetResponder(resp *http.Response) (result // ListByDatabase returns a list of geo backup policies. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database. func (client GeoBackupPoliciesClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result GeoBackupPolicyListResult, err error) { req, err := client.ListByDatabasePreparer(ctx, resourceGroupName, serverName, databaseName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/models.go index 487f228d4cd1..f24fa5b36d32 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/models.go @@ -719,7 +719,8 @@ const ( UnReprovisioned SyncMemberState = "UnReprovisioned" ) -// TransparentDataEncryptionActivityStatus enumerates the values for transparent data encryption activity status. +// TransparentDataEncryptionActivityStatus enumerates the values for transparent data encryption activity +// status. type TransparentDataEncryptionActivityStatus string const ( @@ -791,8 +792,8 @@ const ( Unknown VirtualNetworkRuleState = "Unknown" ) -// BackupLongTermRetentionPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// BackupLongTermRetentionPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. type BackupLongTermRetentionPoliciesCreateOrUpdateFuture struct { azure.Future req *http.Request @@ -804,38 +805,55 @@ func (future BackupLongTermRetentionPoliciesCreateOrUpdateFuture) Result(client var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return bltrp, autorest.NewError("sql.BackupLongTermRetentionPoliciesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return bltrp, azure.NewAsyncOpIncompleteError("sql.BackupLongTermRetentionPoliciesCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { bltrp, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionPoliciesCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } bltrp, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionPoliciesCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } // BackupLongTermRetentionPolicy a backup long term retention policy type BackupLongTermRetentionPolicy struct { autorest.Response `json:"-"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // BackupLongTermRetentionPolicyProperties - The properties of the backup long term retention policy + *BackupLongTermRetentionPolicyProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // Location - The geo-location where the resource lives - Location *string `json:"location,omitempty"` - // BackupLongTermRetentionPolicyProperties - The properties of the backup long term retention policy - *BackupLongTermRetentionPolicyProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for BackupLongTermRetentionPolicy struct. @@ -845,56 +863,54 @@ func (bltrp *BackupLongTermRetentionPolicy) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + bltrp.Location = &location + } + case "properties": + if v != nil { + var backupLongTermRetentionPolicyProperties BackupLongTermRetentionPolicyProperties + err = json.Unmarshal(*v, &backupLongTermRetentionPolicyProperties) + if err != nil { + return err + } + bltrp.BackupLongTermRetentionPolicyProperties = &backupLongTermRetentionPolicyProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + bltrp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + bltrp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + bltrp.Type = &typeVar + } } - bltrp.Location = &location - } - - v = m["properties"] - if v != nil { - var properties BackupLongTermRetentionPolicyProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - bltrp.BackupLongTermRetentionPolicyProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - bltrp.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - bltrp.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - bltrp.Type = &typeVar } return nil @@ -918,16 +934,16 @@ type BackupLongTermRetentionPolicyProperties struct { // BackupLongTermRetentionVault a backup long term retention vault type BackupLongTermRetentionVault struct { autorest.Response `json:"-"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // BackupLongTermRetentionVaultProperties - The properties of the backup long term retention vault + *BackupLongTermRetentionVaultProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // Location - The geo-location where the resource lives - Location *string `json:"location,omitempty"` - // BackupLongTermRetentionVaultProperties - The properties of the backup long term retention vault - *BackupLongTermRetentionVaultProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for BackupLongTermRetentionVault struct. @@ -937,56 +953,54 @@ func (bltrv *BackupLongTermRetentionVault) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - bltrv.Location = &location - } - - v = m["properties"] - if v != nil { - var properties BackupLongTermRetentionVaultProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - bltrv.BackupLongTermRetentionVaultProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - bltrv.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - bltrv.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + bltrv.Location = &location + } + case "properties": + if v != nil { + var backupLongTermRetentionVaultProperties BackupLongTermRetentionVaultProperties + err = json.Unmarshal(*v, &backupLongTermRetentionVaultProperties) + if err != nil { + return err + } + bltrv.BackupLongTermRetentionVaultProperties = &backupLongTermRetentionVaultProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + bltrv.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + bltrv.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + bltrv.Type = &typeVar + } } - bltrv.Type = &typeVar } return nil @@ -1018,22 +1032,39 @@ func (future BackupLongTermRetentionVaultsCreateOrUpdateFuture) Result(client Ba var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionVaultsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return bltrv, autorest.NewError("sql.BackupLongTermRetentionVaultsCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return bltrv, azure.NewAsyncOpIncompleteError("sql.BackupLongTermRetentionVaultsCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { bltrv, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionVaultsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionVaultsCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } bltrv, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionVaultsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -1061,99 +1092,122 @@ type CheckNameAvailabilityResponse struct { // Database represents a database. type Database struct { autorest.Response `json:"-"` + // Kind - Kind of database. This is metadata used for the Azure portal experience. + Kind *string `json:"kind,omitempty"` + // DatabaseProperties - The properties representing the resource. + *DatabaseProperties `json:"properties,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - Resource location. + Location *string `json:"location,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Kind - Kind of database. This is metadata used for the Azure portal experience. - Kind *string `json:"kind,omitempty"` - // DatabaseProperties - The properties representing the resource. - *DatabaseProperties `json:"properties,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for Database struct. -func (d *Database) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for Database. +func (d Database) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if d.Kind != nil { + objectMap["kind"] = d.Kind } - var v *json.RawMessage - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - d.Kind = &kind + if d.DatabaseProperties != nil { + objectMap["properties"] = d.DatabaseProperties } - - v = m["properties"] - if v != nil { - var properties DatabaseProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - d.DatabaseProperties = &properties + if d.Tags != nil { + objectMap["tags"] = d.Tags } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - d.Tags = &tags + if d.Location != nil { + objectMap["location"] = d.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - d.Location = &location + if d.ID != nil { + objectMap["id"] = d.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - d.ID = &ID + if d.Name != nil { + objectMap["name"] = d.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - d.Name = &name + if d.Type != nil { + objectMap["type"] = d.Type } + return json.Marshal(objectMap) +} - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for Database struct. +func (d *Database) 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 "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + d.Kind = &kind + } + case "properties": + if v != nil { + var databaseProperties DatabaseProperties + err = json.Unmarshal(*v, &databaseProperties) + if err != nil { + return err + } + d.DatabaseProperties = &databaseProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + d.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + d.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + d.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + d.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + d.Type = &typeVar + } } - d.Type = &typeVar } return nil @@ -1162,16 +1216,16 @@ func (d *Database) UnmarshalJSON(body []byte) error { // DatabaseBlobAuditingPolicy a database blob auditing policy. type DatabaseBlobAuditingPolicy struct { autorest.Response `json:"-"` + // Kind - Resource kind. + Kind *string `json:"kind,omitempty"` + // DatabaseBlobAuditingPolicyProperties - Resource properties. + *DatabaseBlobAuditingPolicyProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // Kind - Resource kind. - Kind *string `json:"kind,omitempty"` - // DatabaseBlobAuditingPolicyProperties - Resource properties. - *DatabaseBlobAuditingPolicyProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for DatabaseBlobAuditingPolicy struct. @@ -1181,56 +1235,54 @@ func (dbap *DatabaseBlobAuditingPolicy) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err + for k, v := range m { + switch k { + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + dbap.Kind = &kind + } + case "properties": + if v != nil { + var databaseBlobAuditingPolicyProperties DatabaseBlobAuditingPolicyProperties + err = json.Unmarshal(*v, &databaseBlobAuditingPolicyProperties) + if err != nil { + return err + } + dbap.DatabaseBlobAuditingPolicyProperties = &databaseBlobAuditingPolicyProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dbap.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dbap.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dbap.Type = &typeVar + } } - dbap.Kind = &kind - } - - v = m["properties"] - if v != nil { - var properties DatabaseBlobAuditingPolicyProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - dbap.DatabaseBlobAuditingPolicyProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - dbap.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - dbap.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - dbap.Type = &typeVar } return nil @@ -1338,26 +1390,44 @@ func (future DatabasesCreateImportOperationFuture) Result(client DatabasesClient var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesCreateImportOperationFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ier, autorest.NewError("sql.DatabasesCreateImportOperationFuture", "Result", "asynchronous operation has not completed") + return ier, azure.NewAsyncOpIncompleteError("sql.DatabasesCreateImportOperationFuture") } if future.PollingMethod() == azure.PollingLocation { ier, err = client.CreateImportOperationResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesCreateImportOperationFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesCreateImportOperationFuture", "Result", resp, "Failure sending request") return } ier, err = client.CreateImportOperationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesCreateImportOperationFuture", "Result", resp, "Failure responding to request") + } return } -// DatabasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// DatabasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type DatabasesCreateOrUpdateFuture struct { azure.Future req *http.Request @@ -1369,40 +1439,57 @@ func (future DatabasesCreateOrUpdateFuture) Result(client DatabasesClient) (d Da var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return d, autorest.NewError("sql.DatabasesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return d, azure.NewAsyncOpIncompleteError("sql.DatabasesCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { d, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } d, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } // DatabaseSecurityAlertPolicy contains information about a database Threat Detection policy. type DatabaseSecurityAlertPolicy struct { autorest.Response `json:"-"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - Resource name. - Name *string `json:"name,omitempty"` - // Type - Resource type. - Type *string `json:"type,omitempty"` // Location - The geo-location where the resource lives Location *string `json:"location,omitempty"` // Kind - Resource kind. Kind *string `json:"kind,omitempty"` // DatabaseSecurityAlertPolicyProperties - Properties of the security alert policy. *DatabaseSecurityAlertPolicyProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` } // UnmarshalJSON is the custom unmarshaler for DatabaseSecurityAlertPolicy struct. @@ -1412,66 +1499,63 @@ func (dsap *DatabaseSecurityAlertPolicy) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - dsap.Location = &location - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dsap.Location = &location + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + dsap.Kind = &kind + } + case "properties": + if v != nil { + var databaseSecurityAlertPolicyProperties DatabaseSecurityAlertPolicyProperties + err = json.Unmarshal(*v, &databaseSecurityAlertPolicyProperties) + if err != nil { + return err + } + dsap.DatabaseSecurityAlertPolicyProperties = &databaseSecurityAlertPolicyProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dsap.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dsap.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dsap.Type = &typeVar + } } - dsap.Kind = &kind - } - - v = m["properties"] - if v != nil { - var properties DatabaseSecurityAlertPolicyProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - dsap.DatabaseSecurityAlertPolicyProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - dsap.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - dsap.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - dsap.Type = &typeVar } return nil @@ -1509,22 +1593,39 @@ func (future DatabasesExportFuture) Result(client DatabasesClient) (ier ImportEx var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesExportFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ier, autorest.NewError("sql.DatabasesExportFuture", "Result", "asynchronous operation has not completed") + return ier, azure.NewAsyncOpIncompleteError("sql.DatabasesExportFuture") } if future.PollingMethod() == azure.PollingLocation { ier, err = client.ExportResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesExportFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesExportFuture", "Result", resp, "Failure sending request") return } ier, err = client.ExportResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesExportFuture", "Result", resp, "Failure responding to request") + } return } @@ -1540,22 +1641,39 @@ func (future DatabasesImportFuture) Result(client DatabasesClient) (ier ImportEx var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesImportFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ier, autorest.NewError("sql.DatabasesImportFuture", "Result", "asynchronous operation has not completed") + return ier, azure.NewAsyncOpIncompleteError("sql.DatabasesImportFuture") } if future.PollingMethod() == azure.PollingLocation { ier, err = client.ImportResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesImportFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesImportFuture", "Result", resp, "Failure sending request") return } ier, err = client.ImportResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesImportFuture", "Result", resp, "Failure responding to request") + } return } @@ -1571,22 +1689,39 @@ func (future DatabasesPauseFuture) Result(client DatabasesClient) (ar autorest.R var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesPauseFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("sql.DatabasesPauseFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("sql.DatabasesPauseFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.PauseResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesPauseFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesPauseFuture", "Result", resp, "Failure sending request") return } ar, err = client.PauseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesPauseFuture", "Result", resp, "Failure responding to request") + } return } @@ -1602,22 +1737,39 @@ func (future DatabasesResumeFuture) Result(client DatabasesClient) (ar autorest. var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesResumeFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("sql.DatabasesResumeFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("sql.DatabasesResumeFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.ResumeResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesResumeFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesResumeFuture", "Result", resp, "Failure sending request") return } ar, err = client.ResumeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesResumeFuture", "Result", resp, "Failure responding to request") + } return } @@ -1633,37 +1785,75 @@ func (future DatabasesUpdateFuture) Result(client DatabasesClient) (d Database, var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return d, autorest.NewError("sql.DatabasesUpdateFuture", "Result", "asynchronous operation has not completed") + return d, azure.NewAsyncOpIncompleteError("sql.DatabasesUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { d, err = client.UpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesUpdateFuture", "Result", resp, "Failure sending request") return } d, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.DatabasesUpdateFuture", "Result", resp, "Failure responding to request") + } return } // DatabaseUpdate represents a database update. type DatabaseUpdate struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // DatabaseProperties - The properties representing the resource. + *DatabaseProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // DatabaseProperties - The properties representing the resource. - *DatabaseProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for DatabaseUpdate. +func (du DatabaseUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if du.Tags != nil { + objectMap["tags"] = du.Tags + } + if du.DatabaseProperties != nil { + objectMap["properties"] = du.DatabaseProperties + } + if du.ID != nil { + objectMap["id"] = du.ID + } + if du.Name != nil { + objectMap["name"] = du.Name + } + if du.Type != nil { + objectMap["type"] = du.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for DatabaseUpdate struct. @@ -1673,56 +1863,54 @@ func (du *DatabaseUpdate) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - 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 + } + du.Tags = tags + } + case "properties": + if v != nil { + var databaseProperties DatabaseProperties + err = json.Unmarshal(*v, &databaseProperties) + if err != nil { + return err + } + du.DatabaseProperties = &databaseProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + du.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + du.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + du.Type = &typeVar + } } - du.Tags = &tags - } - - v = m["properties"] - if v != nil { - var properties DatabaseProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - du.DatabaseProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - du.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - du.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - du.Type = &typeVar } return nil @@ -1756,18 +1944,18 @@ type DatabaseUsageListResult struct { // DataMaskingPolicy represents a database data masking policy. type DataMaskingPolicy struct { autorest.Response `json:"-"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - Resource name. - Name *string `json:"name,omitempty"` - // Type - Resource type. - Type *string `json:"type,omitempty"` // DataMaskingPolicyProperties - The properties of the data masking policy. *DataMaskingPolicyProperties `json:"properties,omitempty"` // Location - The location of the data masking policy. Location *string `json:"location,omitempty"` // Kind - The kind of data masking policy. Metadata, used for Azure portal. Kind *string `json:"kind,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` } // UnmarshalJSON is the custom unmarshaler for DataMaskingPolicy struct. @@ -1777,66 +1965,63 @@ func (dmp *DataMaskingPolicy) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties DataMaskingPolicyProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - dmp.DataMaskingPolicyProperties = &properties - } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - dmp.Location = &location - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dataMaskingPolicyProperties DataMaskingPolicyProperties + err = json.Unmarshal(*v, &dataMaskingPolicyProperties) + if err != nil { + return err + } + dmp.DataMaskingPolicyProperties = &dataMaskingPolicyProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dmp.Location = &location + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + dmp.Kind = &kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dmp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dmp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dmp.Type = &typeVar + } } - dmp.Kind = &kind - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - dmp.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - dmp.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - dmp.Type = &typeVar } return nil @@ -1857,18 +2042,18 @@ type DataMaskingPolicyProperties struct { // DataMaskingRule represents a database data masking rule. type DataMaskingRule struct { autorest.Response `json:"-"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - Resource name. - Name *string `json:"name,omitempty"` - // Type - Resource type. - Type *string `json:"type,omitempty"` // DataMaskingRuleProperties - The properties of the resource. *DataMaskingRuleProperties `json:"properties,omitempty"` // Location - The location of the data masking rule. Location *string `json:"location,omitempty"` // Kind - The kind of Data Masking Rule. Metadata, used for Azure portal. Kind *string `json:"kind,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` } // UnmarshalJSON is the custom unmarshaler for DataMaskingRule struct. @@ -1878,66 +2063,63 @@ func (dmr *DataMaskingRule) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties DataMaskingRuleProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - dmr.DataMaskingRuleProperties = &properties - } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dataMaskingRuleProperties DataMaskingRuleProperties + err = json.Unmarshal(*v, &dataMaskingRuleProperties) + if err != nil { + return err + } + dmr.DataMaskingRuleProperties = &dataMaskingRuleProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dmr.Location = &location + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + dmr.Kind = &kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dmr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dmr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dmr.Type = &typeVar + } } - dmr.Location = &location - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - dmr.Kind = &kind - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - dmr.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - dmr.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - dmr.Type = &typeVar } return nil @@ -1993,99 +2175,122 @@ type EditionCapability struct { // ElasticPool represents a database elastic pool. type ElasticPool struct { autorest.Response `json:"-"` + // ElasticPoolProperties - The properties representing the resource. + *ElasticPoolProperties `json:"properties,omitempty"` + // Kind - Kind of elastic pool. This is metadata used for the Azure portal experience. + Kind *string `json:"kind,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - Resource location. + Location *string `json:"location,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // ElasticPoolProperties - The properties representing the resource. - *ElasticPoolProperties `json:"properties,omitempty"` - // Kind - Kind of elastic pool. This is metadata used for the Azure portal experience. - Kind *string `json:"kind,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for ElasticPool struct. -func (ep *ElasticPool) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for ElasticPool. +func (ep ElasticPool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ep.ElasticPoolProperties != nil { + objectMap["properties"] = ep.ElasticPoolProperties } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ElasticPoolProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - ep.ElasticPoolProperties = &properties + if ep.Kind != nil { + objectMap["kind"] = ep.Kind } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - ep.Kind = &kind + if ep.Tags != nil { + objectMap["tags"] = ep.Tags } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - ep.Tags = &tags + if ep.Location != nil { + objectMap["location"] = ep.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - ep.Location = &location + if ep.ID != nil { + objectMap["id"] = ep.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - ep.ID = &ID + if ep.Name != nil { + objectMap["name"] = ep.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - ep.Name = &name + if ep.Type != nil { + objectMap["type"] = ep.Type } + return json.Marshal(objectMap) +} - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for ElasticPool struct. +func (ep *ElasticPool) 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 "properties": + if v != nil { + var elasticPoolProperties ElasticPoolProperties + err = json.Unmarshal(*v, &elasticPoolProperties) + if err != nil { + return err + } + ep.ElasticPoolProperties = &elasticPoolProperties + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ep.Kind = &kind + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ep.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ep.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ep.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ep.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ep.Type = &typeVar + } } - ep.Type = &typeVar } return nil @@ -2093,16 +2298,16 @@ func (ep *ElasticPool) UnmarshalJSON(body []byte) error { // ElasticPoolActivity represents the activity on an elastic pool. type ElasticPoolActivity struct { + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ElasticPoolActivityProperties - The properties representing the resource. + *ElasticPoolActivityProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // Location - The geo-location where the resource lives - Location *string `json:"location,omitempty"` - // ElasticPoolActivityProperties - The properties representing the resource. - *ElasticPoolActivityProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ElasticPoolActivity struct. @@ -2112,56 +2317,54 @@ func (epa *ElasticPoolActivity) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - epa.Location = &location - } - - v = m["properties"] - if v != nil { - var properties ElasticPoolActivityProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - epa.ElasticPoolActivityProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + epa.Location = &location + } + case "properties": + if v != nil { + var elasticPoolActivityProperties ElasticPoolActivityProperties + err = json.Unmarshal(*v, &elasticPoolActivityProperties) + if err != nil { + return err + } + epa.ElasticPoolActivityProperties = &elasticPoolActivityProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + epa.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + epa.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + epa.Type = &typeVar + } } - epa.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - epa.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - epa.Type = &typeVar } return nil @@ -2220,75 +2423,73 @@ type ElasticPoolActivityProperties struct { // ElasticPoolDatabaseActivity represents the activity on an elastic pool. type ElasticPoolDatabaseActivity struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - Resource name. - Name *string `json:"name,omitempty"` - // Type - Resource type. - Type *string `json:"type,omitempty"` // Location - The geo-location where the resource lives Location *string `json:"location,omitempty"` // ElasticPoolDatabaseActivityProperties - The properties representing the resource. *ElasticPoolDatabaseActivityProperties `json:"properties,omitempty"` -} - -// UnmarshalJSON is the custom unmarshaler for ElasticPoolDatabaseActivity struct. -func (epda *ElasticPoolDatabaseActivity) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - var v *json.RawMessage - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - epda.Location = &location - } - - v = m["properties"] - if v != nil { - var properties ElasticPoolDatabaseActivityProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - epda.ElasticPoolDatabaseActivityProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - epda.ID = &ID - } + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` +} - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - epda.Name = &name +// UnmarshalJSON is the custom unmarshaler for ElasticPoolDatabaseActivity struct. +func (epda *ElasticPoolDatabaseActivity) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + epda.Location = &location + } + case "properties": + if v != nil { + var elasticPoolDatabaseActivityProperties ElasticPoolDatabaseActivityProperties + err = json.Unmarshal(*v, &elasticPoolDatabaseActivityProperties) + if err != nil { + return err + } + epda.ElasticPoolDatabaseActivityProperties = &elasticPoolDatabaseActivityProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + epda.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + epda.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + epda.Type = &typeVar + } } - epda.Type = &typeVar } return nil @@ -2429,22 +2630,39 @@ func (future ElasticPoolsCreateOrUpdateFuture) Result(client ElasticPoolsClient) var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.ElasticPoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ep, autorest.NewError("sql.ElasticPoolsCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return ep, azure.NewAsyncOpIncompleteError("sql.ElasticPoolsCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { ep, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ElasticPoolsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.ElasticPoolsCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } ep, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ElasticPoolsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -2460,37 +2678,75 @@ func (future ElasticPoolsUpdateFuture) Result(client ElasticPoolsClient) (ep Ela var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.ElasticPoolsUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ep, autorest.NewError("sql.ElasticPoolsUpdateFuture", "Result", "asynchronous operation has not completed") + return ep, azure.NewAsyncOpIncompleteError("sql.ElasticPoolsUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { ep, err = client.UpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ElasticPoolsUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.ElasticPoolsUpdateFuture", "Result", resp, "Failure sending request") return } ep, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ElasticPoolsUpdateFuture", "Result", resp, "Failure responding to request") + } return } // ElasticPoolUpdate represents an elastic pool update. type ElasticPoolUpdate struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ElasticPoolProperties - The properties representing the resource. + *ElasticPoolProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // ElasticPoolProperties - The properties representing the resource. - *ElasticPoolProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ElasticPoolUpdate. +func (epu ElasticPoolUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if epu.Tags != nil { + objectMap["tags"] = epu.Tags + } + if epu.ElasticPoolProperties != nil { + objectMap["properties"] = epu.ElasticPoolProperties + } + if epu.ID != nil { + objectMap["id"] = epu.ID + } + if epu.Name != nil { + objectMap["name"] = epu.Name + } + if epu.Type != nil { + objectMap["type"] = epu.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ElasticPoolUpdate struct. @@ -2500,56 +2756,54 @@ func (epu *ElasticPoolUpdate) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - epu.Tags = &tags - } - - v = m["properties"] - if v != nil { - var properties ElasticPoolProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - epu.ElasticPoolProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - epu.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - epu.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - 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 + } + epu.Tags = tags + } + case "properties": + if v != nil { + var elasticPoolProperties ElasticPoolProperties + err = json.Unmarshal(*v, &elasticPoolProperties) + if err != nil { + return err + } + epu.ElasticPoolProperties = &elasticPoolProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + epu.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + epu.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + epu.Type = &typeVar + } } - epu.Type = &typeVar } return nil @@ -2558,18 +2812,18 @@ func (epu *ElasticPoolUpdate) UnmarshalJSON(body []byte) error { // EncryptionProtector the server encryption protector. type EncryptionProtector struct { autorest.Response `json:"-"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - Resource name. - Name *string `json:"name,omitempty"` - // Type - Resource type. - Type *string `json:"type,omitempty"` // Kind - Kind of encryption protector. This is metadata used for the Azure portal experience. Kind *string `json:"kind,omitempty"` // Location - Resource location. Location *string `json:"location,omitempty"` // EncryptionProtectorProperties - Resource properties. *EncryptionProtectorProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` } // UnmarshalJSON is the custom unmarshaler for EncryptionProtector struct. @@ -2579,66 +2833,63 @@ func (ep *EncryptionProtector) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - ep.Kind = &kind - } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - ep.Location = &location - } - - v = m["properties"] - if v != nil { - var properties EncryptionProtectorProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - ep.EncryptionProtectorProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - ep.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - ep.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ep.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ep.Location = &location + } + case "properties": + if v != nil { + var encryptionProtectorProperties EncryptionProtectorProperties + err = json.Unmarshal(*v, &encryptionProtectorProperties) + if err != nil { + return err + } + ep.EncryptionProtectorProperties = &encryptionProtectorProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ep.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ep.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ep.Type = &typeVar + } } - ep.Type = &typeVar } return nil @@ -2760,8 +3011,8 @@ type EncryptionProtectorProperties struct { Thumbprint *string `json:"thumbprint,omitempty"` } -// EncryptionProtectorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// EncryptionProtectorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type EncryptionProtectorsCreateOrUpdateFuture struct { azure.Future req *http.Request @@ -2773,22 +3024,39 @@ func (future EncryptionProtectorsCreateOrUpdateFuture) Result(client EncryptionP var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ep, autorest.NewError("sql.EncryptionProtectorsCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return ep, azure.NewAsyncOpIncompleteError("sql.EncryptionProtectorsCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { ep, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } ep, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -2811,87 +3079,108 @@ type ExportRequest struct { // FailoverGroup a failover group. type FailoverGroup struct { autorest.Response `json:"-"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // FailoverGroupProperties - Resource properties. + *FailoverGroupProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // FailoverGroupProperties - Resource properties. - *FailoverGroupProperties `json:"properties,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for FailoverGroup struct. -func (fg *FailoverGroup) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for FailoverGroup. +func (fg FailoverGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fg.Location != nil { + objectMap["location"] = fg.Location } - var v *json.RawMessage - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - fg.Location = &location + if fg.Tags != nil { + objectMap["tags"] = fg.Tags } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - fg.Tags = &tags + if fg.FailoverGroupProperties != nil { + objectMap["properties"] = fg.FailoverGroupProperties } - - v = m["properties"] - if v != nil { - var properties FailoverGroupProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - fg.FailoverGroupProperties = &properties + if fg.ID != nil { + objectMap["id"] = fg.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - fg.ID = &ID + if fg.Name != nil { + objectMap["name"] = fg.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - fg.Name = &name + if fg.Type != nil { + objectMap["type"] = fg.Type } + return json.Marshal(objectMap) +} - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for FailoverGroup struct. +func (fg *FailoverGroup) 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 "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + fg.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + fg.Tags = tags + } + case "properties": + if v != nil { + var failoverGroupProperties FailoverGroupProperties + err = json.Unmarshal(*v, &failoverGroupProperties) + if err != nil { + return err + } + fg.FailoverGroupProperties = &failoverGroupProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + fg.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + fg.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + fg.Type = &typeVar + } } - fg.Type = &typeVar } return nil @@ -3042,22 +3331,39 @@ func (future FailoverGroupsCreateOrUpdateFuture) Result(client FailoverGroupsCli var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.FailoverGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return fg, autorest.NewError("sql.FailoverGroupsCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return fg, azure.NewAsyncOpIncompleteError("sql.FailoverGroupsCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { fg, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.FailoverGroupsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.FailoverGroupsCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } fg, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.FailoverGroupsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -3073,26 +3379,44 @@ func (future FailoverGroupsDeleteFuture) Result(client FailoverGroupsClient) (ar var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.FailoverGroupsDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("sql.FailoverGroupsDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("sql.FailoverGroupsDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.FailoverGroupsDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.FailoverGroupsDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.FailoverGroupsDeleteFuture", "Result", resp, "Failure responding to request") + } return } -// FailoverGroupsFailoverFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// FailoverGroupsFailoverFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type FailoverGroupsFailoverFuture struct { azure.Future req *http.Request @@ -3104,22 +3428,39 @@ func (future FailoverGroupsFailoverFuture) Result(client FailoverGroupsClient) ( var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.FailoverGroupsFailoverFuture", "Result", future.Response(), "Polling failure") return } if !done { - return fg, autorest.NewError("sql.FailoverGroupsFailoverFuture", "Result", "asynchronous operation has not completed") + return fg, azure.NewAsyncOpIncompleteError("sql.FailoverGroupsFailoverFuture") } if future.PollingMethod() == azure.PollingLocation { fg, err = client.FailoverResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.FailoverGroupsFailoverFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.FailoverGroupsFailoverFuture", "Result", resp, "Failure sending request") return } fg, err = client.FailoverResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.FailoverGroupsFailoverFuture", "Result", resp, "Failure responding to request") + } return } @@ -3136,22 +3477,39 @@ func (future FailoverGroupsForceFailoverAllowDataLossFuture) Result(client Failo var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.FailoverGroupsForceFailoverAllowDataLossFuture", "Result", future.Response(), "Polling failure") return } if !done { - return fg, autorest.NewError("sql.FailoverGroupsForceFailoverAllowDataLossFuture", "Result", "asynchronous operation has not completed") + return fg, azure.NewAsyncOpIncompleteError("sql.FailoverGroupsForceFailoverAllowDataLossFuture") } if future.PollingMethod() == azure.PollingLocation { fg, err = client.ForceFailoverAllowDataLossResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.FailoverGroupsForceFailoverAllowDataLossFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.FailoverGroupsForceFailoverAllowDataLossFuture", "Result", resp, "Failure sending request") return } fg, err = client.ForceFailoverAllowDataLossResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.FailoverGroupsForceFailoverAllowDataLossFuture", "Result", resp, "Failure responding to request") + } return } @@ -3167,22 +3525,39 @@ func (future FailoverGroupsUpdateFuture) Result(client FailoverGroupsClient) (fg var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.FailoverGroupsUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return fg, autorest.NewError("sql.FailoverGroupsUpdateFuture", "Result", "asynchronous operation has not completed") + return fg, azure.NewAsyncOpIncompleteError("sql.FailoverGroupsUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { fg, err = client.UpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.FailoverGroupsUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.FailoverGroupsUpdateFuture", "Result", resp, "Failure sending request") return } fg, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.FailoverGroupsUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -3191,7 +3566,19 @@ type FailoverGroupUpdate struct { // FailoverGroupUpdateProperties - Resource properties. *FailoverGroupUpdateProperties `json:"properties,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for FailoverGroupUpdate. +func (fgu FailoverGroupUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fgu.FailoverGroupUpdateProperties != nil { + objectMap["properties"] = fgu.FailoverGroupUpdateProperties + } + if fgu.Tags != nil { + objectMap["tags"] = fgu.Tags + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for FailoverGroupUpdate struct. @@ -3201,26 +3588,27 @@ func (fgu *FailoverGroupUpdate) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties FailoverGroupUpdateProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - fgu.FailoverGroupUpdateProperties = &properties - } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var failoverGroupUpdateProperties FailoverGroupUpdateProperties + err = json.Unmarshal(*v, &failoverGroupUpdateProperties) + if err != nil { + return err + } + fgu.FailoverGroupUpdateProperties = &failoverGroupUpdateProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + fgu.Tags = tags + } } - fgu.Tags = &tags } return nil @@ -3239,18 +3627,18 @@ type FailoverGroupUpdateProperties struct { // FirewallRule represents a server firewall rule. type FirewallRule struct { autorest.Response `json:"-"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - Resource name. - Name *string `json:"name,omitempty"` - // Type - Resource type. - Type *string `json:"type,omitempty"` // Kind - Kind of server that contains this firewall rule. Kind *string `json:"kind,omitempty"` // Location - Location of the server that contains this firewall rule. Location *string `json:"location,omitempty"` // FirewallRuleProperties - The properties representing the resource. *FirewallRuleProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` } // UnmarshalJSON is the custom unmarshaler for FirewallRule struct. @@ -3260,66 +3648,63 @@ func (fr *FirewallRule) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - fr.Kind = &kind - } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - fr.Location = &location - } - - v = m["properties"] - if v != nil { - var properties FirewallRuleProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - fr.FirewallRuleProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - fr.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - fr.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + fr.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + fr.Location = &location + } + case "properties": + if v != nil { + var firewallRuleProperties FirewallRuleProperties + err = json.Unmarshal(*v, &firewallRuleProperties) + if err != nil { + return err + } + fr.FirewallRuleProperties = &firewallRuleProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + fr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + fr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + fr.Type = &typeVar + } } - fr.Type = &typeVar } return nil @@ -3343,87 +3728,84 @@ type FirewallRuleProperties struct { // GeoBackupPolicy a database geo backup policy. type GeoBackupPolicy struct { autorest.Response `json:"-"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - Resource name. - Name *string `json:"name,omitempty"` - // Type - Resource type. - Type *string `json:"type,omitempty"` // GeoBackupPolicyProperties - The properties of the geo backup policy. *GeoBackupPolicyProperties `json:"properties,omitempty"` // Kind - Kind of geo backup policy. This is metadata used for the Azure portal experience. Kind *string `json:"kind,omitempty"` // Location - Backup policy location. Location *string `json:"location,omitempty"` -} - -// UnmarshalJSON is the custom unmarshaler for GeoBackupPolicy struct. -func (gbp *GeoBackupPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties GeoBackupPolicyProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - gbp.GeoBackupPolicyProperties = &properties - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - gbp.Kind = &kind - } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - gbp.Location = &location - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - gbp.ID = &ID - } + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` +} - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - gbp.Name = &name +// UnmarshalJSON is the custom unmarshaler for GeoBackupPolicy struct. +func (gbp *GeoBackupPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var geoBackupPolicyProperties GeoBackupPolicyProperties + err = json.Unmarshal(*v, &geoBackupPolicyProperties) + if err != nil { + return err + } + gbp.GeoBackupPolicyProperties = &geoBackupPolicyProperties + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + gbp.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + gbp.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + gbp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + gbp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + gbp.Type = &typeVar + } } - gbp.Type = &typeVar } return nil @@ -3447,14 +3829,14 @@ type GeoBackupPolicyProperties struct { // ImportExportResponse response for Import/Export Get operation. type ImportExportResponse struct { autorest.Response `json:"-"` + // ImportExportResponseProperties - The import/export operation properties. + *ImportExportResponseProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // ImportExportResponseProperties - The import/export operation properties. - *ImportExportResponseProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ImportExportResponse struct. @@ -3464,46 +3846,45 @@ func (ier *ImportExportResponse) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ImportExportResponseProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - ier.ImportExportResponseProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - ier.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - ier.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var importExportResponseProperties ImportExportResponseProperties + err = json.Unmarshal(*v, &importExportResponseProperties) + if err != nil { + return err + } + ier.ImportExportResponseProperties = &importExportResponseProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ier.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ier.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ier.Type = &typeVar + } } - ier.Type = &typeVar } return nil @@ -3533,6 +3914,8 @@ type ImportExportResponseProperties struct { // ImportExtensionProperties represents the properties for an import operation type ImportExtensionProperties struct { + // OperationMode - The type of import operation being performed. This is always Import. + OperationMode *string `json:"operationMode,omitempty"` // StorageKeyType - The type of the storage key to use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"` // StorageKey - The storage key to use. If storage key type is SharedAccessKey, it must be preceded with a "?." @@ -3545,8 +3928,6 @@ type ImportExtensionProperties struct { AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` // AuthenticationType - The authentication type. Possible values include: 'SQL', 'ADPassword' AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` - // OperationMode - The type of import operation being performed. This is always Import. - OperationMode *string `json:"operationMode,omitempty"` } // ImportExtensionRequest import database parameters. @@ -3566,36 +3947,36 @@ func (ier *ImportExtensionRequest) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - ier.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - ier.Type = &typeVar - } - - v = m["properties"] - if v != nil { - var properties ImportExtensionProperties - err = json.Unmarshal(*m["properties"], &properties) - 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 + } + ier.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ier.Type = &typeVar + } + case "properties": + if v != nil { + var importExtensionProperties ImportExtensionProperties + err = json.Unmarshal(*v, &importExtensionProperties) + if err != nil { + return err + } + ier.ImportExtensionProperties = &importExtensionProperties + } } - ier.ImportExtensionProperties = &properties } return nil @@ -3603,6 +3984,14 @@ func (ier *ImportExtensionRequest) UnmarshalJSON(body []byte) error { // ImportRequest import database parameters. type ImportRequest struct { + // DatabaseName - The name of the database to import. + DatabaseName *string `json:"databaseName,omitempty"` + // Edition - The edition for the database being created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' + Edition DatabaseEdition `json:"edition,omitempty"` + // ServiceObjectiveName - The name of the service objective to assign to the database. Possible values include: 'ServiceObjectiveNameSystem', 'ServiceObjectiveNameSystem0', 'ServiceObjectiveNameSystem1', 'ServiceObjectiveNameSystem2', 'ServiceObjectiveNameSystem3', 'ServiceObjectiveNameSystem4', 'ServiceObjectiveNameSystem2L', 'ServiceObjectiveNameSystem3L', 'ServiceObjectiveNameSystem4L', 'ServiceObjectiveNameFree', 'ServiceObjectiveNameBasic', 'ServiceObjectiveNameS0', 'ServiceObjectiveNameS1', 'ServiceObjectiveNameS2', 'ServiceObjectiveNameS3', 'ServiceObjectiveNameS4', 'ServiceObjectiveNameS6', 'ServiceObjectiveNameS7', 'ServiceObjectiveNameS9', 'ServiceObjectiveNameS12', 'ServiceObjectiveNameP1', 'ServiceObjectiveNameP2', 'ServiceObjectiveNameP3', 'ServiceObjectiveNameP4', 'ServiceObjectiveNameP6', 'ServiceObjectiveNameP11', 'ServiceObjectiveNameP15', 'ServiceObjectiveNamePRS1', 'ServiceObjectiveNamePRS2', 'ServiceObjectiveNamePRS4', 'ServiceObjectiveNamePRS6', 'ServiceObjectiveNameDW100', 'ServiceObjectiveNameDW200', 'ServiceObjectiveNameDW300', 'ServiceObjectiveNameDW400', 'ServiceObjectiveNameDW500', 'ServiceObjectiveNameDW600', 'ServiceObjectiveNameDW1000', 'ServiceObjectiveNameDW1200', 'ServiceObjectiveNameDW1000c', 'ServiceObjectiveNameDW1500', 'ServiceObjectiveNameDW1500c', 'ServiceObjectiveNameDW2000', 'ServiceObjectiveNameDW2000c', 'ServiceObjectiveNameDW3000', 'ServiceObjectiveNameDW2500c', 'ServiceObjectiveNameDW3000c', 'ServiceObjectiveNameDW6000', 'ServiceObjectiveNameDW5000c', 'ServiceObjectiveNameDW6000c', 'ServiceObjectiveNameDW7500c', 'ServiceObjectiveNameDW10000c', 'ServiceObjectiveNameDW15000c', 'ServiceObjectiveNameDW30000c', 'ServiceObjectiveNameDS100', 'ServiceObjectiveNameDS200', 'ServiceObjectiveNameDS300', 'ServiceObjectiveNameDS400', 'ServiceObjectiveNameDS500', 'ServiceObjectiveNameDS600', 'ServiceObjectiveNameDS1000', 'ServiceObjectiveNameDS1200', 'ServiceObjectiveNameDS1500', 'ServiceObjectiveNameDS2000', 'ServiceObjectiveNameElasticPool' + ServiceObjectiveName ServiceObjectiveName `json:"serviceObjectiveName,omitempty"` + // MaxSizeBytes - The maximum size for the newly imported database. + MaxSizeBytes *string `json:"maxSizeBytes,omitempty"` // StorageKeyType - The type of the storage key to use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"` // StorageKey - The storage key to use. If storage key type is SharedAccessKey, it must be preceded with a "?." @@ -3615,14 +4004,6 @@ type ImportRequest struct { AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` // AuthenticationType - The authentication type. Possible values include: 'SQL', 'ADPassword' AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` - // DatabaseName - The name of the database to import. - DatabaseName *string `json:"databaseName,omitempty"` - // Edition - The edition for the database being created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - Edition DatabaseEdition `json:"edition,omitempty"` - // ServiceObjectiveName - The name of the service objective to assign to the database. Possible values include: 'ServiceObjectiveNameSystem', 'ServiceObjectiveNameSystem0', 'ServiceObjectiveNameSystem1', 'ServiceObjectiveNameSystem2', 'ServiceObjectiveNameSystem3', 'ServiceObjectiveNameSystem4', 'ServiceObjectiveNameSystem2L', 'ServiceObjectiveNameSystem3L', 'ServiceObjectiveNameSystem4L', 'ServiceObjectiveNameFree', 'ServiceObjectiveNameBasic', 'ServiceObjectiveNameS0', 'ServiceObjectiveNameS1', 'ServiceObjectiveNameS2', 'ServiceObjectiveNameS3', 'ServiceObjectiveNameS4', 'ServiceObjectiveNameS6', 'ServiceObjectiveNameS7', 'ServiceObjectiveNameS9', 'ServiceObjectiveNameS12', 'ServiceObjectiveNameP1', 'ServiceObjectiveNameP2', 'ServiceObjectiveNameP3', 'ServiceObjectiveNameP4', 'ServiceObjectiveNameP6', 'ServiceObjectiveNameP11', 'ServiceObjectiveNameP15', 'ServiceObjectiveNamePRS1', 'ServiceObjectiveNamePRS2', 'ServiceObjectiveNamePRS4', 'ServiceObjectiveNamePRS6', 'ServiceObjectiveNameDW100', 'ServiceObjectiveNameDW200', 'ServiceObjectiveNameDW300', 'ServiceObjectiveNameDW400', 'ServiceObjectiveNameDW500', 'ServiceObjectiveNameDW600', 'ServiceObjectiveNameDW1000', 'ServiceObjectiveNameDW1200', 'ServiceObjectiveNameDW1000c', 'ServiceObjectiveNameDW1500', 'ServiceObjectiveNameDW1500c', 'ServiceObjectiveNameDW2000', 'ServiceObjectiveNameDW2000c', 'ServiceObjectiveNameDW3000', 'ServiceObjectiveNameDW2500c', 'ServiceObjectiveNameDW3000c', 'ServiceObjectiveNameDW6000', 'ServiceObjectiveNameDW5000c', 'ServiceObjectiveNameDW6000c', 'ServiceObjectiveNameDW7500c', 'ServiceObjectiveNameDW10000c', 'ServiceObjectiveNameDW15000c', 'ServiceObjectiveNameDW30000c', 'ServiceObjectiveNameDS100', 'ServiceObjectiveNameDS200', 'ServiceObjectiveNameDS300', 'ServiceObjectiveNameDS400', 'ServiceObjectiveNameDS500', 'ServiceObjectiveNameDS600', 'ServiceObjectiveNameDS1000', 'ServiceObjectiveNameDS1200', 'ServiceObjectiveNameDS1500', 'ServiceObjectiveNameDS2000', 'ServiceObjectiveNameElasticPool' - ServiceObjectiveName ServiceObjectiveName `json:"serviceObjectiveName,omitempty"` - // MaxSizeBytes - The maximum size for the newly imported database. - MaxSizeBytes *string `json:"maxSizeBytes,omitempty"` } // LocationCapabilities the location capability. @@ -3735,7 +4116,23 @@ type Operation struct { // Origin - The intended executor of the operation. Possible values include: 'OperationOriginUser', 'OperationOriginSystem' Origin OperationOrigin `json:"origin,omitempty"` // Properties - Additional descriptions for the operation. - Properties *map[string]*map[string]interface{} `json:"properties,omitempty"` + Properties map[string]interface{} `json:"properties"` +} + +// MarshalJSON is the custom marshaler for Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if o.Name != nil { + objectMap["name"] = o.Name + } + if o.Display != nil { + objectMap["display"] = o.Display + } + objectMap["origin"] = o.Origin + if o.Properties != nil { + objectMap["properties"] = o.Properties + } + return json.Marshal(objectMap) } // OperationDisplay display metadata associated with the operation. @@ -3895,14 +4292,14 @@ type ProxyResource struct { // RecommendedElasticPool represents a recommented elastic pool. type RecommendedElasticPool struct { autorest.Response `json:"-"` + // RecommendedElasticPoolProperties - The properites representing the resource. + *RecommendedElasticPoolProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // RecommendedElasticPoolProperties - The properites representing the resource. - *RecommendedElasticPoolProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for RecommendedElasticPool struct. @@ -3912,52 +4309,52 @@ func (rep *RecommendedElasticPool) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties RecommendedElasticPoolProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - rep.RecommendedElasticPoolProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - rep.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - rep.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var recommendedElasticPoolProperties RecommendedElasticPoolProperties + err = json.Unmarshal(*v, &recommendedElasticPoolProperties) + if err != nil { + return err + } + rep.RecommendedElasticPoolProperties = &recommendedElasticPoolProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rep.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rep.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rep.Type = &typeVar + } } - rep.Type = &typeVar } return nil } -// RecommendedElasticPoolListMetricsResult represents the response to a list recommended elastic pool metrics request. +// RecommendedElasticPoolListMetricsResult represents the response to a list recommended elastic pool metrics +// request. type RecommendedElasticPoolListMetricsResult struct { autorest.Response `json:"-"` // Value - The list of recommended elastic pools metrics. @@ -4009,14 +4406,14 @@ type RecommendedElasticPoolProperties struct { // RecommendedIndex represents a database recommended index. type RecommendedIndex struct { + // RecommendedIndexProperties - The properties representing the resource. + *RecommendedIndexProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // RecommendedIndexProperties - The properties representing the resource. - *RecommendedIndexProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for RecommendedIndex struct. @@ -4026,46 +4423,45 @@ func (ri *RecommendedIndex) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties RecommendedIndexProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - ri.RecommendedIndexProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - ri.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - ri.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var recommendedIndexProperties RecommendedIndexProperties + err = json.Unmarshal(*v, &recommendedIndexProperties) + if err != nil { + return err + } + ri.RecommendedIndexProperties = &recommendedIndexProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ri.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ri.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ri.Type = &typeVar + } } - ri.Type = &typeVar } return nil @@ -4102,14 +4498,14 @@ type RecommendedIndexProperties struct { // RecoverableDatabase a recoverable database type RecoverableDatabase struct { autorest.Response `json:"-"` + // RecoverableDatabaseProperties - The properties of a recoverable database + *RecoverableDatabaseProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // RecoverableDatabaseProperties - The properties of a recoverable database - *RecoverableDatabaseProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for RecoverableDatabase struct. @@ -4119,46 +4515,45 @@ func (rd *RecoverableDatabase) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties RecoverableDatabaseProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - rd.RecoverableDatabaseProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - rd.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - rd.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var recoverableDatabaseProperties RecoverableDatabaseProperties + err = json.Unmarshal(*v, &recoverableDatabaseProperties) + if err != nil { + return err + } + rd.RecoverableDatabaseProperties = &recoverableDatabaseProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rd.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rd.Type = &typeVar + } } - rd.Type = &typeVar } return nil @@ -4186,16 +4581,16 @@ type RecoverableDatabaseProperties struct { // ReplicationLink represents a database replication link. type ReplicationLink struct { autorest.Response `json:"-"` + // Location - Location of the server that contains this firewall rule. + Location *string `json:"location,omitempty"` + // ReplicationLinkProperties - The properties representing the resource. + *ReplicationLinkProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // Location - Location of the server that contains this firewall rule. - Location *string `json:"location,omitempty"` - // ReplicationLinkProperties - The properties representing the resource. - *ReplicationLinkProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ReplicationLink struct. @@ -4205,56 +4600,54 @@ func (rl *ReplicationLink) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - rl.Location = &location - } - - v = m["properties"] - if v != nil { - var properties ReplicationLinkProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - rl.ReplicationLinkProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - rl.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - rl.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rl.Location = &location + } + case "properties": + if v != nil { + var replicationLinkProperties ReplicationLinkProperties + err = json.Unmarshal(*v, &replicationLinkProperties) + if err != nil { + return err + } + rl.ReplicationLinkProperties = &replicationLinkProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rl.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rl.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rl.Type = &typeVar + } } - rl.Type = &typeVar } return nil @@ -4304,26 +4697,44 @@ func (future ReplicationLinksFailoverAllowDataLossFuture) Result(client Replicat var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.ReplicationLinksFailoverAllowDataLossFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("sql.ReplicationLinksFailoverAllowDataLossFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("sql.ReplicationLinksFailoverAllowDataLossFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.FailoverAllowDataLossResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ReplicationLinksFailoverAllowDataLossFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.ReplicationLinksFailoverAllowDataLossFuture", "Result", resp, "Failure sending request") return } ar, err = client.FailoverAllowDataLossResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ReplicationLinksFailoverAllowDataLossFuture", "Result", resp, "Failure responding to request") + } return } -// ReplicationLinksFailoverFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// ReplicationLinksFailoverFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type ReplicationLinksFailoverFuture struct { azure.Future req *http.Request @@ -4335,22 +4746,39 @@ func (future ReplicationLinksFailoverFuture) Result(client ReplicationLinksClien var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.ReplicationLinksFailoverFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("sql.ReplicationLinksFailoverFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("sql.ReplicationLinksFailoverFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.FailoverResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ReplicationLinksFailoverFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.ReplicationLinksFailoverFuture", "Result", resp, "Failure sending request") return } ar, err = client.FailoverResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ReplicationLinksFailoverFuture", "Result", resp, "Failure responding to request") + } return } @@ -4377,16 +4805,16 @@ type ResourceIdentity struct { // RestorableDroppedDatabase a restorable dropped database type RestorableDroppedDatabase struct { autorest.Response `json:"-"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // RestorableDroppedDatabaseProperties - The properties of a restorable dropped database + *RestorableDroppedDatabaseProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // Location - The geo-location where the resource lives - Location *string `json:"location,omitempty"` - // RestorableDroppedDatabaseProperties - The properties of a restorable dropped database - *RestorableDroppedDatabaseProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for RestorableDroppedDatabase struct. @@ -4396,56 +4824,54 @@ func (rdd *RestorableDroppedDatabase) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - rdd.Location = &location - } - - v = m["properties"] - if v != nil { - var properties RestorableDroppedDatabaseProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - rdd.RestorableDroppedDatabaseProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - rdd.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - rdd.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rdd.Location = &location + } + case "properties": + if v != nil { + var restorableDroppedDatabaseProperties RestorableDroppedDatabaseProperties + err = json.Unmarshal(*v, &restorableDroppedDatabaseProperties) + if err != nil { + return err + } + rdd.RestorableDroppedDatabaseProperties = &restorableDroppedDatabaseProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rdd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rdd.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rdd.Type = &typeVar + } } - rdd.Type = &typeVar } return nil @@ -4480,14 +4906,14 @@ type RestorableDroppedDatabaseProperties struct { // RestorePoint a database restore point. type RestorePoint struct { + // RestorePointProperties - The properties of the restore point. + *RestorePointProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // RestorePointProperties - The properties of the restore point. - *RestorePointProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for RestorePoint struct. @@ -4497,46 +4923,45 @@ func (rp *RestorePoint) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties RestorePointProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - rp.RestorePointProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - rp.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - rp.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var restorePointProperties RestorePointProperties + err = json.Unmarshal(*v, &restorePointProperties) + if err != nil { + return err + } + rp.RestorePointProperties = &restorePointProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rp.Type = &typeVar + } } - rp.Type = &typeVar } return nil @@ -4562,111 +4987,136 @@ type RestorePointProperties struct { // Server an Azure SQL Database server. type Server struct { autorest.Response `json:"-"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - Resource name. - Name *string `json:"name,omitempty"` - // Type - Resource type. - Type *string `json:"type,omitempty"` - // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` // Identity - The Azure Active Directory identity of the server. Identity *ResourceIdentity `json:"identity,omitempty"` // Kind - Kind of sql server. This is metadata used for the Azure portal experience. Kind *string `json:"kind,omitempty"` // ServerProperties - Resource properties. *ServerProperties `json:"properties,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for Server struct. -func (s *Server) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for Server. +func (s Server) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.Identity != nil { + objectMap["identity"] = s.Identity } - var v *json.RawMessage - - v = m["identity"] - if v != nil { - var identity ResourceIdentity - err = json.Unmarshal(*m["identity"], &identity) - if err != nil { - return err - } - s.Identity = &identity + if s.Kind != nil { + objectMap["kind"] = s.Kind } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - s.Kind = &kind + if s.ServerProperties != nil { + objectMap["properties"] = s.ServerProperties } - - v = m["properties"] - if v != nil { - var properties ServerProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - s.ServerProperties = &properties + if s.Tags != nil { + objectMap["tags"] = s.Tags } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - s.Tags = &tags + if s.Location != nil { + objectMap["location"] = s.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - s.Location = &location + if s.ID != nil { + objectMap["id"] = s.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - s.ID = &ID + if s.Name != nil { + objectMap["name"] = s.Name + } + if s.Type != nil { + objectMap["type"] = s.Type } + return json.Marshal(objectMap) +} - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - s.Name = &name +// UnmarshalJSON is the custom unmarshaler for Server struct. +func (s *Server) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "identity": + if v != nil { + var identity ResourceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + s.Identity = &identity + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + s.Kind = &kind + } + case "properties": + if v != nil { + var serverProperties ServerProperties + err = json.Unmarshal(*v, &serverProperties) + if err != nil { + return err + } + s.ServerProperties = &serverProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + s.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + s.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + s.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + s.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + s.Type = &typeVar + } } - s.Type = &typeVar } return nil @@ -4694,14 +5144,14 @@ type ServerAdministratorProperties struct { // ServerAzureADAdministrator an server Active Directory Administrator. type ServerAzureADAdministrator struct { autorest.Response `json:"-"` + // ServerAdministratorProperties - The properties of the resource. + *ServerAdministratorProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // ServerAdministratorProperties - The properties of the resource. - *ServerAdministratorProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ServerAzureADAdministrator struct. @@ -4711,46 +5161,45 @@ func (saaa *ServerAzureADAdministrator) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ServerAdministratorProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - saaa.ServerAdministratorProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - saaa.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - saaa.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var serverAdministratorProperties ServerAdministratorProperties + err = json.Unmarshal(*v, &serverAdministratorProperties) + if err != nil { + return err + } + saaa.ServerAdministratorProperties = &serverAdministratorProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + saaa.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + saaa.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + saaa.Type = &typeVar + } } - saaa.Type = &typeVar } return nil @@ -4769,27 +5218,44 @@ func (future ServerAzureADAdministratorsCreateOrUpdateFuture) Result(client Serv var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return saaa, autorest.NewError("sql.ServerAzureADAdministratorsCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return saaa, azure.NewAsyncOpIncompleteError("sql.ServerAzureADAdministratorsCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { saaa, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } saaa, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } -// ServerAzureADAdministratorsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// ServerAzureADAdministratorsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type ServerAzureADAdministratorsDeleteFuture struct { azure.Future req *http.Request @@ -4801,40 +5267,57 @@ func (future ServerAzureADAdministratorsDeleteFuture) Result(client ServerAzureA var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return saaa, autorest.NewError("sql.ServerAzureADAdministratorsDeleteFuture", "Result", "asynchronous operation has not completed") + return saaa, azure.NewAsyncOpIncompleteError("sql.ServerAzureADAdministratorsDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { saaa, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsDeleteFuture", "Result", resp, "Failure sending request") return } saaa, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsDeleteFuture", "Result", resp, "Failure responding to request") + } return } // ServerCommunicationLink server communication link. type ServerCommunicationLink struct { autorest.Response `json:"-"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - Resource name. - Name *string `json:"name,omitempty"` - // Type - Resource type. - Type *string `json:"type,omitempty"` // ServerCommunicationLinkProperties - The properties of resource. *ServerCommunicationLinkProperties `json:"properties,omitempty"` // Location - Communication link location. Location *string `json:"location,omitempty"` // Kind - Communication link kind. This property is used for Azure Portal metadata. Kind *string `json:"kind,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ServerCommunicationLink struct. @@ -4844,66 +5327,63 @@ func (scl *ServerCommunicationLink) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ServerCommunicationLinkProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - scl.ServerCommunicationLinkProperties = &properties - } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - scl.Location = &location - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - scl.Kind = &kind - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - scl.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - scl.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var serverCommunicationLinkProperties ServerCommunicationLinkProperties + err = json.Unmarshal(*v, &serverCommunicationLinkProperties) + if err != nil { + return err + } + scl.ServerCommunicationLinkProperties = &serverCommunicationLinkProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + scl.Location = &location + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + scl.Kind = &kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + scl.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + scl.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + scl.Type = &typeVar + } } - scl.Type = &typeVar } return nil @@ -4937,40 +5417,57 @@ func (future ServerCommunicationLinksCreateOrUpdateFuture) Result(client ServerC var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerCommunicationLinksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return scl, autorest.NewError("sql.ServerCommunicationLinksCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return scl, azure.NewAsyncOpIncompleteError("sql.ServerCommunicationLinksCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { scl, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerCommunicationLinksCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerCommunicationLinksCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } scl, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerCommunicationLinksCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } // ServerConnectionPolicy a server secure connection policy. type ServerConnectionPolicy struct { autorest.Response `json:"-"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - Resource name. - Name *string `json:"name,omitempty"` - // Type - Resource type. - Type *string `json:"type,omitempty"` // Kind - Metadata used for the Azure portal experience. Kind *string `json:"kind,omitempty"` // Location - Resource location. Location *string `json:"location,omitempty"` // ServerConnectionPolicyProperties - The properties of the server secure connection policy. *ServerConnectionPolicyProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ServerConnectionPolicy struct. @@ -4980,66 +5477,63 @@ func (scp *ServerConnectionPolicy) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - scp.Kind = &kind - } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - scp.Location = &location - } - - v = m["properties"] - if v != nil { - var properties ServerConnectionPolicyProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - scp.ServerConnectionPolicyProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - scp.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - scp.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + scp.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + scp.Location = &location + } + case "properties": + if v != nil { + var serverConnectionPolicyProperties ServerConnectionPolicyProperties + err = json.Unmarshal(*v, &serverConnectionPolicyProperties) + if err != nil { + return err + } + scp.ServerConnectionPolicyProperties = &serverConnectionPolicyProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + scp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + scp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + scp.Type = &typeVar + } } - scp.Type = &typeVar } return nil @@ -5054,18 +5548,18 @@ type ServerConnectionPolicyProperties struct { // ServerKey a server key. type ServerKey struct { autorest.Response `json:"-"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - Resource name. - Name *string `json:"name,omitempty"` - // Type - Resource type. - Type *string `json:"type,omitempty"` // Kind - Kind of encryption protector. This is metadata used for the Azure portal experience. Kind *string `json:"kind,omitempty"` // Location - Resource location. Location *string `json:"location,omitempty"` // ServerKeyProperties - Resource properties. *ServerKeyProperties `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ServerKey struct. @@ -5075,66 +5569,63 @@ func (sk *ServerKey) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - sk.Kind = &kind - } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - sk.Location = &location - } - - v = m["properties"] - if v != nil { - var properties ServerKeyProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - sk.ServerKeyProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - sk.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - sk.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sk.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + sk.Location = &location + } + case "properties": + if v != nil { + var serverKeyProperties ServerKeyProperties + err = json.Unmarshal(*v, &serverKeyProperties) + if err != nil { + return err + } + sk.ServerKeyProperties = &serverKeyProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sk.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sk.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sk.Type = &typeVar + } } - sk.Type = &typeVar } return nil @@ -5256,7 +5747,8 @@ type ServerKeyProperties struct { CreationDate *date.Time `json:"creationDate,omitempty"` } -// ServerKeysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// ServerKeysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type ServerKeysCreateOrUpdateFuture struct { azure.Future req *http.Request @@ -5268,22 +5760,39 @@ func (future ServerKeysCreateOrUpdateFuture) Result(client ServerKeysClient) (sk var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerKeysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return sk, autorest.NewError("sql.ServerKeysCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return sk, azure.NewAsyncOpIncompleteError("sql.ServerKeysCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { sk, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerKeysCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerKeysCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } sk, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerKeysCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -5299,22 +5808,39 @@ func (future ServerKeysDeleteFuture) Result(client ServerKeysClient) (ar autores var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerKeysDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("sql.ServerKeysDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("sql.ServerKeysDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerKeysDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerKeysDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServerKeysDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -5434,7 +5960,8 @@ type ServerProperties struct { FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty"` } -// ServersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// ServersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type ServersCreateOrUpdateFuture struct { azure.Future req *http.Request @@ -5446,22 +5973,39 @@ func (future ServersCreateOrUpdateFuture) Result(client ServersClient) (s Server var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return s, autorest.NewError("sql.ServersCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return s, azure.NewAsyncOpIncompleteError("sql.ServersCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { s, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServersCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServersCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } s, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServersCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -5477,22 +6021,39 @@ func (future ServersDeleteFuture) Result(client ServersClient) (ar autorest.Resp var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServersDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("sql.ServersDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("sql.ServersDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServersDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServersDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServersDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -5508,22 +6069,39 @@ func (future ServersUpdateFuture) Result(client ServersClient) (s Server, err er var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServersUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return s, autorest.NewError("sql.ServersUpdateFuture", "Result", "asynchronous operation has not completed") + return s, azure.NewAsyncOpIncompleteError("sql.ServersUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { s, err = client.UpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServersUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServersUpdateFuture", "Result", resp, "Failure sending request") return } s, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ServersUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -5532,7 +6110,19 @@ type ServerUpdate struct { // ServerProperties - Resource properties. *ServerProperties `json:"properties,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ServerUpdate. +func (su ServerUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if su.ServerProperties != nil { + objectMap["properties"] = su.ServerProperties + } + if su.Tags != nil { + objectMap["tags"] = su.Tags + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ServerUpdate struct. @@ -5542,26 +6132,27 @@ func (su *ServerUpdate) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ServerProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - su.ServerProperties = &properties - } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var serverProperties ServerProperties + err = json.Unmarshal(*v, &serverProperties) + if err != nil { + return err + } + su.ServerProperties = &serverProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + su.Tags = tags + } } - su.Tags = &tags } return nil @@ -5627,14 +6218,14 @@ type ServiceLevelObjectiveCapability struct { // ServiceObjective represents a database service objective. type ServiceObjective struct { autorest.Response `json:"-"` + // ServiceObjectiveProperties - Represents the properties of the resource. + *ServiceObjectiveProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // ServiceObjectiveProperties - Represents the properties of the resource. - *ServiceObjectiveProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ServiceObjective struct. @@ -5644,46 +6235,45 @@ func (so *ServiceObjective) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ServiceObjectiveProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - so.ServiceObjectiveProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - so.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - so.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var serviceObjectiveProperties ServiceObjectiveProperties + err = json.Unmarshal(*v, &serviceObjectiveProperties) + if err != nil { + return err + } + so.ServiceObjectiveProperties = &serviceObjectiveProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + so.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + so.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + so.Type = &typeVar + } } - so.Type = &typeVar } return nil @@ -5713,14 +6303,14 @@ type ServiceObjectiveProperties struct { // ServiceTierAdvisor represents a Service Tier Advisor. type ServiceTierAdvisor struct { autorest.Response `json:"-"` + // ServiceTierAdvisorProperties - The properites representing the resource. + *ServiceTierAdvisorProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // ServiceTierAdvisorProperties - The properites representing the resource. - *ServiceTierAdvisorProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ServiceTierAdvisor struct. @@ -5730,46 +6320,45 @@ func (sta *ServiceTierAdvisor) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ServiceTierAdvisorProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - sta.ServiceTierAdvisorProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - sta.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - sta.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var serviceTierAdvisorProperties ServiceTierAdvisorProperties + err = json.Unmarshal(*v, &serviceTierAdvisorProperties) + if err != nil { + return err + } + sta.ServiceTierAdvisorProperties = &serviceTierAdvisorProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sta.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sta.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sta.Type = &typeVar + } } - sta.Type = &typeVar } return nil @@ -5837,63 +6426,62 @@ type SloUsageMetric struct { // SubscriptionUsage usage Metric of a Subscription in a Location. type SubscriptionUsage struct { autorest.Response `json:"-"` + // SubscriptionUsageProperties - Resource properties. + *SubscriptionUsageProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` - // Type - Resource type. - Type *string `json:"type,omitempty"` - // SubscriptionUsageProperties - Resource properties. - *SubscriptionUsageProperties `json:"properties,omitempty"` -} - -// UnmarshalJSON is the custom unmarshaler for SubscriptionUsage struct. -func (su *SubscriptionUsage) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties SubscriptionUsageProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - su.SubscriptionUsageProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - su.ID = &ID - } + // Type - Resource type. + Type *string `json:"type,omitempty"` +} - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - su.Name = &name +// UnmarshalJSON is the custom unmarshaler for SubscriptionUsage struct. +func (su *SubscriptionUsage) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var subscriptionUsageProperties SubscriptionUsageProperties + err = json.Unmarshal(*v, &subscriptionUsageProperties) + if err != nil { + return err + } + su.SubscriptionUsageProperties = &subscriptionUsageProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + su.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + su.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + su.Type = &typeVar + } } - su.Type = &typeVar } return nil @@ -6016,14 +6604,14 @@ type SubscriptionUsageProperties struct { // SyncAgent an Azure SQL Database sync agent. type SyncAgent struct { autorest.Response `json:"-"` + // SyncAgentProperties - Resource properties. + *SyncAgentProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // SyncAgentProperties - Resource properties. - *SyncAgentProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for SyncAgent struct. @@ -6033,46 +6621,45 @@ func (sa *SyncAgent) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties SyncAgentProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - sa.SyncAgentProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - sa.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - sa.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var syncAgentProperties SyncAgentProperties + err = json.Unmarshal(*v, &syncAgentProperties) + if err != nil { + return err + } + sa.SyncAgentProperties = &syncAgentProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sa.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sa.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sa.Type = &typeVar + } } - sa.Type = &typeVar } return nil @@ -6087,14 +6674,14 @@ type SyncAgentKeyProperties struct { // SyncAgentLinkedDatabase an Azure SQL Database sync agent linked database. type SyncAgentLinkedDatabase struct { + // SyncAgentLinkedDatabaseProperties - Resource properties. + *SyncAgentLinkedDatabaseProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // SyncAgentLinkedDatabaseProperties - Resource properties. - *SyncAgentLinkedDatabaseProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for SyncAgentLinkedDatabase struct. @@ -6104,46 +6691,45 @@ func (sald *SyncAgentLinkedDatabase) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties SyncAgentLinkedDatabaseProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - sald.SyncAgentLinkedDatabaseProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - sald.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - sald.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var syncAgentLinkedDatabaseProperties SyncAgentLinkedDatabaseProperties + err = json.Unmarshal(*v, &syncAgentLinkedDatabaseProperties) + if err != nil { + return err + } + sald.SyncAgentLinkedDatabaseProperties = &syncAgentLinkedDatabaseProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sald.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sald.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sald.Type = &typeVar + } } - sald.Type = &typeVar } return nil @@ -6158,7 +6744,8 @@ type SyncAgentLinkedDatabaseListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// SyncAgentLinkedDatabaseListResultIterator provides access to a complete listing of SyncAgentLinkedDatabase values. +// SyncAgentLinkedDatabaseListResultIterator provides access to a complete listing of SyncAgentLinkedDatabase +// values. type SyncAgentLinkedDatabaseListResultIterator struct { i int page SyncAgentLinkedDatabaseListResultPage @@ -6387,7 +6974,8 @@ type SyncAgentProperties struct { Version *string `json:"version,omitempty"` } -// SyncAgentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// SyncAgentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type SyncAgentsCreateOrUpdateFuture struct { azure.Future req *http.Request @@ -6399,22 +6987,39 @@ func (future SyncAgentsCreateOrUpdateFuture) Result(client SyncAgentsClient) (sa var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncAgentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return sa, autorest.NewError("sql.SyncAgentsCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return sa, azure.NewAsyncOpIncompleteError("sql.SyncAgentsCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { sa, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncAgentsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncAgentsCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } sa, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncAgentsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -6430,22 +7035,39 @@ func (future SyncAgentsDeleteFuture) Result(client SyncAgentsClient) (ar autores var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncAgentsDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("sql.SyncAgentsDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("sql.SyncAgentsDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncAgentsDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncAgentsDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncAgentsDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -6574,7 +7196,8 @@ type SyncFullSchemaPropertiesListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// SyncFullSchemaPropertiesListResultIterator provides access to a complete listing of SyncFullSchemaProperties values. +// SyncFullSchemaPropertiesListResultIterator provides access to a complete listing of SyncFullSchemaProperties +// values. type SyncFullSchemaPropertiesListResultIterator struct { i int page SyncFullSchemaPropertiesListResultPage @@ -6702,14 +7325,14 @@ type SyncFullSchemaTableColumn struct { // SyncGroup an Azure SQL Database sync group. type SyncGroup struct { autorest.Response `json:"-"` + // SyncGroupProperties - Resource properties. + *SyncGroupProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // SyncGroupProperties - Resource properties. - *SyncGroupProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for SyncGroup struct. @@ -6719,46 +7342,45 @@ func (sg *SyncGroup) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties SyncGroupProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - sg.SyncGroupProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - sg.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - sg.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var syncGroupProperties SyncGroupProperties + err = json.Unmarshal(*v, &syncGroupProperties) + if err != nil { + return err + } + sg.SyncGroupProperties = &syncGroupProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sg.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sg.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sg.Type = &typeVar + } } - sg.Type = &typeVar } return nil @@ -7030,7 +7652,8 @@ type SyncGroupSchemaTableColumn struct { DataType *string `json:"dataType,omitempty"` } -// SyncGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// SyncGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type SyncGroupsCreateOrUpdateFuture struct { azure.Future req *http.Request @@ -7042,22 +7665,39 @@ func (future SyncGroupsCreateOrUpdateFuture) Result(client SyncGroupsClient) (sg var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return sg, autorest.NewError("sql.SyncGroupsCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return sg, azure.NewAsyncOpIncompleteError("sql.SyncGroupsCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { sg, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncGroupsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncGroupsCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } sg, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncGroupsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -7073,22 +7713,39 @@ func (future SyncGroupsDeleteFuture) Result(client SyncGroupsClient) (ar autores var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncGroupsDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("sql.SyncGroupsDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("sql.SyncGroupsDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncGroupsDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncGroupsDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncGroupsDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -7105,22 +7762,39 @@ func (future SyncGroupsRefreshHubSchemaFuture) Result(client SyncGroupsClient) ( var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncGroupsRefreshHubSchemaFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("sql.SyncGroupsRefreshHubSchemaFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("sql.SyncGroupsRefreshHubSchemaFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.RefreshHubSchemaResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncGroupsRefreshHubSchemaFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncGroupsRefreshHubSchemaFuture", "Result", resp, "Failure sending request") return } ar, err = client.RefreshHubSchemaResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncGroupsRefreshHubSchemaFuture", "Result", resp, "Failure responding to request") + } return } @@ -7136,36 +7810,53 @@ func (future SyncGroupsUpdateFuture) Result(client SyncGroupsClient) (sg SyncGro var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncGroupsUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return sg, autorest.NewError("sql.SyncGroupsUpdateFuture", "Result", "asynchronous operation has not completed") + return sg, azure.NewAsyncOpIncompleteError("sql.SyncGroupsUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { sg, err = client.UpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncGroupsUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncGroupsUpdateFuture", "Result", resp, "Failure sending request") return } sg, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncGroupsUpdateFuture", "Result", resp, "Failure responding to request") + } return } // SyncMember an Azure SQL Database sync member. type SyncMember struct { autorest.Response `json:"-"` + // SyncMemberProperties - Resource properties. + *SyncMemberProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // SyncMemberProperties - Resource properties. - *SyncMemberProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for SyncMember struct. @@ -7175,46 +7866,45 @@ func (sm *SyncMember) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties SyncMemberProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - sm.SyncMemberProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - sm.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - sm.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var syncMemberProperties SyncMemberProperties + err = json.Unmarshal(*v, &syncMemberProperties) + if err != nil { + return err + } + sm.SyncMemberProperties = &syncMemberProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sm.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sm.Type = &typeVar + } } - sm.Type = &typeVar } return nil @@ -7357,22 +8047,39 @@ func (future SyncMembersCreateOrUpdateFuture) Result(client SyncMembersClient) ( var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncMembersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return sm, autorest.NewError("sql.SyncMembersCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return sm, azure.NewAsyncOpIncompleteError("sql.SyncMembersCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { sm, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncMembersCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncMembersCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } sm, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncMembersCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -7388,22 +8095,39 @@ func (future SyncMembersDeleteFuture) Result(client SyncMembersClient) (ar autor var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncMembersDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("sql.SyncMembersDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("sql.SyncMembersDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncMembersDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncMembersDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncMembersDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -7420,22 +8144,39 @@ func (future SyncMembersRefreshMemberSchemaFuture) Result(client SyncMembersClie var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncMembersRefreshMemberSchemaFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("sql.SyncMembersRefreshMemberSchemaFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("sql.SyncMembersRefreshMemberSchemaFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.RefreshMemberSchemaResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncMembersRefreshMemberSchemaFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncMembersRefreshMemberSchemaFuture", "Result", resp, "Failure sending request") return } ar, err = client.RefreshMemberSchemaResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncMembersRefreshMemberSchemaFuture", "Result", resp, "Failure responding to request") + } return } @@ -7451,52 +8192,90 @@ func (future SyncMembersUpdateFuture) Result(client SyncMembersClient) (sm SyncM var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncMembersUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return sm, autorest.NewError("sql.SyncMembersUpdateFuture", "Result", "asynchronous operation has not completed") + return sm, azure.NewAsyncOpIncompleteError("sql.SyncMembersUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { sm, err = client.UpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncMembersUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncMembersUpdateFuture", "Result", resp, "Failure sending request") return } sm, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.SyncMembersUpdateFuture", "Result", resp, "Failure responding to request") + } return } // TrackedResource ARM tracked top level resource. type TrackedResource struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - Resource location. + Location *string `json:"location,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // Location - Resource location. - Location *string `json:"location,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 + } + if tr.ID != nil { + objectMap["id"] = tr.ID + } + if tr.Name != nil { + objectMap["name"] = tr.Name + } + if tr.Type != nil { + objectMap["type"] = tr.Type + } + return json.Marshal(objectMap) } // TransparentDataEncryption represents a database transparent data encryption configuration. type TransparentDataEncryption struct { autorest.Response `json:"-"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // TransparentDataEncryptionProperties - Represents the properties of the resource. + *TransparentDataEncryptionProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // TransparentDataEncryptionProperties - Represents the properties of the resource. - *TransparentDataEncryptionProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for TransparentDataEncryption struct. @@ -7506,56 +8285,54 @@ func (tde *TransparentDataEncryption) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - tde.Location = &location - } - - v = m["properties"] - if v != nil { - var properties TransparentDataEncryptionProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - tde.TransparentDataEncryptionProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - tde.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - tde.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + tde.Location = &location + } + case "properties": + if v != nil { + var transparentDataEncryptionProperties TransparentDataEncryptionProperties + err = json.Unmarshal(*v, &transparentDataEncryptionProperties) + if err != nil { + return err + } + tde.TransparentDataEncryptionProperties = &transparentDataEncryptionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + tde.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + tde.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + tde.Type = &typeVar + } } - tde.Type = &typeVar } return nil @@ -7563,16 +8340,16 @@ func (tde *TransparentDataEncryption) UnmarshalJSON(body []byte) error { // TransparentDataEncryptionActivity represents a database transparent data encryption Scan. type TransparentDataEncryptionActivity struct { + // Location - Resource location. + Location *string `json:"location,omitempty"` + // TransparentDataEncryptionActivityProperties - Represents the properties of the resource. + *TransparentDataEncryptionActivityProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // TransparentDataEncryptionActivityProperties - Represents the properties of the resource. - *TransparentDataEncryptionActivityProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for TransparentDataEncryptionActivity struct. @@ -7582,63 +8359,61 @@ func (tdea *TransparentDataEncryptionActivity) UnmarshalJSON(body []byte) error if err != nil { return err } - var v *json.RawMessage - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - tdea.Location = &location - } - - v = m["properties"] - if v != nil { - var properties TransparentDataEncryptionActivityProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - tdea.TransparentDataEncryptionActivityProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - tdea.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - tdea.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + tdea.Location = &location + } + case "properties": + if v != nil { + var transparentDataEncryptionActivityProperties TransparentDataEncryptionActivityProperties + err = json.Unmarshal(*v, &transparentDataEncryptionActivityProperties) + if err != nil { + return err + } + tdea.TransparentDataEncryptionActivityProperties = &transparentDataEncryptionActivityProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + tdea.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + tdea.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + tdea.Type = &typeVar + } } - tdea.Type = &typeVar } return nil } -// TransparentDataEncryptionActivityListResult represents the response to a list database transparent data encryption -// activity request. +// TransparentDataEncryptionActivityListResult represents the response to a list database transparent data +// encryption activity request. type TransparentDataEncryptionActivityListResult struct { autorest.Response `json:"-"` // Value - The list of database transparent data encryption activities. @@ -7663,14 +8438,14 @@ type TransparentDataEncryptionProperties struct { // VirtualNetworkRule a virtual network rule. type VirtualNetworkRule struct { autorest.Response `json:"-"` + // VirtualNetworkRuleProperties - Resource properties. + *VirtualNetworkRuleProperties `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` // Name - Resource name. Name *string `json:"name,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // VirtualNetworkRuleProperties - Resource properties. - *VirtualNetworkRuleProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for VirtualNetworkRule struct. @@ -7680,46 +8455,45 @@ func (vnr *VirtualNetworkRule) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties VirtualNetworkRuleProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - vnr.VirtualNetworkRuleProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - vnr.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - vnr.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var virtualNetworkRuleProperties VirtualNetworkRuleProperties + err = json.Unmarshal(*v, &virtualNetworkRuleProperties) + if err != nil { + return err + } + vnr.VirtualNetworkRuleProperties = &virtualNetworkRuleProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vnr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vnr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vnr.Type = &typeVar + } } - vnr.Type = &typeVar } return nil @@ -7837,8 +8611,8 @@ type VirtualNetworkRuleProperties struct { State VirtualNetworkRuleState `json:"state,omitempty"` } -// VirtualNetworkRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// VirtualNetworkRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type VirtualNetworkRulesCreateOrUpdateFuture struct { azure.Future req *http.Request @@ -7850,22 +8624,39 @@ func (future VirtualNetworkRulesCreateOrUpdateFuture) Result(client VirtualNetwo var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return vnr, autorest.NewError("sql.VirtualNetworkRulesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return vnr, azure.NewAsyncOpIncompleteError("sql.VirtualNetworkRulesCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { vnr, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } vnr, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -7882,21 +8673,38 @@ func (future VirtualNetworkRulesDeleteFuture) Result(client VirtualNetworkRulesC var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("sql.VirtualNetworkRulesDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("sql.VirtualNetworkRulesDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesDeleteFuture", "Result", resp, "Failure responding to request") + } return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/recommendedelasticpools.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/recommendedelasticpools.go index eaaa0769953c..477ef5119e90 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/recommendedelasticpools.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/recommendedelasticpools.go @@ -43,9 +43,9 @@ func NewRecommendedElasticPoolsClientWithBaseURI(baseURI string, subscriptionID // Get gets a recommented elastic pool. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. recommendedElasticPoolName is the -// name of the recommended elastic pool to be retrieved. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. recommendedElasticPoolName +// is the name of the recommended elastic pool to be retrieved. func (client RecommendedElasticPoolsClient) Get(ctx context.Context, resourceGroupName string, serverName string, recommendedElasticPoolName string) (result RecommendedElasticPool, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, serverName, recommendedElasticPoolName) if err != nil { @@ -112,8 +112,8 @@ func (client RecommendedElasticPoolsClient) GetResponder(resp *http.Response) (r // ListByServer returns recommended elastic pools. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. func (client RecommendedElasticPoolsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result RecommendedElasticPoolListResult, err error) { req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) if err != nil { @@ -179,9 +179,9 @@ func (client RecommendedElasticPoolsClient) ListByServerResponder(resp *http.Res // ListMetrics returns recommented elastic pool metrics. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. recommendedElasticPoolName is the -// name of the recommended elastic pool to be retrieved. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. recommendedElasticPoolName +// is the name of the recommended elastic pool to be retrieved. func (client RecommendedElasticPoolsClient) ListMetrics(ctx context.Context, resourceGroupName string, serverName string, recommendedElasticPoolName string) (result RecommendedElasticPoolListMetricsResult, err error) { req, err := client.ListMetricsPreparer(ctx, resourceGroupName, serverName, recommendedElasticPoolName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/recoverabledatabases.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/recoverabledatabases.go index aa32bd5765d7..54ac2e72645f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/recoverabledatabases.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/recoverabledatabases.go @@ -43,9 +43,9 @@ func NewRecoverableDatabasesClientWithBaseURI(baseURI string, subscriptionID str // Get gets a recoverable database, which is a resource representing a database's geo backup // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database func (client RecoverableDatabasesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result RecoverableDatabase, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, serverName, databaseName) if err != nil { @@ -112,8 +112,8 @@ func (client RecoverableDatabasesClient) GetResponder(resp *http.Response) (resu // ListByServer gets a list of recoverable databases // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. func (client RecoverableDatabasesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result RecoverableDatabaseListResult, err error) { req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/replicationlinks.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/replicationlinks.go index 8e9237d999ae..ad939db52788 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/replicationlinks.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/replicationlinks.go @@ -43,9 +43,10 @@ func NewReplicationLinksClientWithBaseURI(baseURI string, subscriptionID string) // Delete deletes a database replication link. Cannot be done during failover. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database that has the replication link to be dropped. linkID is the ID of the replication link to be deleted. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database that has the replication link to be dropped. linkID is the ID of the replication link to be +// deleted. func (client ReplicationLinksClient) Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string) (result autorest.Response, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, databaseName, linkID) if err != nil { @@ -112,10 +113,10 @@ func (client ReplicationLinksClient) DeleteResponder(resp *http.Response) (resul // Failover sets which replica database is primary by failing over from the current primary replica database. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database that has the replication link to be failed over. linkID is the ID of the replication link to be failed -// over. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database that has the replication link to be failed over. linkID is the ID of the replication link to be +// failed over. func (client ReplicationLinksClient) Failover(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string) (result ReplicationLinksFailoverFuture, err error) { req, err := client.FailoverPreparer(ctx, resourceGroupName, serverName, databaseName, linkID) if err != nil { @@ -185,10 +186,10 @@ func (client ReplicationLinksClient) FailoverResponder(resp *http.Response) (res // FailoverAllowDataLoss sets which replica database is primary by failing over from the current primary replica // database. This operation might result in data loss. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database that has the replication link to be failed over. linkID is the ID of the replication link to be failed -// over. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database that has the replication link to be failed over. linkID is the ID of the replication link to be +// failed over. func (client ReplicationLinksClient) FailoverAllowDataLoss(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string) (result ReplicationLinksFailoverAllowDataLossFuture, err error) { req, err := client.FailoverAllowDataLossPreparer(ctx, resourceGroupName, serverName, databaseName, linkID) if err != nil { @@ -257,9 +258,9 @@ func (client ReplicationLinksClient) FailoverAllowDataLossResponder(resp *http.R // Get gets a database replication link. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database to get the link for. linkID is the replication link ID to be retrieved. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database to get the link for. linkID is the replication link ID to be retrieved. func (client ReplicationLinksClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string) (result ReplicationLink, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, serverName, databaseName, linkID) if err != nil { @@ -327,9 +328,9 @@ func (client ReplicationLinksClient) GetResponder(resp *http.Response) (result R // ListByDatabase lists a database's replication links. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database to retrieve links for. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database to retrieve links for. func (client ReplicationLinksClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result ReplicationLinkListResult, err error) { req, err := client.ListByDatabasePreparer(ctx, resourceGroupName, serverName, databaseName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/restorabledroppeddatabases.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/restorabledroppeddatabases.go index 9436840af624..f8813b6301f5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/restorabledroppeddatabases.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/restorabledroppeddatabases.go @@ -43,9 +43,10 @@ func NewRestorableDroppedDatabasesClientWithBaseURI(baseURI string, subscription // Get gets a deleted database that can be restored // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. restorableDroppededDatabaseID is the -// id of the deleted database in the form of databaseName,deletionTimeInFileTimeFormat +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. +// restorableDroppededDatabaseID is the id of the deleted database in the form of +// databaseName,deletionTimeInFileTimeFormat func (client RestorableDroppedDatabasesClient) Get(ctx context.Context, resourceGroupName string, serverName string, restorableDroppededDatabaseID string) (result RestorableDroppedDatabase, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, serverName, restorableDroppededDatabaseID) if err != nil { @@ -112,8 +113,8 @@ func (client RestorableDroppedDatabasesClient) GetResponder(resp *http.Response) // ListByServer gets a list of deleted databases that can be restored // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. func (client RestorableDroppedDatabasesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result RestorableDroppedDatabaseListResult, err error) { req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/restorepoints.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/restorepoints.go index 90a42b0679bd..b76f8b09a4d9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/restorepoints.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/restorepoints.go @@ -43,9 +43,9 @@ func NewRestorePointsClientWithBaseURI(baseURI string, subscriptionID string) Re // ListByDatabase gets a list of database restore points. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database to get available restore points. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database to get available restore points. func (client RestorePointsClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result RestorePointListResult, err error) { req, err := client.ListByDatabasePreparer(ctx, resourceGroupName, serverName, databaseName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/serverazureadadministrators.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/serverazureadadministrators.go index c6c435227a6a..423905f6e1cb 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/serverazureadadministrators.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/serverazureadadministrators.go @@ -45,11 +45,10 @@ func NewServerAzureADAdministratorsClientWithBaseURI(baseURI string, subscriptio // CreateOrUpdate creates a new Server Active Directory Administrator or updates an existing server Active Directory // Administrator. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. administratorName is name of the -// server administrator resource. properties is the required parameters for creating or updating an Active Directory -// Administrator. -func (client ServerAzureADAdministratorsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, administratorName string, properties ServerAzureADAdministrator) (result ServerAzureADAdministratorsCreateOrUpdateFuture, err error) { +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. properties is the required +// parameters for creating or updating an Active Directory Administrator. +func (client ServerAzureADAdministratorsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, properties ServerAzureADAdministrator) (result ServerAzureADAdministratorsCreateOrUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: properties, Constraints: []validation.Constraint{{Target: "properties.ServerAdministratorProperties", Name: validation.Null, Rule: false, @@ -58,10 +57,10 @@ func (client ServerAzureADAdministratorsClient) CreateOrUpdate(ctx context.Conte {Target: "properties.ServerAdministratorProperties.Sid", Name: validation.Null, Rule: true, Chain: nil}, {Target: "properties.ServerAdministratorProperties.TenantID", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "sql.ServerAzureADAdministratorsClient", "CreateOrUpdate") + return result, validation.NewError("sql.ServerAzureADAdministratorsClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, administratorName, properties) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, properties) if err != nil { err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -77,9 +76,9 @@ func (client ServerAzureADAdministratorsClient) CreateOrUpdate(ctx context.Conte } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ServerAzureADAdministratorsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, administratorName string, properties ServerAzureADAdministrator) (*http.Request, error) { +func (client ServerAzureADAdministratorsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, properties ServerAzureADAdministrator) (*http.Request, error) { pathParameters := map[string]interface{}{ - "administratorName": autorest.Encode("path", administratorName), + "administratorName": autorest.Encode("path", "activeDirectory"), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -130,11 +129,10 @@ func (client ServerAzureADAdministratorsClient) CreateOrUpdateResponder(resp *ht // Delete deletes an existing server Active Directory Administrator. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. administratorName is name of the -// server administrator resource. -func (client ServerAzureADAdministratorsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, administratorName string) (result ServerAzureADAdministratorsDeleteFuture, err error) { - req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, administratorName) +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. +func (client ServerAzureADAdministratorsClient) Delete(ctx context.Context, resourceGroupName string, serverName string) (result ServerAzureADAdministratorsDeleteFuture, err error) { + req, err := client.DeletePreparer(ctx, resourceGroupName, serverName) if err != nil { err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsClient", "Delete", nil, "Failure preparing request") return @@ -150,9 +148,9 @@ func (client ServerAzureADAdministratorsClient) Delete(ctx context.Context, reso } // DeletePreparer prepares the Delete request. -func (client ServerAzureADAdministratorsClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, administratorName string) (*http.Request, error) { +func (client ServerAzureADAdministratorsClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "administratorName": autorest.Encode("path", administratorName), + "administratorName": autorest.Encode("path", "activeDirectory"), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -201,11 +199,10 @@ func (client ServerAzureADAdministratorsClient) DeleteResponder(resp *http.Respo // Get returns an server Administrator. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. administratorName is name of the -// server administrator resource. -func (client ServerAzureADAdministratorsClient) Get(ctx context.Context, resourceGroupName string, serverName string, administratorName string) (result ServerAzureADAdministrator, err error) { - req, err := client.GetPreparer(ctx, resourceGroupName, serverName, administratorName) +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. +func (client ServerAzureADAdministratorsClient) Get(ctx context.Context, resourceGroupName string, serverName string) (result ServerAzureADAdministrator, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, serverName) if err != nil { err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsClient", "Get", nil, "Failure preparing request") return @@ -227,9 +224,9 @@ func (client ServerAzureADAdministratorsClient) Get(ctx context.Context, resourc } // GetPreparer prepares the Get request. -func (client ServerAzureADAdministratorsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, administratorName string) (*http.Request, error) { +func (client ServerAzureADAdministratorsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "administratorName": autorest.Encode("path", administratorName), + "administratorName": autorest.Encode("path", "activeDirectory"), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -270,8 +267,8 @@ func (client ServerAzureADAdministratorsClient) GetResponder(resp *http.Response // ListByServer returns a list of server Administrators. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. func (client ServerAzureADAdministratorsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result ServerAdministratorListResult, err error) { req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/servercommunicationlinks.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/servercommunicationlinks.go index 32025cd027bc..3cfae425df8a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/servercommunicationlinks.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/servercommunicationlinks.go @@ -44,15 +44,16 @@ func NewServerCommunicationLinksClientWithBaseURI(baseURI string, subscriptionID // CreateOrUpdate creates a server communication link. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. communicationLinkName is the name of -// the server communication link. parameters is the required parameters for creating a server communication link. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. communicationLinkName is the +// name of the server communication link. parameters is the required parameters for creating a server communication +// link. func (client ServerCommunicationLinksClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string, parameters ServerCommunicationLink) (result ServerCommunicationLinksCreateOrUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.ServerCommunicationLinkProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.ServerCommunicationLinkProperties.PartnerServer", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "sql.ServerCommunicationLinksClient", "CreateOrUpdate") + return result, validation.NewError("sql.ServerCommunicationLinksClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, communicationLinkName, parameters) @@ -124,9 +125,9 @@ func (client ServerCommunicationLinksClient) CreateOrUpdateResponder(resp *http. // Delete deletes a server communication link. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. communicationLinkName is the name of -// the server communication link. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. communicationLinkName is the +// name of the server communication link. func (client ServerCommunicationLinksClient) Delete(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string) (result autorest.Response, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, communicationLinkName) if err != nil { @@ -192,9 +193,9 @@ func (client ServerCommunicationLinksClient) DeleteResponder(resp *http.Response // Get returns a server communication link. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. communicationLinkName is the name of -// the server communication link. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. communicationLinkName is the +// name of the server communication link. func (client ServerCommunicationLinksClient) Get(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string) (result ServerCommunicationLink, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, serverName, communicationLinkName) if err != nil { @@ -261,8 +262,8 @@ func (client ServerCommunicationLinksClient) GetResponder(resp *http.Response) ( // ListByServer gets a list of server communication links. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. func (client ServerCommunicationLinksClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result ServerCommunicationLinkListResult, err error) { req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/serverconnectionpolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/serverconnectionpolicies.go index ce3239745cfb..0a576993f1d9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/serverconnectionpolicies.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/serverconnectionpolicies.go @@ -43,11 +43,11 @@ func NewServerConnectionPoliciesClientWithBaseURI(baseURI string, subscriptionID // CreateOrUpdate creates or updates the server's connection policy. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. connectionPolicyName is the name of -// the connection policy. parameters is the required parameters for updating a secure connection policy. -func (client ServerConnectionPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, connectionPolicyName string, parameters ServerConnectionPolicy) (result ServerConnectionPolicy, err error) { - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, connectionPolicyName, parameters) +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. parameters is the required +// parameters for updating a secure connection policy. +func (client ServerConnectionPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters ServerConnectionPolicy) (result ServerConnectionPolicy, err error) { + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "sql.ServerConnectionPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -69,9 +69,9 @@ func (client ServerConnectionPoliciesClient) CreateOrUpdate(ctx context.Context, } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ServerConnectionPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, connectionPolicyName string, parameters ServerConnectionPolicy) (*http.Request, error) { +func (client ServerConnectionPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, parameters ServerConnectionPolicy) (*http.Request, error) { pathParameters := map[string]interface{}{ - "connectionPolicyName": autorest.Encode("path", connectionPolicyName), + "connectionPolicyName": autorest.Encode("path", "default"), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -114,11 +114,10 @@ func (client ServerConnectionPoliciesClient) CreateOrUpdateResponder(resp *http. // Get gets the server's secure connection policy. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. connectionPolicyName is the name of -// the connection policy. -func (client ServerConnectionPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, connectionPolicyName string) (result ServerConnectionPolicy, err error) { - req, err := client.GetPreparer(ctx, resourceGroupName, serverName, connectionPolicyName) +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. +func (client ServerConnectionPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string) (result ServerConnectionPolicy, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, serverName) if err != nil { err = autorest.NewErrorWithError(err, "sql.ServerConnectionPoliciesClient", "Get", nil, "Failure preparing request") return @@ -140,9 +139,9 @@ func (client ServerConnectionPoliciesClient) Get(ctx context.Context, resourceGr } // GetPreparer prepares the Get request. -func (client ServerConnectionPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, connectionPolicyName string) (*http.Request, error) { +func (client ServerConnectionPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "connectionPolicyName": autorest.Encode("path", connectionPolicyName), + "connectionPolicyName": autorest.Encode("path", "default"), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/serverkeys.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/serverkeys.go index a4a501caa0be..1c6915e4ade5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/serverkeys.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/serverkeys.go @@ -43,12 +43,13 @@ func NewServerKeysClientWithBaseURI(baseURI string, subscriptionID string) Serve // CreateOrUpdate creates or updates a server key. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. keyName is the name of the server -// key to be operated on (updated or created). The key name is required to be in the format of 'vault_key_version'. For -// example, if the keyId is https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901, -// then the server key name should be formatted as: YourVaultName_YourKeyName_01234567890123456789012345678901 -// parameters is the requested server key resource state. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. keyName is the name of the +// server key to be operated on (updated or created). The key name is required to be in the format of +// 'vault_key_version'. For example, if the keyId is +// https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901, then the server key +// name should be formatted as: YourVaultName_YourKeyName_01234567890123456789012345678901 parameters is the +// requested server key resource state. func (client ServerKeysClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, keyName string, parameters ServerKey) (result ServerKeysCreateOrUpdateFuture, err error) { req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, keyName, parameters) if err != nil { @@ -119,9 +120,9 @@ func (client ServerKeysClient) CreateOrUpdateResponder(resp *http.Response) (res // Delete deletes the server key with the given name. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. keyName is the name of the server -// key to be deleted. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. keyName is the name of the +// server key to be deleted. func (client ServerKeysClient) Delete(ctx context.Context, resourceGroupName string, serverName string, keyName string) (result ServerKeysDeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, keyName) if err != nil { @@ -189,9 +190,9 @@ func (client ServerKeysClient) DeleteResponder(resp *http.Response) (result auto // Get gets a server key. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. keyName is the name of the server -// key to be retrieved. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. keyName is the name of the +// server key to be retrieved. func (client ServerKeysClient) Get(ctx context.Context, resourceGroupName string, serverName string, keyName string) (result ServerKey, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, serverName, keyName) if err != nil { @@ -258,8 +259,8 @@ func (client ServerKeysClient) GetResponder(resp *http.Response) (result ServerK // ListByServer gets a list of server keys. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. func (client ServerKeysClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result ServerKeyListResultPage, err error) { result.fn = client.listByServerNextResults req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/servers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/servers.go index 000f4eba69be..196f3addadee 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/servers.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/servers.go @@ -50,7 +50,7 @@ func (client ServersClient) CheckNameAvailability(ctx context.Context, parameter {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "sql.ServersClient", "CheckNameAvailability") + return result, validation.NewError("sql.ServersClient", "CheckNameAvailability", err.Error()) } req, err := client.CheckNameAvailabilityPreparer(ctx, parameters) @@ -117,9 +117,9 @@ func (client ServersClient) CheckNameAvailabilityResponder(resp *http.Response) // CreateOrUpdate creates or updates a server. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. parameters is the requested server -// resource state. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. parameters is the requested +// server resource state. func (client ServersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters Server) (result ServersCreateOrUpdateFuture, err error) { req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, parameters) if err != nil { @@ -189,8 +189,8 @@ func (client ServersClient) CreateOrUpdateResponder(resp *http.Response) (result // Delete deletes a server. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. func (client ServersClient) Delete(ctx context.Context, resourceGroupName string, serverName string) (result ServersDeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, serverName) if err != nil { @@ -257,8 +257,8 @@ func (client ServersClient) DeleteResponder(resp *http.Response) (result autores // Get gets a server. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. func (client ServersClient) Get(ctx context.Context, resourceGroupName string, serverName string) (result Server, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, serverName) if err != nil { @@ -414,8 +414,8 @@ func (client ServersClient) ListComplete(ctx context.Context) (result ServerList // ListByResourceGroup gets a list of servers in a resource groups. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. func (client ServersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ServerListResultPage, err error) { result.fn = client.listByResourceGroupNextResults req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) @@ -508,9 +508,9 @@ func (client ServersClient) ListByResourceGroupComplete(ctx context.Context, res // Update updates a server. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. parameters is the requested server -// resource state. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. parameters is the requested +// server resource state. func (client ServersClient) Update(ctx context.Context, resourceGroupName string, serverName string, parameters ServerUpdate) (result ServersUpdateFuture, err error) { req, err := client.UpdatePreparer(ctx, resourceGroupName, serverName, parameters) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/serverusages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/serverusages.go index 6f4be0691bbd..327be0cd0973 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/serverusages.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/serverusages.go @@ -43,8 +43,8 @@ func NewServerUsagesClientWithBaseURI(baseURI string, subscriptionID string) Ser // ListByServer returns server usages. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. func (client ServerUsagesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result ServerUsageListResult, err error) { req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/serviceobjectives.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/serviceobjectives.go index 2eff7b8b1023..4dd06885c982 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/serviceobjectives.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/serviceobjectives.go @@ -43,9 +43,9 @@ func NewServiceObjectivesClientWithBaseURI(baseURI string, subscriptionID string // Get gets a database service objective. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. serviceObjectiveName is the name of -// the service objective to retrieve. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. serviceObjectiveName is the +// name of the service objective to retrieve. func (client ServiceObjectivesClient) Get(ctx context.Context, resourceGroupName string, serverName string, serviceObjectiveName string) (result ServiceObjective, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, serverName, serviceObjectiveName) if err != nil { @@ -112,8 +112,8 @@ func (client ServiceObjectivesClient) GetResponder(resp *http.Response) (result // ListByServer returns database service objectives. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. func (client ServiceObjectivesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result ServiceObjectiveListResult, err error) { req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/servicetieradvisors.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/servicetieradvisors.go index bd8b187ee904..581028cdec75 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/servicetieradvisors.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/servicetieradvisors.go @@ -43,8 +43,8 @@ func NewServiceTierAdvisorsClientWithBaseURI(baseURI string, subscriptionID stri // Get gets a service tier advisor. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of // database. serviceTierAdvisorName is the name of service tier advisor. func (client ServiceTierAdvisorsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, serviceTierAdvisorName string) (result ServiceTierAdvisor, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, serverName, databaseName, serviceTierAdvisorName) @@ -113,8 +113,8 @@ func (client ServiceTierAdvisorsClient) GetResponder(resp *http.Response) (resul // ListByDatabase returns service tier advisors for specified database. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of // database. func (client ServiceTierAdvisorsClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result ServiceTierAdvisorListResult, err error) { req, err := client.ListByDatabasePreparer(ctx, resourceGroupName, serverName, databaseName) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/subscriptionusages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/subscriptionusages.go index 6b7827042960..6c014306f539 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/subscriptionusages.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/subscriptionusages.go @@ -43,7 +43,8 @@ func NewSubscriptionUsagesClientWithBaseURI(baseURI string, subscriptionID strin // Get gets a subscription usage metric. // -// locationName is the name of the region where the resource is located. usageName is name of usage metric to return. +// locationName is the name of the region where the resource is located. usageName is name of usage metric to +// return. func (client SubscriptionUsagesClient) Get(ctx context.Context, locationName string, usageName string) (result SubscriptionUsage, err error) { req, err := client.GetPreparer(ctx, locationName, usageName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/syncagents.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/syncagents.go index 686d53557cce..18240eebaa18 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/syncagents.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/syncagents.go @@ -43,9 +43,9 @@ func NewSyncAgentsClientWithBaseURI(baseURI string, subscriptionID string) SyncA // CreateOrUpdate creates or updates a sync agent. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server on which the sync agent is hosted. -// syncAgentName is the name of the sync agent. parameters is the requested sync agent resource state. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server on which the sync agent is +// hosted. syncAgentName is the name of the sync agent. parameters is the requested sync agent resource state. func (client SyncAgentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string, parameters SyncAgent) (result SyncAgentsCreateOrUpdateFuture, err error) { req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, syncAgentName, parameters) if err != nil { @@ -116,9 +116,9 @@ func (client SyncAgentsClient) CreateOrUpdateResponder(resp *http.Response) (res // Delete deletes a sync agent. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server on which the sync agent is hosted. -// syncAgentName is the name of the sync agent. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server on which the sync agent is +// hosted. syncAgentName is the name of the sync agent. func (client SyncAgentsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string) (result SyncAgentsDeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, syncAgentName) if err != nil { @@ -186,9 +186,9 @@ func (client SyncAgentsClient) DeleteResponder(resp *http.Response) (result auto // GenerateKey generates a sync agent key. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server on which the sync agent is hosted. -// syncAgentName is the name of the sync agent. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server on which the sync agent is +// hosted. syncAgentName is the name of the sync agent. func (client SyncAgentsClient) GenerateKey(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string) (result SyncAgentKeyProperties, err error) { req, err := client.GenerateKeyPreparer(ctx, resourceGroupName, serverName, syncAgentName) if err != nil { @@ -255,9 +255,9 @@ func (client SyncAgentsClient) GenerateKeyResponder(resp *http.Response) (result // Get gets a sync agent. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server on which the sync agent is hosted. -// syncAgentName is the name of the sync agent. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server on which the sync agent is +// hosted. syncAgentName is the name of the sync agent. func (client SyncAgentsClient) Get(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string) (result SyncAgent, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, serverName, syncAgentName) if err != nil { @@ -324,8 +324,9 @@ func (client SyncAgentsClient) GetResponder(resp *http.Response) (result SyncAge // ListByServer lists sync agents in a server. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server on which the sync agent is hosted. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server on which the sync agent is +// hosted. func (client SyncAgentsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result SyncAgentListResultPage, err error) { result.fn = client.listByServerNextResults req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) @@ -419,9 +420,9 @@ func (client SyncAgentsClient) ListByServerComplete(ctx context.Context, resourc // ListLinkedDatabases lists databases linked to a sync agent. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server on which the sync agent is hosted. -// syncAgentName is the name of the sync agent. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server on which the sync agent is +// hosted. syncAgentName is the name of the sync agent. func (client SyncAgentsClient) ListLinkedDatabases(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string) (result SyncAgentLinkedDatabaseListResultPage, err error) { result.fn = client.listLinkedDatabasesNextResults req, err := client.ListLinkedDatabasesPreparer(ctx, resourceGroupName, serverName, syncAgentName) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/syncgroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/syncgroups.go index ae7ccc279906..cb25e876ab42 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/syncgroups.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/syncgroups.go @@ -43,9 +43,9 @@ func NewSyncGroupsClientWithBaseURI(baseURI string, subscriptionID string) SyncG // CancelSync cancels a sync group synchronization. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database on which the sync group is hosted. syncGroupName is the name of the sync group. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database on which the sync group is hosted. syncGroupName is the name of the sync group. func (client SyncGroupsClient) CancelSync(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result autorest.Response, err error) { req, err := client.CancelSyncPreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName) if err != nil { @@ -112,10 +112,10 @@ func (client SyncGroupsClient) CancelSyncResponder(resp *http.Response) (result // CreateOrUpdate creates or updates a sync group. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database on which the sync group is hosted. syncGroupName is the name of the sync group. parameters is the requested -// sync group resource state. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database on which the sync group is hosted. syncGroupName is the name of the sync group. parameters is the +// requested sync group resource state. func (client SyncGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, parameters SyncGroup) (result SyncGroupsCreateOrUpdateFuture, err error) { req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName, parameters) if err != nil { @@ -187,9 +187,9 @@ func (client SyncGroupsClient) CreateOrUpdateResponder(resp *http.Response) (res // Delete deletes a sync group. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database on which the sync group is hosted. syncGroupName is the name of the sync group. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database on which the sync group is hosted. syncGroupName is the name of the sync group. func (client SyncGroupsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result SyncGroupsDeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName) if err != nil { @@ -258,9 +258,9 @@ func (client SyncGroupsClient) DeleteResponder(resp *http.Response) (result auto // Get gets a sync group. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database on which the sync group is hosted. syncGroupName is the name of the sync group. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database on which the sync group is hosted. syncGroupName is the name of the sync group. func (client SyncGroupsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result SyncGroup, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName) if err != nil { @@ -328,9 +328,9 @@ func (client SyncGroupsClient) GetResponder(resp *http.Response) (result SyncGro // ListByDatabase lists sync groups under a hub database. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database on which the sync group is hosted. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database on which the sync group is hosted. func (client SyncGroupsClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result SyncGroupListResultPage, err error) { result.fn = client.listByDatabaseNextResults req, err := client.ListByDatabasePreparer(ctx, resourceGroupName, serverName, databaseName) @@ -425,9 +425,9 @@ func (client SyncGroupsClient) ListByDatabaseComplete(ctx context.Context, resou // ListHubSchemas gets a collection of hub database schemas. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database on which the sync group is hosted. syncGroupName is the name of the sync group. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database on which the sync group is hosted. syncGroupName is the name of the sync group. func (client SyncGroupsClient) ListHubSchemas(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result SyncFullSchemaPropertiesListResultPage, err error) { result.fn = client.listHubSchemasNextResults req, err := client.ListHubSchemasPreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName) @@ -523,11 +523,11 @@ func (client SyncGroupsClient) ListHubSchemasComplete(ctx context.Context, resou // ListLogs gets a collection of sync group logs. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database on which the sync group is hosted. syncGroupName is the name of the sync group. startTime is get logs -// generated after this time. endTime is get logs generated before this time. typeParameter is the types of logs to -// retrieve. continuationToken is the continuation token for this operation. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database on which the sync group is hosted. syncGroupName is the name of the sync group. startTime is get +// logs generated after this time. endTime is get logs generated before this time. typeParameter is the types of +// logs to retrieve. continuationToken is the continuation token for this operation. func (client SyncGroupsClient) ListLogs(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, startTime string, endTime string, typeParameter string, continuationToken string) (result SyncGroupLogListResultPage, err error) { result.fn = client.listLogsNextResults req, err := client.ListLogsPreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName, startTime, endTime, typeParameter, continuationToken) @@ -722,9 +722,9 @@ func (client SyncGroupsClient) ListSyncDatabaseIdsComplete(ctx context.Context, // RefreshHubSchema refreshes a hub database schema. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database on which the sync group is hosted. syncGroupName is the name of the sync group. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database on which the sync group is hosted. syncGroupName is the name of the sync group. func (client SyncGroupsClient) RefreshHubSchema(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result SyncGroupsRefreshHubSchemaFuture, err error) { req, err := client.RefreshHubSchemaPreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName) if err != nil { @@ -793,9 +793,9 @@ func (client SyncGroupsClient) RefreshHubSchemaResponder(resp *http.Response) (r // TriggerSync triggers a sync group synchronization. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database on which the sync group is hosted. syncGroupName is the name of the sync group. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database on which the sync group is hosted. syncGroupName is the name of the sync group. func (client SyncGroupsClient) TriggerSync(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result autorest.Response, err error) { req, err := client.TriggerSyncPreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName) if err != nil { @@ -862,10 +862,10 @@ func (client SyncGroupsClient) TriggerSyncResponder(resp *http.Response) (result // Update updates a sync group. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database on which the sync group is hosted. syncGroupName is the name of the sync group. parameters is the requested -// sync group resource state. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database on which the sync group is hosted. syncGroupName is the name of the sync group. parameters is the +// requested sync group resource state. func (client SyncGroupsClient) Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, parameters SyncGroup) (result SyncGroupsUpdateFuture, err error) { req, err := client.UpdatePreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName, parameters) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/syncmembers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/syncmembers.go index 9d6b97d81c62..34d576098093 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/syncmembers.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/syncmembers.go @@ -43,10 +43,11 @@ func NewSyncMembersClientWithBaseURI(baseURI string, subscriptionID string) Sync // CreateOrUpdate creates or updates a sync member. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database on which the sync group is hosted. syncGroupName is the name of the sync group on which the sync member is -// hosted. syncMemberName is the name of the sync member. parameters is the requested sync member resource state. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database on which the sync group is hosted. syncGroupName is the name of the sync group on which the sync +// member is hosted. syncMemberName is the name of the sync member. parameters is the requested sync member +// resource state. func (client SyncMembersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, parameters SyncMember) (result SyncMembersCreateOrUpdateFuture, err error) { req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters) if err != nil { @@ -119,10 +120,10 @@ func (client SyncMembersClient) CreateOrUpdateResponder(resp *http.Response) (re // Delete deletes a sync member. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database on which the sync group is hosted. syncGroupName is the name of the sync group on which the sync member is -// hosted. syncMemberName is the name of the sync member. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database on which the sync group is hosted. syncGroupName is the name of the sync group on which the sync +// member is hosted. syncMemberName is the name of the sync member. func (client SyncMembersClient) Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string) (result SyncMembersDeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName) if err != nil { @@ -192,10 +193,10 @@ func (client SyncMembersClient) DeleteResponder(resp *http.Response) (result aut // Get gets a sync member. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database on which the sync group is hosted. syncGroupName is the name of the sync group on which the sync member is -// hosted. syncMemberName is the name of the sync member. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database on which the sync group is hosted. syncGroupName is the name of the sync group on which the sync +// member is hosted. syncMemberName is the name of the sync member. func (client SyncMembersClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string) (result SyncMember, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName) if err != nil { @@ -264,9 +265,9 @@ func (client SyncMembersClient) GetResponder(resp *http.Response) (result SyncMe // ListBySyncGroup lists sync members in the given sync group. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database on which the sync group is hosted. syncGroupName is the name of the sync group. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database on which the sync group is hosted. syncGroupName is the name of the sync group. func (client SyncMembersClient) ListBySyncGroup(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result SyncMemberListResultPage, err error) { result.fn = client.listBySyncGroupNextResults req, err := client.ListBySyncGroupPreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName) @@ -362,10 +363,10 @@ func (client SyncMembersClient) ListBySyncGroupComplete(ctx context.Context, res // ListMemberSchemas gets a sync member database schema. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database on which the sync group is hosted. syncGroupName is the name of the sync group on which the sync member is -// hosted. syncMemberName is the name of the sync member. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database on which the sync group is hosted. syncGroupName is the name of the sync group on which the sync +// member is hosted. syncMemberName is the name of the sync member. func (client SyncMembersClient) ListMemberSchemas(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string) (result SyncFullSchemaPropertiesListResultPage, err error) { result.fn = client.listMemberSchemasNextResults req, err := client.ListMemberSchemasPreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName) @@ -462,10 +463,10 @@ func (client SyncMembersClient) ListMemberSchemasComplete(ctx context.Context, r // RefreshMemberSchema refreshes a sync member database schema. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database on which the sync group is hosted. syncGroupName is the name of the sync group on which the sync member is -// hosted. syncMemberName is the name of the sync member. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database on which the sync group is hosted. syncGroupName is the name of the sync group on which the sync +// member is hosted. syncMemberName is the name of the sync member. func (client SyncMembersClient) RefreshMemberSchema(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string) (result SyncMembersRefreshMemberSchemaFuture, err error) { req, err := client.RefreshMemberSchemaPreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName) if err != nil { @@ -535,10 +536,11 @@ func (client SyncMembersClient) RefreshMemberSchemaResponder(resp *http.Response // Update updates an existing sync member. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database on which the sync group is hosted. syncGroupName is the name of the sync group on which the sync member is -// hosted. syncMemberName is the name of the sync member. parameters is the requested sync member resource state. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database on which the sync group is hosted. syncGroupName is the name of the sync group on which the sync +// member is hosted. syncMemberName is the name of the sync member. parameters is the requested sync member +// resource state. func (client SyncMembersClient) Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, parameters SyncMember) (result SyncMembersUpdateFuture, err error) { req, err := client.UpdatePreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/transparentdataencryptionactivities.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/transparentdataencryptionactivities.go index ea4d3da60c71..818a30dddf7c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/transparentdataencryptionactivities.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/transparentdataencryptionactivities.go @@ -45,12 +45,11 @@ func NewTransparentDataEncryptionActivitiesClientWithBaseURI(baseURI string, sub // ListByConfiguration returns a database's transparent data encryption operation result. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database for which the transparent data encryption applies. transparentDataEncryptionName is the name of the -// transparent data encryption configuration. -func (client TransparentDataEncryptionActivitiesClient) ListByConfiguration(ctx context.Context, resourceGroupName string, serverName string, databaseName string, transparentDataEncryptionName string) (result TransparentDataEncryptionActivityListResult, err error) { - req, err := client.ListByConfigurationPreparer(ctx, resourceGroupName, serverName, databaseName, transparentDataEncryptionName) +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database for which the transparent data encryption applies. +func (client TransparentDataEncryptionActivitiesClient) ListByConfiguration(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result TransparentDataEncryptionActivityListResult, err error) { + req, err := client.ListByConfigurationPreparer(ctx, resourceGroupName, serverName, databaseName) if err != nil { err = autorest.NewErrorWithError(err, "sql.TransparentDataEncryptionActivitiesClient", "ListByConfiguration", nil, "Failure preparing request") return @@ -72,13 +71,13 @@ func (client TransparentDataEncryptionActivitiesClient) ListByConfiguration(ctx } // ListByConfigurationPreparer prepares the ListByConfiguration request. -func (client TransparentDataEncryptionActivitiesClient) ListByConfigurationPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, transparentDataEncryptionName string) (*http.Request, error) { +func (client TransparentDataEncryptionActivitiesClient) ListByConfigurationPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "databaseName": autorest.Encode("path", databaseName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "transparentDataEncryptionName": autorest.Encode("path", transparentDataEncryptionName), + "transparentDataEncryptionName": autorest.Encode("path", "current"), } const APIVersion = "2014-04-01" diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/transparentdataencryptions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/transparentdataencryptions.go index b14cffb30bef..e9e1acdd2471 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/transparentdataencryptions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/transparentdataencryptions.go @@ -43,13 +43,12 @@ func NewTransparentDataEncryptionsClientWithBaseURI(baseURI string, subscription // CreateOrUpdate creates or updates a database's transparent data encryption configuration. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database for which setting the transparent data encryption applies. transparentDataEncryptionName is the name of the -// transparent data encryption configuration. parameters is the required parameters for creating or updating -// transparent data encryption. -func (client TransparentDataEncryptionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, transparentDataEncryptionName string, parameters TransparentDataEncryption) (result TransparentDataEncryption, err error) { - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, transparentDataEncryptionName, parameters) +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database for which setting the transparent data encryption applies. parameters is the required parameters +// for creating or updating transparent data encryption. +func (client TransparentDataEncryptionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters TransparentDataEncryption) (result TransparentDataEncryption, err error) { + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "sql.TransparentDataEncryptionsClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -71,13 +70,13 @@ func (client TransparentDataEncryptionsClient) CreateOrUpdate(ctx context.Contex } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client TransparentDataEncryptionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, transparentDataEncryptionName string, parameters TransparentDataEncryption) (*http.Request, error) { +func (client TransparentDataEncryptionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters TransparentDataEncryption) (*http.Request, error) { pathParameters := map[string]interface{}{ "databaseName": autorest.Encode("path", databaseName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "transparentDataEncryptionName": autorest.Encode("path", transparentDataEncryptionName), + "transparentDataEncryptionName": autorest.Encode("path", "current"), } const APIVersion = "2014-04-01" @@ -117,12 +116,11 @@ func (client TransparentDataEncryptionsClient) CreateOrUpdateResponder(resp *htt // Get gets a database's transparent data encryption configuration. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of the -// database for which the transparent data encryption applies. transparentDataEncryptionName is the name of the -// transparent data encryption configuration. -func (client TransparentDataEncryptionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, transparentDataEncryptionName string) (result TransparentDataEncryption, err error) { - req, err := client.GetPreparer(ctx, resourceGroupName, serverName, databaseName, transparentDataEncryptionName) +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of +// the database for which the transparent data encryption applies. +func (client TransparentDataEncryptionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result TransparentDataEncryption, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, serverName, databaseName) if err != nil { err = autorest.NewErrorWithError(err, "sql.TransparentDataEncryptionsClient", "Get", nil, "Failure preparing request") return @@ -144,13 +142,13 @@ func (client TransparentDataEncryptionsClient) Get(ctx context.Context, resource } // GetPreparer prepares the Get request. -func (client TransparentDataEncryptionsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, transparentDataEncryptionName string) (*http.Request, error) { +func (client TransparentDataEncryptionsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "databaseName": autorest.Encode("path", databaseName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serverName": autorest.Encode("path", serverName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "transparentDataEncryptionName": autorest.Encode("path", transparentDataEncryptionName), + "transparentDataEncryptionName": autorest.Encode("path", "current"), } const APIVersion = "2014-04-01" diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/version.go index 914e87c92ed0..21b61983166e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/version.go @@ -1,5 +1,7 @@ package sql +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package sql // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta services" + return "Azure-SDK-For-Go/" + version.Number + " sql/2015-05-01-preview" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/virtualnetworkrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/virtualnetworkrules.go index 5f1a07a44a64..9dc9d3043950 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/virtualnetworkrules.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql/virtualnetworkrules.go @@ -44,15 +44,15 @@ func NewVirtualNetworkRulesClientWithBaseURI(baseURI string, subscriptionID stri // CreateOrUpdate creates or updates an existing virtual network rule. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. virtualNetworkRuleName is the name -// of the virtual network rule. parameters is the requested virtual Network Rule Resource state. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. virtualNetworkRuleName is +// the name of the virtual network rule. parameters is the requested virtual Network Rule Resource state. func (client VirtualNetworkRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, parameters VirtualNetworkRule) (result VirtualNetworkRulesCreateOrUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.VirtualNetworkRuleProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkRuleProperties.VirtualNetworkSubnetID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "sql.VirtualNetworkRulesClient", "CreateOrUpdate") + return result, validation.NewError("sql.VirtualNetworkRulesClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, virtualNetworkRuleName, parameters) @@ -124,9 +124,9 @@ func (client VirtualNetworkRulesClient) CreateOrUpdateResponder(resp *http.Respo // Delete deletes the virtual network rule with the given name. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. virtualNetworkRuleName is the name -// of the virtual network rule. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. virtualNetworkRuleName is +// the name of the virtual network rule. func (client VirtualNetworkRulesClient) Delete(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string) (result VirtualNetworkRulesDeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, virtualNetworkRuleName) if err != nil { @@ -194,9 +194,9 @@ func (client VirtualNetworkRulesClient) DeleteResponder(resp *http.Response) (re // Get gets a virtual network rule. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. virtualNetworkRuleName is the name -// of the virtual network rule. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. virtualNetworkRuleName is +// the name of the virtual network rule. func (client VirtualNetworkRulesClient) Get(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string) (result VirtualNetworkRule, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, serverName, virtualNetworkRuleName) if err != nil { @@ -263,8 +263,8 @@ func (client VirtualNetworkRulesClient) GetResponder(resp *http.Response) (resul // ListByServer gets a list of virtual network rules in a server. // -// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from the -// Azure Resource Manager API or the portal. serverName is the name of the server. +// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. serverName is the name of the server. func (client VirtualNetworkRulesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result VirtualNetworkRuleListResultPage, err error) { result.fn = client.listByServerNextResults req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/accounts.go b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/accounts.go index 1068281b1be7..c415b3cd0846 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/accounts.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/accounts.go @@ -18,6 +18,7 @@ package storage // 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" @@ -26,7 +27,7 @@ import ( // AccountsClient is the the Azure Storage Management API. type AccountsClient struct { - ManagementClient + BaseClient } // NewAccountsClient creates an instance of the AccountsClient client. @@ -41,17 +42,17 @@ func NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) Account // CheckNameAvailability checks that the storage account name is valid and is not already in use. // -// accountName is the name of the storage account within the specified resource group. Storage account names must be -// between 3 and 24 characters in length and use numbers and lower-case letters only. -func (client AccountsClient) CheckNameAvailability(accountName AccountCheckNameAvailabilityParameters) (result CheckNameAvailabilityResult, err error) { +// accountName is the name of the storage account within the specified resource group. Storage account names must +// be between 3 and 24 characters in length and use numbers and lower-case letters only. +func (client AccountsClient) CheckNameAvailability(ctx context.Context, accountName AccountCheckNameAvailabilityParameters) (result CheckNameAvailabilityResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName.Name", Name: validation.Null, Rule: true, Chain: nil}, {Target: "accountName.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "storage.AccountsClient", "CheckNameAvailability") + return result, validation.NewError("storage.AccountsClient", "CheckNameAvailability", err.Error()) } - req, err := client.CheckNameAvailabilityPreparer(accountName) + req, err := client.CheckNameAvailabilityPreparer(ctx, accountName) if err != nil { err = autorest.NewErrorWithError(err, "storage.AccountsClient", "CheckNameAvailability", nil, "Failure preparing request") return @@ -73,7 +74,7 @@ func (client AccountsClient) CheckNameAvailability(accountName AccountCheckNameA } // CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. -func (client AccountsClient) CheckNameAvailabilityPreparer(accountName AccountCheckNameAvailabilityParameters) (*http.Request, error) { +func (client AccountsClient) CheckNameAvailabilityPreparer(ctx context.Context, accountName AccountCheckNameAvailabilityParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -90,14 +91,13 @@ func (client AccountsClient) CheckNameAvailabilityPreparer(accountName AccountCh autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability", pathParameters), autorest.WithJSON(accountName), autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare(&http.Request{}) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the // http.Response Body if it receives an error. func (client AccountsClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, - req, + return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } @@ -117,16 +117,13 @@ func (client AccountsClient) CheckNameAvailabilityResponder(resp *http.Response) // Create asynchronously creates a new storage account with the specified parameters. If an account is already created // and a subsequent create request is issued with different properties, the account properties will be updated. If an // account is already created and a subsequent create or update request is issued with the exact same set of -// properties, the request will succeed. This method may poll for completion. Polling can be canceled by passing the -// cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. +// properties, the request will succeed. // -// resourceGroupName is the name of the resource group within the user's subscription. The name is case insensitive. -// accountName is the name of the storage account within the specified resource group. Storage account names must be -// between 3 and 24 characters in length and use numbers and lower-case letters only. parameters is the parameters to -// provide for the created account. -func (client AccountsClient) Create(resourceGroupName string, accountName string, parameters AccountCreateParameters, cancel <-chan struct{}) (<-chan Account, <-chan error) { - resultChan := make(chan Account, 1) - errChan := make(chan error, 1) +// resourceGroupName is the name of the resource group within the user's subscription. The name is case +// insensitive. accountName is the name of the storage account within the specified resource group. Storage account +// names must be between 3 and 24 characters in length and use numbers and lower-case letters only. parameters is +// the parameters to provide for the created account. +func (client AccountsClient) Create(ctx context.Context, resourceGroupName string, accountName string, parameters AccountCreateParameters) (result AccountsCreateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, @@ -144,46 +141,26 @@ func (client AccountsClient) Create(resourceGroupName string, accountName string Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.CustomDomain", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.CustomDomain.Name", Name: validation.Null, Rule: true, Chain: nil}}}, }}}}}); err != nil { - errChan <- validation.NewErrorWithValidationError(err, "storage.AccountsClient", "Create") - close(errChan) - close(resultChan) - return resultChan, errChan - } - - go func() { - var err error - var result Account - defer func() { - if err != nil { - errChan <- err - } - resultChan <- result - close(resultChan) - close(errChan) - }() - req, err := client.CreatePreparer(resourceGroupName, accountName, parameters, cancel) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Create", nil, "Failure preparing request") - return - } - - resp, err := client.CreateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Create", resp, "Failure sending request") - return - } - - result, err = client.CreateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Create", resp, "Failure responding to request") - } - }() - return resultChan, errChan + return result, validation.NewError("storage.AccountsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Create", result.Response(), "Failure sending request") + return + } + + return } // CreatePreparer prepares the Create request. -func (client AccountsClient) CreatePreparer(resourceGroupName string, accountName string, parameters AccountCreateParameters, cancel <-chan struct{}) (*http.Request, error) { +func (client AccountsClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, parameters AccountCreateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -202,16 +179,22 @@ func (client AccountsClient) CreatePreparer(resourceGroupName string, accountNam autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare(&http.Request{Cancel: cancel}) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // CreateSender sends the Create request. The method will close the // http.Response Body if it receives an error. -func (client AccountsClient) CreateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, - req, - azure.DoRetryWithRegistration(client.Client), - azure.DoPollForAsynchronous(client.PollingDelay)) +func (client AccountsClient) CreateSender(req *http.Request) (future AccountsCreateFuture, err error) { + sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) + future.Future = azure.NewFuture(req) + future.req = req + _, err = future.Done(sender) + if err != nil { + return + } + err = autorest.Respond(future.Response(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) + return } // CreateResponder handles the response to the Create request. The method always @@ -229,10 +212,10 @@ func (client AccountsClient) CreateResponder(resp *http.Response) (result Accoun // Delete deletes a storage account in Microsoft Azure. // -// resourceGroupName is the name of the resource group within the user's subscription. The name is case insensitive. -// accountName is the name of the storage account within the specified resource group. Storage account names must be -// between 3 and 24 characters in length and use numbers and lower-case letters only. -func (client AccountsClient) Delete(resourceGroupName string, accountName string) (result autorest.Response, err error) { +// resourceGroupName is the name of the resource group within the user's subscription. The name is case +// insensitive. accountName is the name of the storage account within the specified resource group. Storage account +// names must be between 3 and 24 characters in length and use numbers and lower-case letters only. +func (client AccountsClient) Delete(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, @@ -241,10 +224,10 @@ func (client AccountsClient) Delete(resourceGroupName string, accountName string {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "storage.AccountsClient", "Delete") + return result, validation.NewError("storage.AccountsClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(resourceGroupName, accountName) + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName) if err != nil { err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Delete", nil, "Failure preparing request") return @@ -266,7 +249,7 @@ func (client AccountsClient) Delete(resourceGroupName string, accountName string } // DeletePreparer prepares the Delete request. -func (client AccountsClient) DeletePreparer(resourceGroupName string, accountName string) (*http.Request, error) { +func (client AccountsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -283,14 +266,13 @@ func (client AccountsClient) DeletePreparer(resourceGroupName string, accountNam autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", pathParameters), autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare(&http.Request{}) + 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 AccountsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, - req, + return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } @@ -309,10 +291,10 @@ func (client AccountsClient) DeleteResponder(resp *http.Response) (result autore // GetProperties returns the properties for the specified storage account including but not limited to name, SKU name, // location, and account status. The ListKeys operation should be used to retrieve storage keys. // -// resourceGroupName is the name of the resource group within the user's subscription. The name is case insensitive. -// accountName is the name of the storage account within the specified resource group. Storage account names must be -// between 3 and 24 characters in length and use numbers and lower-case letters only. -func (client AccountsClient) GetProperties(resourceGroupName string, accountName string) (result Account, err error) { +// resourceGroupName is the name of the resource group within the user's subscription. The name is case +// insensitive. accountName is the name of the storage account within the specified resource group. Storage account +// names must be between 3 and 24 characters in length and use numbers and lower-case letters only. +func (client AccountsClient) GetProperties(ctx context.Context, resourceGroupName string, accountName string) (result Account, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, @@ -321,10 +303,10 @@ func (client AccountsClient) GetProperties(resourceGroupName string, accountName {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "storage.AccountsClient", "GetProperties") + return result, validation.NewError("storage.AccountsClient", "GetProperties", err.Error()) } - req, err := client.GetPropertiesPreparer(resourceGroupName, accountName) + req, err := client.GetPropertiesPreparer(ctx, resourceGroupName, accountName) if err != nil { err = autorest.NewErrorWithError(err, "storage.AccountsClient", "GetProperties", nil, "Failure preparing request") return @@ -346,7 +328,7 @@ func (client AccountsClient) GetProperties(resourceGroupName string, accountName } // GetPropertiesPreparer prepares the GetProperties request. -func (client AccountsClient) GetPropertiesPreparer(resourceGroupName string, accountName string) (*http.Request, error) { +func (client AccountsClient) GetPropertiesPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -363,14 +345,13 @@ func (client AccountsClient) GetPropertiesPreparer(resourceGroupName string, acc autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", pathParameters), autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare(&http.Request{}) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // GetPropertiesSender sends the GetProperties request. The method will close the // http.Response Body if it receives an error. func (client AccountsClient) GetPropertiesSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, - req, + return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } @@ -389,8 +370,8 @@ func (client AccountsClient) GetPropertiesResponder(resp *http.Response) (result // List lists all the storage accounts available under the subscription. Note that storage keys are not returned; use // the ListKeys operation for this. -func (client AccountsClient) List() (result AccountListResult, err error) { - req, err := client.ListPreparer() +func (client AccountsClient) List(ctx context.Context) (result AccountListResult, err error) { + req, err := client.ListPreparer(ctx) if err != nil { err = autorest.NewErrorWithError(err, "storage.AccountsClient", "List", nil, "Failure preparing request") return @@ -412,7 +393,7 @@ func (client AccountsClient) List() (result AccountListResult, err error) { } // ListPreparer prepares the List request. -func (client AccountsClient) ListPreparer() (*http.Request, error) { +func (client AccountsClient) ListPreparer(ctx context.Context) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -427,14 +408,13 @@ func (client AccountsClient) ListPreparer() (*http.Request, error) { autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts", pathParameters), autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare(&http.Request{}) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client AccountsClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, - req, + return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } @@ -453,11 +433,11 @@ func (client AccountsClient) ListResponder(resp *http.Response) (result AccountL // ListAccountSAS list SAS credentials of a storage account. // -// resourceGroupName is the name of the resource group within the user's subscription. The name is case insensitive. -// accountName is the name of the storage account within the specified resource group. Storage account names must be -// between 3 and 24 characters in length and use numbers and lower-case letters only. parameters is the parameters to -// provide to list SAS credentials for the storage account. -func (client AccountsClient) ListAccountSAS(resourceGroupName string, accountName string, parameters AccountSasParameters) (result ListAccountSasResponse, err error) { +// resourceGroupName is the name of the resource group within the user's subscription. The name is case +// insensitive. accountName is the name of the storage account within the specified resource group. Storage account +// names must be between 3 and 24 characters in length and use numbers and lower-case letters only. parameters is +// the parameters to provide to list SAS credentials for the storage account. +func (client AccountsClient) ListAccountSAS(ctx context.Context, resourceGroupName string, accountName string, parameters AccountSasParameters) (result ListAccountSasResponse, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, @@ -468,10 +448,10 @@ func (client AccountsClient) ListAccountSAS(resourceGroupName string, accountNam {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.SharedAccessExpiryTime", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "storage.AccountsClient", "ListAccountSAS") + return result, validation.NewError("storage.AccountsClient", "ListAccountSAS", err.Error()) } - req, err := client.ListAccountSASPreparer(resourceGroupName, accountName, parameters) + req, err := client.ListAccountSASPreparer(ctx, resourceGroupName, accountName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListAccountSAS", nil, "Failure preparing request") return @@ -493,7 +473,7 @@ func (client AccountsClient) ListAccountSAS(resourceGroupName string, accountNam } // ListAccountSASPreparer prepares the ListAccountSAS request. -func (client AccountsClient) ListAccountSASPreparer(resourceGroupName string, accountName string, parameters AccountSasParameters) (*http.Request, error) { +func (client AccountsClient) ListAccountSASPreparer(ctx context.Context, resourceGroupName string, accountName string, parameters AccountSasParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -512,14 +492,13 @@ func (client AccountsClient) ListAccountSASPreparer(resourceGroupName string, ac autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare(&http.Request{}) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // ListAccountSASSender sends the ListAccountSAS request. The method will close the // http.Response Body if it receives an error. func (client AccountsClient) ListAccountSASSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, - req, + return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } @@ -539,17 +518,18 @@ func (client AccountsClient) ListAccountSASResponder(resp *http.Response) (resul // ListByResourceGroup lists all the storage accounts available under the given resource group. Note that storage keys // are not returned; use the ListKeys operation for this. // -// resourceGroupName is the name of the resource group within the user's subscription. The name is case insensitive. -func (client AccountsClient) ListByResourceGroup(resourceGroupName string) (result AccountListResult, err error) { +// resourceGroupName is the name of the resource group within the user's subscription. The name is case +// insensitive. +func (client AccountsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AccountListResult, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "storage.AccountsClient", "ListByResourceGroup") + return result, validation.NewError("storage.AccountsClient", "ListByResourceGroup", err.Error()) } - req, err := client.ListByResourceGroupPreparer(resourceGroupName) + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) if err != nil { err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListByResourceGroup", nil, "Failure preparing request") return @@ -571,7 +551,7 @@ func (client AccountsClient) ListByResourceGroup(resourceGroupName string) (resu } // ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client AccountsClient) ListByResourceGroupPreparer(resourceGroupName string) (*http.Request, error) { +func (client AccountsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -587,14 +567,13 @@ func (client AccountsClient) ListByResourceGroupPreparer(resourceGroupName strin autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts", pathParameters), autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare(&http.Request{}) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the // http.Response Body if it receives an error. func (client AccountsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, - req, + return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } @@ -613,10 +592,10 @@ func (client AccountsClient) ListByResourceGroupResponder(resp *http.Response) ( // ListKeys lists the access keys for the specified storage account. // -// resourceGroupName is the name of the resource group within the user's subscription. The name is case insensitive. -// accountName is the name of the storage account within the specified resource group. Storage account names must be -// between 3 and 24 characters in length and use numbers and lower-case letters only. -func (client AccountsClient) ListKeys(resourceGroupName string, accountName string) (result AccountListKeysResult, err error) { +// resourceGroupName is the name of the resource group within the user's subscription. The name is case +// insensitive. accountName is the name of the storage account within the specified resource group. Storage account +// names must be between 3 and 24 characters in length and use numbers and lower-case letters only. +func (client AccountsClient) ListKeys(ctx context.Context, resourceGroupName string, accountName string) (result AccountListKeysResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, @@ -625,10 +604,10 @@ func (client AccountsClient) ListKeys(resourceGroupName string, accountName stri {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "storage.AccountsClient", "ListKeys") + return result, validation.NewError("storage.AccountsClient", "ListKeys", err.Error()) } - req, err := client.ListKeysPreparer(resourceGroupName, accountName) + req, err := client.ListKeysPreparer(ctx, resourceGroupName, accountName) if err != nil { err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListKeys", nil, "Failure preparing request") return @@ -650,7 +629,7 @@ func (client AccountsClient) ListKeys(resourceGroupName string, accountName stri } // ListKeysPreparer prepares the ListKeys request. -func (client AccountsClient) ListKeysPreparer(resourceGroupName string, accountName string) (*http.Request, error) { +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), @@ -667,14 +646,13 @@ func (client AccountsClient) ListKeysPreparer(resourceGroupName string, accountN autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys", pathParameters), autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare(&http.Request{}) + 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 autorest.SendWithSender(client, - req, + return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } @@ -693,11 +671,11 @@ func (client AccountsClient) ListKeysResponder(resp *http.Response) (result Acco // ListServiceSAS list service SAS credentials of a specific resource. // -// resourceGroupName is the name of the resource group within the user's subscription. The name is case insensitive. -// accountName is the name of the storage account within the specified resource group. Storage account names must be -// between 3 and 24 characters in length and use numbers and lower-case letters only. parameters is the parameters to -// provide to list service SAS credentials. -func (client AccountsClient) ListServiceSAS(resourceGroupName string, accountName string, parameters ServiceSasParameters) (result ListServiceSasResponse, err error) { +// resourceGroupName is the name of the resource group within the user's subscription. The name is case +// insensitive. accountName is the name of the storage account within the specified resource group. Storage account +// names must be between 3 and 24 characters in length and use numbers and lower-case letters only. parameters is +// the parameters to provide to list service SAS credentials. +func (client AccountsClient) ListServiceSAS(ctx context.Context, resourceGroupName string, accountName string, parameters ServiceSasParameters) (result ListServiceSasResponse, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, @@ -710,10 +688,10 @@ func (client AccountsClient) ListServiceSAS(resourceGroupName string, accountNam Constraints: []validation.Constraint{{Target: "parameters.CanonicalizedResource", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.Identifier", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.Identifier", Name: validation.MaxLength, Rule: 64, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "storage.AccountsClient", "ListServiceSAS") + return result, validation.NewError("storage.AccountsClient", "ListServiceSAS", err.Error()) } - req, err := client.ListServiceSASPreparer(resourceGroupName, accountName, parameters) + req, err := client.ListServiceSASPreparer(ctx, resourceGroupName, accountName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListServiceSAS", nil, "Failure preparing request") return @@ -735,7 +713,7 @@ func (client AccountsClient) ListServiceSAS(resourceGroupName string, accountNam } // ListServiceSASPreparer prepares the ListServiceSAS request. -func (client AccountsClient) ListServiceSASPreparer(resourceGroupName string, accountName string, parameters ServiceSasParameters) (*http.Request, error) { +func (client AccountsClient) ListServiceSASPreparer(ctx context.Context, resourceGroupName string, accountName string, parameters ServiceSasParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -754,14 +732,13 @@ func (client AccountsClient) ListServiceSASPreparer(resourceGroupName string, ac autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare(&http.Request{}) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // ListServiceSASSender sends the ListServiceSAS request. The method will close the // http.Response Body if it receives an error. func (client AccountsClient) ListServiceSASSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, - req, + return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } @@ -780,11 +757,11 @@ func (client AccountsClient) ListServiceSASResponder(resp *http.Response) (resul // RegenerateKey regenerates one of the access keys for the specified storage account. // -// resourceGroupName is the name of the resource group within the user's subscription. The name is case insensitive. -// accountName is the name of the storage account within the specified resource group. Storage account names must be -// between 3 and 24 characters in length and use numbers and lower-case letters only. regenerateKey is specifies name -// of the key which should be regenerated -- key1 or key2. -func (client AccountsClient) RegenerateKey(resourceGroupName string, accountName string, regenerateKey AccountRegenerateKeyParameters) (result AccountListKeysResult, err error) { +// resourceGroupName is the name of the resource group within the user's subscription. The name is case +// insensitive. accountName is the name of the storage account within the specified resource group. Storage account +// names must be between 3 and 24 characters in length and use numbers and lower-case letters only. regenerateKey +// is specifies name of the key which should be regenerated -- key1 or key2. +func (client AccountsClient) RegenerateKey(ctx context.Context, resourceGroupName string, accountName string, regenerateKey AccountRegenerateKeyParameters) (result AccountListKeysResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, @@ -795,10 +772,10 @@ func (client AccountsClient) RegenerateKey(resourceGroupName string, accountName {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, {TargetValue: regenerateKey, Constraints: []validation.Constraint{{Target: "regenerateKey.KeyName", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "storage.AccountsClient", "RegenerateKey") + return result, validation.NewError("storage.AccountsClient", "RegenerateKey", err.Error()) } - req, err := client.RegenerateKeyPreparer(resourceGroupName, accountName, regenerateKey) + req, err := client.RegenerateKeyPreparer(ctx, resourceGroupName, accountName, regenerateKey) if err != nil { err = autorest.NewErrorWithError(err, "storage.AccountsClient", "RegenerateKey", nil, "Failure preparing request") return @@ -820,7 +797,7 @@ func (client AccountsClient) RegenerateKey(resourceGroupName string, accountName } // RegenerateKeyPreparer prepares the RegenerateKey request. -func (client AccountsClient) RegenerateKeyPreparer(resourceGroupName string, accountName string, regenerateKey AccountRegenerateKeyParameters) (*http.Request, error) { +func (client AccountsClient) RegenerateKeyPreparer(ctx context.Context, resourceGroupName string, accountName string, regenerateKey AccountRegenerateKeyParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -839,14 +816,13 @@ func (client AccountsClient) RegenerateKeyPreparer(resourceGroupName string, acc autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey", pathParameters), autorest.WithJSON(regenerateKey), autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare(&http.Request{}) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // RegenerateKeySender sends the RegenerateKey request. The method will close the // http.Response Body if it receives an error. func (client AccountsClient) RegenerateKeySender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, - req, + return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } @@ -870,11 +846,11 @@ func (client AccountsClient) RegenerateKeyResponder(resp *http.Response) (result // call does not change the storage keys for the account. If you want to change the storage account keys, use the // regenerate keys operation. The location and name of the storage account cannot be changed after creation. // -// resourceGroupName is the name of the resource group within the user's subscription. The name is case insensitive. -// accountName is the name of the storage account within the specified resource group. Storage account names must be -// between 3 and 24 characters in length and use numbers and lower-case letters only. parameters is the parameters to -// provide for the updated account. -func (client AccountsClient) Update(resourceGroupName string, accountName string, parameters AccountUpdateParameters) (result Account, err error) { +// resourceGroupName is the name of the resource group within the user's subscription. The name is case +// insensitive. accountName is the name of the storage account within the specified resource group. Storage account +// names must be between 3 and 24 characters in length and use numbers and lower-case letters only. parameters is +// the parameters to provide for the updated account. +func (client AccountsClient) Update(ctx context.Context, resourceGroupName string, accountName string, parameters AccountUpdateParameters) (result Account, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, @@ -883,10 +859,10 @@ func (client AccountsClient) Update(resourceGroupName string, accountName string {TargetValue: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "storage.AccountsClient", "Update") + return result, validation.NewError("storage.AccountsClient", "Update", err.Error()) } - req, err := client.UpdatePreparer(resourceGroupName, accountName, parameters) + req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Update", nil, "Failure preparing request") return @@ -908,7 +884,7 @@ func (client AccountsClient) Update(resourceGroupName string, accountName string } // UpdatePreparer prepares the Update request. -func (client AccountsClient) UpdatePreparer(resourceGroupName string, accountName string, parameters AccountUpdateParameters) (*http.Request, error) { +func (client AccountsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, parameters AccountUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -927,14 +903,13 @@ func (client AccountsClient) UpdatePreparer(resourceGroupName string, accountNam autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare(&http.Request{}) + 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 AccountsClient) UpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, - req, + return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/client.go index 05d570127a0a..2be951c81f13 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/client.go @@ -29,21 +29,21 @@ const ( DefaultBaseURI = "https://management.azure.com" ) -// ManagementClient is the base client for Storage. -type ManagementClient struct { +// BaseClient is the base client for Storage. +type BaseClient struct { autorest.Client BaseURI string SubscriptionID string } -// New creates an instance of the ManagementClient client. -func New(subscriptionID string) ManagementClient { +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { return NewWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewWithBaseURI creates an instance of the ManagementClient client. -func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient { - return ManagementClient{ +// NewWithBaseURI creates an instance of the BaseClient client. +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ Client: autorest.NewClientWithUserAgent(UserAgent()), BaseURI: baseURI, SubscriptionID: subscriptionID, diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/models.go index c4045794dc74..88d70813cffe 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/models.go @@ -18,17 +18,20 @@ package storage // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( + "encoding/json" "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/date" + "net/http" ) // AccessTier enumerates the values for access tier. type AccessTier string const ( - // Cool specifies the cool state for access tier. + // Cool ... Cool AccessTier = "Cool" - // Hot specifies the hot state for access tier. + // Hot ... Hot AccessTier = "Hot" ) @@ -36,9 +39,9 @@ const ( type AccountStatus string const ( - // Available specifies the available state for account status. + // Available ... Available AccountStatus = "available" - // Unavailable specifies the unavailable state for account status. + // Unavailable ... Unavailable AccountStatus = "unavailable" ) @@ -46,7 +49,7 @@ const ( type Action string const ( - // Allow specifies the allow state for action. + // Allow ... Allow Action = "Allow" ) @@ -54,13 +57,13 @@ const ( type Bypass string const ( - // AzureServices specifies the azure services state for bypass. + // AzureServices ... AzureServices Bypass = "AzureServices" - // Logging specifies the logging state for bypass. + // Logging ... Logging Bypass = "Logging" - // Metrics specifies the metrics state for bypass. + // Metrics ... Metrics Bypass = "Metrics" - // None specifies the none state for bypass. + // None ... None Bypass = "None" ) @@ -68,9 +71,9 @@ const ( type DefaultAction string const ( - // DefaultActionAllow specifies the default action allow state for default action. + // DefaultActionAllow ... DefaultActionAllow DefaultAction = "Allow" - // DefaultActionDeny specifies the default action deny state for default action. + // DefaultActionDeny ... DefaultActionDeny DefaultAction = "Deny" ) @@ -78,9 +81,9 @@ const ( type HTTPProtocol string const ( - // HTTPS specifies the https state for http protocol. + // HTTPS ... HTTPS HTTPProtocol = "https" - // Httpshttp specifies the httpshttp state for http protocol. + // Httpshttp ... Httpshttp HTTPProtocol = "https,http" ) @@ -88,9 +91,9 @@ const ( type KeyPermission string const ( - // Full specifies the full state for key permission. + // Full ... Full KeyPermission = "Full" - // Read specifies the read state for key permission. + // Read ... Read KeyPermission = "Read" ) @@ -98,9 +101,9 @@ const ( type KeySource string const ( - // MicrosoftKeyvault specifies the microsoft keyvault state for key source. + // MicrosoftKeyvault ... MicrosoftKeyvault KeySource = "Microsoft.Keyvault" - // MicrosoftStorage specifies the microsoft storage state for key source. + // MicrosoftStorage ... MicrosoftStorage KeySource = "Microsoft.Storage" ) @@ -108,11 +111,11 @@ const ( type Kind string const ( - // BlobStorage specifies the blob storage state for kind. + // BlobStorage ... BlobStorage Kind = "BlobStorage" - // Storage specifies the storage state for kind. + // Storage ... Storage Kind = "Storage" - // StorageV2 specifies the storage v2 state for kind. + // StorageV2 ... StorageV2 Kind = "StorageV2" ) @@ -120,21 +123,21 @@ const ( type Permissions string const ( - // A specifies the a state for permissions. + // A ... A Permissions = "a" - // C specifies the c state for permissions. + // C ... C Permissions = "c" - // D specifies the d state for permissions. + // D ... D Permissions = "d" - // L specifies the l state for permissions. + // L ... L Permissions = "l" - // P specifies the p state for permissions. + // P ... P Permissions = "p" - // R specifies the r state for permissions. + // R ... R Permissions = "r" - // U specifies the u state for permissions. + // U ... U Permissions = "u" - // W specifies the w state for permissions. + // W ... W Permissions = "w" ) @@ -142,11 +145,11 @@ const ( type ProvisioningState string const ( - // Creating specifies the creating state for provisioning state. + // Creating ... Creating ProvisioningState = "Creating" - // ResolvingDNS specifies the resolving dns state for provisioning state. + // ResolvingDNS ... ResolvingDNS ProvisioningState = "ResolvingDNS" - // Succeeded specifies the succeeded state for provisioning state. + // Succeeded ... Succeeded ProvisioningState = "Succeeded" ) @@ -154,9 +157,9 @@ const ( type Reason string const ( - // AccountNameInvalid specifies the account name invalid state for reason. + // AccountNameInvalid ... AccountNameInvalid Reason = "AccountNameInvalid" - // AlreadyExists specifies the already exists state for reason. + // AlreadyExists ... AlreadyExists Reason = "AlreadyExists" ) @@ -164,9 +167,9 @@ const ( type ReasonCode string const ( - // NotAvailableForSubscription specifies the not available for subscription state for reason code. + // NotAvailableForSubscription ... NotAvailableForSubscription ReasonCode = "NotAvailableForSubscription" - // QuotaID specifies the quota id state for reason code. + // QuotaID ... QuotaID ReasonCode = "QuotaId" ) @@ -174,13 +177,13 @@ const ( type Services string const ( - // B specifies the b state for services. + // B ... B Services = "b" - // F specifies the f state for services. + // F ... F Services = "f" - // Q specifies the q state for services. + // Q ... Q Services = "q" - // T specifies the t state for services. + // T ... T Services = "t" ) @@ -188,13 +191,13 @@ const ( type SignedResource string const ( - // SignedResourceB specifies the signed resource b state for signed resource. + // SignedResourceB ... SignedResourceB SignedResource = "b" - // SignedResourceC specifies the signed resource c state for signed resource. + // SignedResourceC ... SignedResourceC SignedResource = "c" - // SignedResourceF specifies the signed resource f state for signed resource. + // SignedResourceF ... SignedResourceF SignedResource = "f" - // SignedResourceS specifies the signed resource s state for signed resource. + // SignedResourceS ... SignedResourceS SignedResource = "s" ) @@ -202,11 +205,11 @@ const ( type SignedResourceTypes string const ( - // SignedResourceTypesC specifies the signed resource types c state for signed resource types. + // SignedResourceTypesC ... SignedResourceTypesC SignedResourceTypes = "c" - // SignedResourceTypesO specifies the signed resource types o state for signed resource types. + // SignedResourceTypesO ... SignedResourceTypesO SignedResourceTypes = "o" - // SignedResourceTypesS specifies the signed resource types s state for signed resource types. + // SignedResourceTypesS ... SignedResourceTypesS SignedResourceTypes = "s" ) @@ -214,15 +217,15 @@ const ( type SkuName string const ( - // PremiumLRS specifies the premium lrs state for sku name. + // PremiumLRS ... PremiumLRS SkuName = "Premium_LRS" - // StandardGRS specifies the standard grs state for sku name. + // StandardGRS ... StandardGRS SkuName = "Standard_GRS" - // StandardLRS specifies the standard lrs state for sku name. + // StandardLRS ... StandardLRS SkuName = "Standard_LRS" - // StandardRAGRS specifies the standard ragrs state for sku name. + // StandardRAGRS ... StandardRAGRS SkuName = "Standard_RAGRS" - // StandardZRS specifies the standard zrs state for sku name. + // StandardZRS ... StandardZRS SkuName = "Standard_ZRS" ) @@ -230,9 +233,9 @@ const ( type SkuTier string const ( - // Premium specifies the premium state for sku tier. + // Premium ... Premium SkuTier = "Premium" - // Standard specifies the standard state for sku tier. + // Standard ... Standard SkuTier = "Standard" ) @@ -240,15 +243,15 @@ const ( type State string const ( - // StateDeprovisioning specifies the state deprovisioning state for state. + // StateDeprovisioning ... StateDeprovisioning State = "deprovisioning" - // StateFailed specifies the state failed state for state. + // StateFailed ... StateFailed State = "failed" - // StateNetworkSourceDeleted specifies the state network source deleted state for state. + // StateNetworkSourceDeleted ... StateNetworkSourceDeleted State = "networkSourceDeleted" - // StateProvisioning specifies the state provisioning state for state. + // StateProvisioning ... StateProvisioning State = "provisioning" - // StateSucceeded specifies the state succeeded state for state. + // StateSucceeded ... StateSucceeded State = "succeeded" ) @@ -256,350 +259,926 @@ const ( type UsageUnit string const ( - // Bytes specifies the bytes state for usage unit. + // Bytes ... Bytes UsageUnit = "Bytes" - // BytesPerSecond specifies the bytes per second state for usage unit. + // BytesPerSecond ... BytesPerSecond UsageUnit = "BytesPerSecond" - // Count specifies the count state for usage unit. + // Count ... Count UsageUnit = "Count" - // CountsPerSecond specifies the counts per second state for usage unit. + // CountsPerSecond ... CountsPerSecond UsageUnit = "CountsPerSecond" - // Percent specifies the percent state for usage unit. + // Percent ... Percent UsageUnit = "Percent" - // Seconds specifies the seconds state for usage unit. + // Seconds ... Seconds UsageUnit = "Seconds" ) -// Account is the storage account. +// Account the storage account. type Account struct { - autorest.Response `json:"-"` - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` - Location *string `json:"location,omitempty"` - Tags *map[string]*string `json:"tags,omitempty"` - Sku *Sku `json:"sku,omitempty"` - Kind Kind `json:"kind,omitempty"` - Identity *Identity `json:"identity,omitempty"` + autorest.Response `json:"-"` + // Sku - Gets the SKU. + Sku *Sku `json:"sku,omitempty"` + // Kind - Gets the Kind. Possible values include: 'Storage', 'StorageV2', 'BlobStorage' + Kind Kind `json:"kind,omitempty"` + // Identity - The identity of the resource. + Identity *Identity `json:"identity,omitempty"` + // AccountProperties - Properties of the storage account. *AccountProperties `json:"properties,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` + // Name - Resource name + Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Tags assigned to a resource; can be used for viewing and grouping a resource (across resource groups). + Tags map[string]*string `json:"tags"` } -// AccountCheckNameAvailabilityParameters is the parameters used to check the availabity of the storage account name. +// 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 + } + objectMap["kind"] = a.Kind + if a.Identity != nil { + objectMap["identity"] = a.Identity + } + if a.AccountProperties != nil { + objectMap["properties"] = a.AccountProperties + } + if a.ID != nil { + objectMap["id"] = a.ID + } + if a.Name != nil { + objectMap["name"] = a.Name + } + if a.Type != nil { + objectMap["type"] = a.Type + } + if a.Location != nil { + objectMap["location"] = a.Location + } + if a.Tags != nil { + objectMap["tags"] = a.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Account struct. +func (a *Account) 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 "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + a.Sku = &sku + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + a.Kind = kind + } + case "identity": + if v != nil { + var identity Identity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + a.Identity = &identity + } + case "properties": + if v != nil { + var accountProperties AccountProperties + err = json.Unmarshal(*v, &accountProperties) + if err != nil { + return err + } + a.AccountProperties = &accountProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + a.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + a.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + a.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + a.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + a.Tags = tags + } + } + } + + return nil +} + +// AccountCheckNameAvailabilityParameters the parameters used to check the availabity of the storage account name. type AccountCheckNameAvailabilityParameters struct { + // Name - The storage account name. Name *string `json:"name,omitempty"` + // Type - The type of resource, Microsoft.Storage/storageAccounts Type *string `json:"type,omitempty"` } -// AccountCreateParameters is the parameters used when creating a storage account. +// AccountCreateParameters the parameters used when creating a storage account. type AccountCreateParameters struct { - Sku *Sku `json:"sku,omitempty"` - Kind Kind `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Tags *map[string]*string `json:"tags,omitempty"` - Identity *Identity `json:"identity,omitempty"` + // Sku - Required. Gets or sets the sku name. + Sku *Sku `json:"sku,omitempty"` + // Kind - Required. Indicates the type of storage account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage' + Kind Kind `json:"kind,omitempty"` + // Location - Required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. + Location *string `json:"location,omitempty"` + // Tags - Gets or sets a list of key value pairs that describe the resource. These tags can be used for 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 with a length no greater than 128 characters and a value with a length no greater than 256 characters. + Tags map[string]*string `json:"tags"` + // Identity - The identity of the resource. + Identity *Identity `json:"identity,omitempty"` + // AccountPropertiesCreateParameters - The parameters used to create the storage account. *AccountPropertiesCreateParameters `json:"properties,omitempty"` } -// AccountKey is an access key for the storage account. +// MarshalJSON is the custom marshaler for AccountCreateParameters. +func (acp AccountCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if acp.Sku != nil { + objectMap["sku"] = acp.Sku + } + objectMap["kind"] = acp.Kind + if acp.Location != nil { + objectMap["location"] = acp.Location + } + if acp.Tags != nil { + objectMap["tags"] = acp.Tags + } + if acp.Identity != nil { + objectMap["identity"] = acp.Identity + } + if acp.AccountPropertiesCreateParameters != nil { + objectMap["properties"] = acp.AccountPropertiesCreateParameters + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AccountCreateParameters struct. +func (acp *AccountCreateParameters) 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 "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + acp.Sku = &sku + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + acp.Kind = kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + acp.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + acp.Tags = tags + } + case "identity": + if v != nil { + var identity Identity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + acp.Identity = &identity + } + case "properties": + if v != nil { + var accountPropertiesCreateParameters AccountPropertiesCreateParameters + err = json.Unmarshal(*v, &accountPropertiesCreateParameters) + if err != nil { + return err + } + acp.AccountPropertiesCreateParameters = &accountPropertiesCreateParameters + } + } + } + + return nil +} + +// AccountKey an access key for the storage account. type AccountKey struct { - KeyName *string `json:"keyName,omitempty"` - Value *string `json:"value,omitempty"` + // KeyName - Name of the key. + KeyName *string `json:"keyName,omitempty"` + // Value - Base 64-encoded value of the key. + Value *string `json:"value,omitempty"` + // Permissions - Permissions for the key -- read-only or full permissions. Possible values include: 'Read', 'Full' Permissions KeyPermission `json:"permissions,omitempty"` } -// AccountListKeysResult is the response from the ListKeys operation. +// AccountListKeysResult the response from the ListKeys operation. type AccountListKeysResult struct { autorest.Response `json:"-"` - Keys *[]AccountKey `json:"keys,omitempty"` + // Keys - Gets the list of storage account keys and their properties for the specified storage account. + Keys *[]AccountKey `json:"keys,omitempty"` } -// AccountListResult is the response from the List Storage Accounts operation. +// AccountListResult the response from the List Storage Accounts operation. type AccountListResult struct { autorest.Response `json:"-"` - Value *[]Account `json:"value,omitempty"` + // Value - Gets the list of storage accounts and their properties. + Value *[]Account `json:"value,omitempty"` } -// AccountProperties is properties of the storage account. +// AccountProperties properties of the storage account. type AccountProperties struct { - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - PrimaryEndpoints *Endpoints `json:"primaryEndpoints,omitempty"` - PrimaryLocation *string `json:"primaryLocation,omitempty"` - StatusOfPrimary AccountStatus `json:"statusOfPrimary,omitempty"` - LastGeoFailoverTime *date.Time `json:"lastGeoFailoverTime,omitempty"` - SecondaryLocation *string `json:"secondaryLocation,omitempty"` - StatusOfSecondary AccountStatus `json:"statusOfSecondary,omitempty"` - CreationTime *date.Time `json:"creationTime,omitempty"` - CustomDomain *CustomDomain `json:"customDomain,omitempty"` - SecondaryEndpoints *Endpoints `json:"secondaryEndpoints,omitempty"` - Encryption *Encryption `json:"encryption,omitempty"` - AccessTier AccessTier `json:"accessTier,omitempty"` - EnableHTTPSTrafficOnly *bool `json:"supportsHttpsTrafficOnly,omitempty"` - NetworkRuleSet *NetworkRuleSet `json:"networkAcls,omitempty"` -} - -// AccountPropertiesCreateParameters is the parameters used to create the storage account. + // ProvisioningState - Gets the status of the storage account at the time the operation was called. Possible values include: 'Creating', 'ResolvingDNS', 'Succeeded' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // PrimaryEndpoints - Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object. Note that Standard_ZRS and Premium_LRS accounts only return the blob endpoint. + PrimaryEndpoints *Endpoints `json:"primaryEndpoints,omitempty"` + // PrimaryLocation - Gets the location of the primary data center for the storage account. + PrimaryLocation *string `json:"primaryLocation,omitempty"` + // StatusOfPrimary - Gets the status indicating whether the primary location of the storage account is available or unavailable. Possible values include: 'Available', 'Unavailable' + StatusOfPrimary AccountStatus `json:"statusOfPrimary,omitempty"` + // LastGeoFailoverTime - Gets the timestamp of the most recent instance of a failover to the secondary location. Only the most recent timestamp is retained. This element is not returned if there has never been a failover instance. Only available if the accountType is Standard_GRS or Standard_RAGRS. + LastGeoFailoverTime *date.Time `json:"lastGeoFailoverTime,omitempty"` + // SecondaryLocation - Gets the location of the geo-replicated secondary for the storage account. Only available if the accountType is Standard_GRS or Standard_RAGRS. + SecondaryLocation *string `json:"secondaryLocation,omitempty"` + // StatusOfSecondary - Gets the status indicating whether the secondary location of the storage account is available or unavailable. Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible values include: 'Available', 'Unavailable' + StatusOfSecondary AccountStatus `json:"statusOfSecondary,omitempty"` + // CreationTime - Gets the creation date and time of the storage account in UTC. + CreationTime *date.Time `json:"creationTime,omitempty"` + // CustomDomain - Gets the custom domain the user assigned to this storage account. + CustomDomain *CustomDomain `json:"customDomain,omitempty"` + // SecondaryEndpoints - Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object from the secondary location of the storage account. Only available if the SKU name is Standard_RAGRS. + SecondaryEndpoints *Endpoints `json:"secondaryEndpoints,omitempty"` + // Encryption - Gets the encryption settings on the account. If unspecified, the account is unencrypted. + Encryption *Encryption `json:"encryption,omitempty"` + // AccessTier - Required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool' + AccessTier AccessTier `json:"accessTier,omitempty"` + // EnableHTTPSTrafficOnly - Allows https traffic only to storage service if sets to true. + EnableHTTPSTrafficOnly *bool `json:"supportsHttpsTrafficOnly,omitempty"` + // NetworkRuleSet - Network rule set + NetworkRuleSet *NetworkRuleSet `json:"networkAcls,omitempty"` +} + +// AccountPropertiesCreateParameters the parameters used to create the storage account. type AccountPropertiesCreateParameters struct { - CustomDomain *CustomDomain `json:"customDomain,omitempty"` - Encryption *Encryption `json:"encryption,omitempty"` - NetworkRuleSet *NetworkRuleSet `json:"networkAcls,omitempty"` - AccessTier AccessTier `json:"accessTier,omitempty"` - EnableHTTPSTrafficOnly *bool `json:"supportsHttpsTrafficOnly,omitempty"` + // CustomDomain - User domain assigned to the storage account. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. + CustomDomain *CustomDomain `json:"customDomain,omitempty"` + // Encryption - Provides the encryption settings on the account. If left unspecified the account encryption settings will remain the same. The default setting is unencrypted. + Encryption *Encryption `json:"encryption,omitempty"` + // NetworkRuleSet - Network rule set + NetworkRuleSet *NetworkRuleSet `json:"networkAcls,omitempty"` + // AccessTier - Required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool' + AccessTier AccessTier `json:"accessTier,omitempty"` + // EnableHTTPSTrafficOnly - Allows https traffic only to storage service if sets to true. + EnableHTTPSTrafficOnly *bool `json:"supportsHttpsTrafficOnly,omitempty"` } -// AccountPropertiesUpdateParameters is the parameters used when updating a storage account. +// AccountPropertiesUpdateParameters the parameters used when updating a storage account. type AccountPropertiesUpdateParameters struct { - CustomDomain *CustomDomain `json:"customDomain,omitempty"` - Encryption *Encryption `json:"encryption,omitempty"` - AccessTier AccessTier `json:"accessTier,omitempty"` - EnableHTTPSTrafficOnly *bool `json:"supportsHttpsTrafficOnly,omitempty"` - NetworkRuleSet *NetworkRuleSet `json:"networkAcls,omitempty"` + // CustomDomain - Custom domain assigned to the storage account by the user. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. + CustomDomain *CustomDomain `json:"customDomain,omitempty"` + // Encryption - Provides the encryption settings on the account. The default setting is unencrypted. + Encryption *Encryption `json:"encryption,omitempty"` + // AccessTier - Required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool' + AccessTier AccessTier `json:"accessTier,omitempty"` + // EnableHTTPSTrafficOnly - Allows https traffic only to storage service if sets to true. + EnableHTTPSTrafficOnly *bool `json:"supportsHttpsTrafficOnly,omitempty"` + // NetworkRuleSet - Network rule set + NetworkRuleSet *NetworkRuleSet `json:"networkAcls,omitempty"` } -// AccountRegenerateKeyParameters is the parameters used to regenerate the storage account key. +// AccountRegenerateKeyParameters the parameters used to regenerate the storage account key. type AccountRegenerateKeyParameters struct { + // KeyName - The name of storage keys that want to be regenerated, possible vaules are key1, key2. KeyName *string `json:"keyName,omitempty"` } -// AccountSasParameters is the parameters to list SAS credentials of a storage account. +// AccountSasParameters the parameters to list SAS credentials of a storage account. type AccountSasParameters struct { - Services Services `json:"signedServices,omitempty"` - ResourceTypes SignedResourceTypes `json:"signedResourceTypes,omitempty"` - Permissions Permissions `json:"signedPermission,omitempty"` - IPAddressOrRange *string `json:"signedIp,omitempty"` - Protocols HTTPProtocol `json:"signedProtocol,omitempty"` - SharedAccessStartTime *date.Time `json:"signedStart,omitempty"` - SharedAccessExpiryTime *date.Time `json:"signedExpiry,omitempty"` - KeyToSign *string `json:"keyToSign,omitempty"` + // Services - The signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). Possible values include: 'B', 'Q', 'T', 'F' + Services Services `json:"signedServices,omitempty"` + // ResourceTypes - The signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs; Container (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, table entities, and files. Possible values include: 'SignedResourceTypesS', 'SignedResourceTypesC', 'SignedResourceTypesO' + ResourceTypes SignedResourceTypes `json:"signedResourceTypes,omitempty"` + // Permissions - The signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'R', 'D', 'W', 'L', 'A', 'C', 'U', 'P' + Permissions Permissions `json:"signedPermission,omitempty"` + // IPAddressOrRange - An IP address or a range of IP addresses from which to accept requests. + IPAddressOrRange *string `json:"signedIp,omitempty"` + // Protocols - The protocol permitted for a request made with the account SAS. Possible values include: 'Httpshttp', 'HTTPS' + Protocols HTTPProtocol `json:"signedProtocol,omitempty"` + // SharedAccessStartTime - The time at which the SAS becomes valid. + SharedAccessStartTime *date.Time `json:"signedStart,omitempty"` + // SharedAccessExpiryTime - The time at which the shared access signature becomes invalid. + SharedAccessExpiryTime *date.Time `json:"signedExpiry,omitempty"` + // KeyToSign - The key to sign the account SAS token with. + KeyToSign *string `json:"keyToSign,omitempty"` +} + +// AccountsCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type AccountsCreateFuture struct { + azure.Future + req *http.Request +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future AccountsCreateFuture) Result(client AccountsClient) (a Account, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.AccountsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + return a, azure.NewAsyncOpIncompleteError("storage.AccountsCreateFuture") + } + if future.PollingMethod() == azure.PollingLocation { + a, err = client.CreateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.AccountsCreateFuture", "Result", future.Response(), "Failure responding to request") + } + return + } + var req *http.Request + var resp *http.Response + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, + autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.AccountsCreateFuture", "Result", resp, "Failure sending request") + return + } + a, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.AccountsCreateFuture", "Result", resp, "Failure responding to request") + } + return } -// AccountUpdateParameters is the parameters that can be provided when updating the storage account properties. +// AccountUpdateParameters the parameters that can be provided when updating the storage account properties. type AccountUpdateParameters struct { - Sku *Sku `json:"sku,omitempty"` - Tags *map[string]*string `json:"tags,omitempty"` - Identity *Identity `json:"identity,omitempty"` + // Sku - Gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku names be updated to any other value. + Sku *Sku `json:"sku,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 in length than 128 characters and a value no greater in length than 256 characters. + Tags map[string]*string `json:"tags"` + // Identity - The identity of the resource. + Identity *Identity `json:"identity,omitempty"` + // AccountPropertiesUpdateParameters - The parameters used when updating a storage account. *AccountPropertiesUpdateParameters `json:"properties,omitempty"` - Kind Kind `json:"kind,omitempty"` + // Kind - Optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. Possible values include: 'Storage', 'StorageV2', 'BlobStorage' + Kind Kind `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for AccountUpdateParameters. +func (aup AccountUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aup.Sku != nil { + objectMap["sku"] = aup.Sku + } + if aup.Tags != nil { + objectMap["tags"] = aup.Tags + } + if aup.Identity != nil { + objectMap["identity"] = aup.Identity + } + if aup.AccountPropertiesUpdateParameters != nil { + objectMap["properties"] = aup.AccountPropertiesUpdateParameters + } + objectMap["kind"] = aup.Kind + return json.Marshal(objectMap) } -// CheckNameAvailabilityResult is the CheckNameAvailability operation response. +// 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 "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + aup.Sku = &sku + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + aup.Tags = tags + } + case "identity": + if v != nil { + var identity Identity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + aup.Identity = &identity + } + case "properties": + if v != nil { + var accountPropertiesUpdateParameters AccountPropertiesUpdateParameters + err = json.Unmarshal(*v, &accountPropertiesUpdateParameters) + if err != nil { + return err + } + aup.AccountPropertiesUpdateParameters = &accountPropertiesUpdateParameters + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + aup.Kind = kind + } + } + } + + return nil +} + +// CheckNameAvailabilityResult the CheckNameAvailability operation response. type CheckNameAvailabilityResult struct { autorest.Response `json:"-"` - NameAvailable *bool `json:"nameAvailable,omitempty"` - Reason Reason `json:"reason,omitempty"` - Message *string `json:"message,omitempty"` + // NameAvailable - Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or is invalid and cannot be used. + NameAvailable *bool `json:"nameAvailable,omitempty"` + // Reason - Gets the reason that a storage account name could not be used. The Reason element is only returned if NameAvailable is false. Possible values include: 'AccountNameInvalid', 'AlreadyExists' + Reason Reason `json:"reason,omitempty"` + // Message - Gets an error message explaining the Reason value in more detail. + Message *string `json:"message,omitempty"` } -// CustomDomain is the custom domain assigned to this storage account. This can be set via Update. +// CustomDomain the custom domain assigned to this storage account. This can be set via Update. type CustomDomain struct { - Name *string `json:"name,omitempty"` - UseSubDomain *bool `json:"useSubDomain,omitempty"` + // Name - Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + Name *string `json:"name,omitempty"` + // UseSubDomain - Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. + UseSubDomain *bool `json:"useSubDomain,omitempty"` } -// Dimension is dimension of blobs, possiblly be blob type or access tier. +// Dimension dimension of blobs, possiblly be blob type or access tier. type Dimension struct { - Name *string `json:"name,omitempty"` + // Name - Display name of dimension. + Name *string `json:"name,omitempty"` + // DisplayName - Display name of dimension. DisplayName *string `json:"displayName,omitempty"` } -// Encryption is the encryption settings on the storage account. +// Encryption the encryption settings on the storage account. type Encryption struct { - Services *EncryptionServices `json:"services,omitempty"` - KeySource KeySource `json:"keySource,omitempty"` + // Services - List of services which support encryption. + Services *EncryptionServices `json:"services,omitempty"` + // KeySource - The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. Possible values include: 'MicrosoftStorage', 'MicrosoftKeyvault' + KeySource KeySource `json:"keySource,omitempty"` + // KeyVaultProperties - Properties provided by key vault. KeyVaultProperties *KeyVaultProperties `json:"keyvaultproperties,omitempty"` } -// EncryptionService is a service that allows server-side encryption to be used. +// EncryptionService a service that allows server-side encryption to be used. type EncryptionService struct { - Enabled *bool `json:"enabled,omitempty"` + // Enabled - A boolean indicating whether or not the service encrypts the data as it is stored. + Enabled *bool `json:"enabled,omitempty"` + // LastEnabledTime - Gets a rough estimate of the date/time when the encryption was last enabled by the user. Only returned when encryption is enabled. There might be some unencrypted blobs which were written after this time, as it is just a rough estimate. LastEnabledTime *date.Time `json:"lastEnabledTime,omitempty"` } -// EncryptionServices is a list of services that support encryption. +// EncryptionServices a list of services that support encryption. type EncryptionServices struct { - Blob *EncryptionService `json:"blob,omitempty"` - File *EncryptionService `json:"file,omitempty"` + // Blob - The encryption function of the blob storage service. + Blob *EncryptionService `json:"blob,omitempty"` + // File - The encryption function of the file storage service. + File *EncryptionService `json:"file,omitempty"` + // Table - The encryption function of the table storage service. Table *EncryptionService `json:"table,omitempty"` + // Queue - The encryption function of the queue storage service. Queue *EncryptionService `json:"queue,omitempty"` } -// Endpoints is the URIs that are used to perform a retrieval of a public blob, queue, or table object. +// Endpoints the URIs that are used to perform a retrieval of a public blob, queue, or table object. type Endpoints struct { - Blob *string `json:"blob,omitempty"` + // Blob - Gets the blob endpoint. + Blob *string `json:"blob,omitempty"` + // Queue - Gets the queue endpoint. Queue *string `json:"queue,omitempty"` + // Table - Gets the table endpoint. Table *string `json:"table,omitempty"` - File *string `json:"file,omitempty"` + // File - Gets the file endpoint. + File *string `json:"file,omitempty"` } -// Identity is identity for the resource. +// Identity identity for the resource. type Identity struct { + // PrincipalID - The principal ID of resource identity. PrincipalID *string `json:"principalId,omitempty"` - TenantID *string `json:"tenantId,omitempty"` - Type *string `json:"type,omitempty"` + // TenantID - The tenant ID of resource. + TenantID *string `json:"tenantId,omitempty"` + // Type - The identity type. + Type *string `json:"type,omitempty"` } -// IPRule is IP rule with specific IP or IP range in CIDR format. +// IPRule IP rule with specific IP or IP range in CIDR format. type IPRule struct { + // IPAddressOrRange - Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. IPAddressOrRange *string `json:"value,omitempty"` - Action Action `json:"action,omitempty"` + // Action - The action of IP ACL rule. Possible values include: 'Allow' + Action Action `json:"action,omitempty"` } -// KeyVaultProperties is properties of key vault. +// KeyVaultProperties properties of key vault. type KeyVaultProperties struct { - KeyName *string `json:"keyname,omitempty"` - KeyVersion *string `json:"keyversion,omitempty"` + // KeyName - The name of KeyVault key. + KeyName *string `json:"keyname,omitempty"` + // KeyVersion - The version of KeyVault key. + KeyVersion *string `json:"keyversion,omitempty"` + // KeyVaultURI - The Uri of KeyVault. KeyVaultURI *string `json:"keyvaulturi,omitempty"` } -// ListAccountSasResponse is the List SAS credentials operation response. +// ListAccountSasResponse the List SAS credentials operation response. type ListAccountSasResponse struct { autorest.Response `json:"-"` - AccountSasToken *string `json:"accountSasToken,omitempty"` + // AccountSasToken - List SAS credentials of storage account. + AccountSasToken *string `json:"accountSasToken,omitempty"` } -// ListServiceSasResponse is the List service SAS credentials operation response. +// ListServiceSasResponse the List service SAS credentials operation response. type ListServiceSasResponse struct { autorest.Response `json:"-"` - ServiceSasToken *string `json:"serviceSasToken,omitempty"` + // ServiceSasToken - List service SAS credentials of speicific resource. + ServiceSasToken *string `json:"serviceSasToken,omitempty"` } -// MetricSpecification is metric specification of operation. +// MetricSpecification metric specification of operation. type MetricSpecification struct { - Name *string `json:"name,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - DisplayDescription *string `json:"displayDescription,omitempty"` - Unit *string `json:"unit,omitempty"` - Dimensions *[]Dimension `json:"dimensions,omitempty"` - AggregationType *string `json:"aggregationType,omitempty"` - FillGapWithZero *bool `json:"fillGapWithZero,omitempty"` - Category *string `json:"category,omitempty"` - ResourceIDDimensionNameOverride *string `json:"resourceIdDimensionNameOverride,omitempty"` -} - -// NetworkRuleSet is network rule set + // 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 Bytes or Count. + Unit *string `json:"unit,omitempty"` + // Dimensions - Dimensions of blobs, including blob type and access tier. + 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"` +} + +// NetworkRuleSet network rule set type NetworkRuleSet struct { - Bypass Bypass `json:"bypass,omitempty"` + // Bypass - Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none of those traffics. Possible values include: 'None', 'Logging', 'Metrics', 'AzureServices' + Bypass Bypass `json:"bypass,omitempty"` + // VirtualNetworkRules - Sets the virtual network rules VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` - IPRules *[]IPRule `json:"ipRules,omitempty"` - DefaultAction DefaultAction `json:"defaultAction,omitempty"` + // IPRules - Sets the IP ACL rules + IPRules *[]IPRule `json:"ipRules,omitempty"` + // DefaultAction - Specifies the default action of allow or deny when no other rules match. Possible values include: 'DefaultActionAllow', 'DefaultActionDeny' + DefaultAction DefaultAction `json:"defaultAction,omitempty"` } -// Operation is storage REST API operation definition. +// Operation storage REST API operation definition. type Operation struct { - Name *string `json:"name,omitempty"` - Display *OperationDisplay `json:"display,omitempty"` - Origin *string `json:"origin,omitempty"` + // Name - Operation name: {provider}/{resource}/{operation} + Name *string `json:"name,omitempty"` + // Display - Display metadata associated with the operation. + Display *OperationDisplay `json:"display,omitempty"` + // Origin - The origin of operations. + Origin *string `json:"origin,omitempty"` + // OperationProperties - Properties of operation, include metric specifications. *OperationProperties `json:"properties,omitempty"` } -// OperationDisplay is display metadata associated with the operation. +// UnmarshalJSON is the custom unmarshaler for Operation struct. +func (o *Operation) 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 + } + o.Name = &name + } + case "display": + if v != nil { + var display OperationDisplay + err = json.Unmarshal(*v, &display) + if err != nil { + return err + } + o.Display = &display + } + case "origin": + if v != nil { + var origin string + err = json.Unmarshal(*v, &origin) + if err != nil { + return err + } + o.Origin = &origin + } + case "properties": + if v != nil { + var operationProperties OperationProperties + err = json.Unmarshal(*v, &operationProperties) + if err != nil { + return err + } + o.OperationProperties = &operationProperties + } + } + } + + return nil +} + +// OperationDisplay display metadata associated with the operation. type OperationDisplay struct { - Provider *string `json:"provider,omitempty"` - Resource *string `json:"resource,omitempty"` + // Provider - Service provider: Microsoft Storage. + Provider *string `json:"provider,omitempty"` + // Resource - Resource on which the operation is performed etc. + Resource *string `json:"resource,omitempty"` + // Operation - Type of operation: get, read, delete, etc. Operation *string `json:"operation,omitempty"` } -// OperationListResult is result of the request to list Storage operations. It contains a list of operations and a URL +// OperationListResult result of the request to list Storage operations. It contains a list of operations and a URL // link to get the next set of results. type OperationListResult struct { autorest.Response `json:"-"` - Value *[]Operation `json:"value,omitempty"` + // Value - List of Storage operations supported by the Storage resource provider. + Value *[]Operation `json:"value,omitempty"` } -// OperationProperties is properties of operation, include metric specifications. +// OperationProperties properties of operation, include metric specifications. type OperationProperties struct { + // ServiceSpecification - One property of operation, include metric specifications. ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"` } -// Resource is describes a storage resource. +// Resource describes a storage resource. type Resource struct { - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` - Location *string `json:"location,omitempty"` - Tags *map[string]*string `json:"tags,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` + // Name - Resource name + Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Tags assigned to a resource; can be used for viewing and grouping a resource (across resource groups). + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.ID != nil { + objectMap["id"] = r.ID + } + if r.Name != nil { + objectMap["name"] = r.Name + } + if r.Type != nil { + objectMap["type"] = r.Type + } + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) } -// Restriction is the restriction because of which SKU cannot be used. +// Restriction the restriction because of which SKU cannot be used. type Restriction struct { - Type *string `json:"type,omitempty"` - Values *[]string `json:"values,omitempty"` + // Type - The type of restrictions. As of now only possible value for this is location. + Type *string `json:"type,omitempty"` + // Values - The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted. + Values *[]string `json:"values,omitempty"` + // ReasonCode - The reason for the restriction. As of now this can be “QuotaId” or “NotAvailableForSubscription”. Quota Id is set when the SKU has requiredQuotas parameter as the subscription does not belong to that quota. The “NotAvailableForSubscription” is related to capacity at DC. Possible values include: 'QuotaID', 'NotAvailableForSubscription' ReasonCode ReasonCode `json:"reasonCode,omitempty"` } -// ServiceSasParameters is the parameters to list service SAS credentials of a speicific resource. +// ServiceSasParameters the parameters to list service SAS credentials of a speicific resource. type ServiceSasParameters struct { - CanonicalizedResource *string `json:"canonicalizedResource,omitempty"` - Resource SignedResource `json:"signedResource,omitempty"` - Permissions Permissions `json:"signedPermission,omitempty"` - IPAddressOrRange *string `json:"signedIp,omitempty"` - Protocols HTTPProtocol `json:"signedProtocol,omitempty"` - SharedAccessStartTime *date.Time `json:"signedStart,omitempty"` - SharedAccessExpiryTime *date.Time `json:"signedExpiry,omitempty"` - Identifier *string `json:"signedIdentifier,omitempty"` - PartitionKeyStart *string `json:"startPk,omitempty"` - PartitionKeyEnd *string `json:"endPk,omitempty"` - RowKeyStart *string `json:"startRk,omitempty"` - RowKeyEnd *string `json:"endRk,omitempty"` - KeyToSign *string `json:"keyToSign,omitempty"` - CacheControl *string `json:"rscc,omitempty"` - ContentDisposition *string `json:"rscd,omitempty"` - ContentEncoding *string `json:"rsce,omitempty"` - ContentLanguage *string `json:"rscl,omitempty"` - ContentType *string `json:"rsct,omitempty"` -} - -// ServiceSpecification is one property of operation, include metric specifications. + // CanonicalizedResource - The canonical path to the signed resource. + CanonicalizedResource *string `json:"canonicalizedResource,omitempty"` + // Resource - The signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share (s). Possible values include: 'SignedResourceB', 'SignedResourceC', 'SignedResourceF', 'SignedResourceS' + Resource SignedResource `json:"signedResource,omitempty"` + // Permissions - The signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'R', 'D', 'W', 'L', 'A', 'C', 'U', 'P' + Permissions Permissions `json:"signedPermission,omitempty"` + // IPAddressOrRange - An IP address or a range of IP addresses from which to accept requests. + IPAddressOrRange *string `json:"signedIp,omitempty"` + // Protocols - The protocol permitted for a request made with the account SAS. Possible values include: 'Httpshttp', 'HTTPS' + Protocols HTTPProtocol `json:"signedProtocol,omitempty"` + // SharedAccessStartTime - The time at which the SAS becomes valid. + SharedAccessStartTime *date.Time `json:"signedStart,omitempty"` + // SharedAccessExpiryTime - The time at which the shared access signature becomes invalid. + SharedAccessExpiryTime *date.Time `json:"signedExpiry,omitempty"` + // Identifier - A unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or table. + Identifier *string `json:"signedIdentifier,omitempty"` + // PartitionKeyStart - The start of partition key. + PartitionKeyStart *string `json:"startPk,omitempty"` + // PartitionKeyEnd - The end of partition key. + PartitionKeyEnd *string `json:"endPk,omitempty"` + // RowKeyStart - The start of row key. + RowKeyStart *string `json:"startRk,omitempty"` + // RowKeyEnd - The end of row key. + RowKeyEnd *string `json:"endRk,omitempty"` + // KeyToSign - The key to sign the account SAS token with. + KeyToSign *string `json:"keyToSign,omitempty"` + // CacheControl - The response header override for cache control. + CacheControl *string `json:"rscc,omitempty"` + // ContentDisposition - The response header override for content disposition. + ContentDisposition *string `json:"rscd,omitempty"` + // ContentEncoding - The response header override for content encoding. + ContentEncoding *string `json:"rsce,omitempty"` + // ContentLanguage - The response header override for content language. + ContentLanguage *string `json:"rscl,omitempty"` + // ContentType - The response header override for content type. + ContentType *string `json:"rsct,omitempty"` +} + +// ServiceSpecification one property of operation, include metric specifications. type ServiceSpecification struct { + // MetricSpecifications - Metric specifications of operation. MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"` } -// Sku is the SKU of the storage account. +// Sku the SKU of the storage account. type Sku struct { - Name SkuName `json:"name,omitempty"` - Tier SkuTier `json:"tier,omitempty"` - ResourceType *string `json:"resourceType,omitempty"` - Kind Kind `json:"kind,omitempty"` - Locations *[]string `json:"locations,omitempty"` + // Name - Gets or sets the sku name. Required for account creation; optional for update. Note that in older versions, sku name was called accountType. Possible values include: 'StandardLRS', 'StandardGRS', 'StandardRAGRS', 'StandardZRS', 'PremiumLRS' + Name SkuName `json:"name,omitempty"` + // Tier - Gets the sku tier. This is based on the SKU name. Possible values include: 'Standard', 'Premium' + Tier SkuTier `json:"tier,omitempty"` + // ResourceType - The type of the resource, usually it is 'storageAccounts'. + ResourceType *string `json:"resourceType,omitempty"` + // Kind - Indicates the type of storage account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage' + Kind Kind `json:"kind,omitempty"` + // Locations - The set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). + Locations *[]string `json:"locations,omitempty"` + // Capabilities - The capability information in the specified sku, including file encryption, network acls, change notification, etc. Capabilities *[]SKUCapability `json:"capabilities,omitempty"` - Restrictions *[]Restriction `json:"restrictions,omitempty"` + // Restrictions - The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. + Restrictions *[]Restriction `json:"restrictions,omitempty"` } -// SKUCapability is the capability information in the specified sku, including file encryption, network acls, change +// SKUCapability the capability information in the specified sku, including file encryption, network acls, change // notification, etc. type SKUCapability struct { - Name *string `json:"name,omitempty"` + // Name - The name of capability, The capability information in the specified sku, including file encryption, network acls, change notification, etc. + Name *string `json:"name,omitempty"` + // Value - A string value to indicate states of given capability. Possibly 'true' or 'false'. Value *string `json:"value,omitempty"` } -// SkuListResult is the response from the List Storage SKUs operation. +// SkuListResult the response from the List Storage SKUs operation. type SkuListResult struct { autorest.Response `json:"-"` - Value *[]Sku `json:"value,omitempty"` + // Value - Get the list result of storage SKUs and their properties. + Value *[]Sku `json:"value,omitempty"` } -// Usage is describes Storage Resource Usage. +// Usage describes Storage Resource Usage. type Usage struct { - Unit UsageUnit `json:"unit,omitempty"` - CurrentValue *int32 `json:"currentValue,omitempty"` - Limit *int32 `json:"limit,omitempty"` - Name *UsageName `json:"name,omitempty"` + // Unit - Gets the unit of measurement. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', 'BytesPerSecond' + Unit UsageUnit `json:"unit,omitempty"` + // CurrentValue - Gets the current count of the allocated resources in the subscription. + CurrentValue *int32 `json:"currentValue,omitempty"` + // Limit - Gets the maximum count of the resources that can be allocated in the subscription. + Limit *int32 `json:"limit,omitempty"` + // Name - Gets the name of the type of usage. + Name *UsageName `json:"name,omitempty"` } -// UsageListResult is the response from the List Usages operation. +// UsageListResult the response from the List Usages operation. type UsageListResult struct { autorest.Response `json:"-"` - Value *[]Usage `json:"value,omitempty"` + // Value - Gets or sets the list of Storage Resource Usages. + Value *[]Usage `json:"value,omitempty"` } -// UsageName is the usage names that can be used; currently limited to StorageAccount. +// UsageName the usage names that can be used; currently limited to StorageAccount. type UsageName struct { - Value *string `json:"value,omitempty"` + // Value - Gets a string describing the resource name. + Value *string `json:"value,omitempty"` + // LocalizedValue - Gets a localized string describing the resource name. LocalizedValue *string `json:"localizedValue,omitempty"` } -// VirtualNetworkRule is virtual Network rule. +// VirtualNetworkRule virtual Network rule. type VirtualNetworkRule struct { + // VirtualNetworkResourceID - Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. VirtualNetworkResourceID *string `json:"id,omitempty"` - Action Action `json:"action,omitempty"` - State State `json:"state,omitempty"` + // Action - The action of virtual network rule. Possible values include: 'Allow' + Action Action `json:"action,omitempty"` + // State - Gets the state of virtual network rule. Possible values include: 'StateProvisioning', 'StateDeprovisioning', 'StateSucceeded', 'StateFailed', 'StateNetworkSourceDeleted' + State State `json:"state,omitempty"` } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/operations.go index e6636e9095a0..b36bc6d68447 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/operations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/operations.go @@ -18,6 +18,7 @@ package storage // 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" "net/http" @@ -25,7 +26,7 @@ import ( // OperationsClient is the the Azure Storage Management API. type OperationsClient struct { - ManagementClient + BaseClient } // NewOperationsClient creates an instance of the OperationsClient client. @@ -39,8 +40,8 @@ func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) Opera } // List lists all of the available Storage Rest API operations. -func (client OperationsClient) List() (result OperationListResult, err error) { - req, err := client.ListPreparer() +func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) { + req, err := client.ListPreparer(ctx) if err != nil { err = autorest.NewErrorWithError(err, "storage.OperationsClient", "List", nil, "Failure preparing request") return @@ -62,7 +63,7 @@ func (client OperationsClient) List() (result OperationListResult, err error) { } // ListPreparer prepares the List request. -func (client OperationsClient) ListPreparer() (*http.Request, error) { +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { const APIVersion = "2017-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, @@ -73,14 +74,13 @@ func (client OperationsClient) ListPreparer() (*http.Request, error) { autorest.WithBaseURL(client.BaseURI), autorest.WithPath("/providers/Microsoft.Storage/operations"), autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare(&http.Request{}) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, - req, + return autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/skus.go b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/skus.go index 1caca57d0a8e..20abb8c90f98 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/skus.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/skus.go @@ -18,6 +18,7 @@ package storage // 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" "net/http" @@ -25,7 +26,7 @@ import ( // SkusClient is the the Azure Storage Management API. type SkusClient struct { - ManagementClient + BaseClient } // NewSkusClient creates an instance of the SkusClient client. @@ -39,8 +40,8 @@ func NewSkusClientWithBaseURI(baseURI string, subscriptionID string) SkusClient } // List lists the available SKUs supported by Microsoft.Storage for given subscription. -func (client SkusClient) List() (result SkuListResult, err error) { - req, err := client.ListPreparer() +func (client SkusClient) List(ctx context.Context) (result SkuListResult, err error) { + req, err := client.ListPreparer(ctx) if err != nil { err = autorest.NewErrorWithError(err, "storage.SkusClient", "List", nil, "Failure preparing request") return @@ -62,7 +63,7 @@ func (client SkusClient) List() (result SkuListResult, err error) { } // ListPreparer prepares the List request. -func (client SkusClient) ListPreparer() (*http.Request, error) { +func (client SkusClient) ListPreparer(ctx context.Context) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -77,14 +78,13 @@ func (client SkusClient) ListPreparer() (*http.Request, error) { autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus", pathParameters), autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare(&http.Request{}) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client SkusClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, - req, + return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/usage.go b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/usage.go index 007725e1e127..16942e6f7542 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/usage.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/usage.go @@ -18,6 +18,7 @@ package storage // 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" "net/http" @@ -25,7 +26,7 @@ import ( // UsageClient is the the Azure Storage Management API. type UsageClient struct { - ManagementClient + BaseClient } // NewUsageClient creates an instance of the UsageClient client. @@ -39,8 +40,8 @@ func NewUsageClientWithBaseURI(baseURI string, subscriptionID string) UsageClien } // List gets the current usage count and the limit for the resources under the subscription. -func (client UsageClient) List() (result UsageListResult, err error) { - req, err := client.ListPreparer() +func (client UsageClient) List(ctx context.Context) (result UsageListResult, err error) { + req, err := client.ListPreparer(ctx) if err != nil { err = autorest.NewErrorWithError(err, "storage.UsageClient", "List", nil, "Failure preparing request") return @@ -62,7 +63,7 @@ func (client UsageClient) List() (result UsageListResult, err error) { } // ListPreparer prepares the List request. -func (client UsageClient) ListPreparer() (*http.Request, error) { +func (client UsageClient) ListPreparer(ctx context.Context) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -77,14 +78,13 @@ func (client UsageClient) ListPreparer() (*http.Request, error) { autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages", pathParameters), autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare(&http.Request{}) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client UsageClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, - req, + return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/version.go index 67b2d07bcdda..884a2478f8d8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/version.go @@ -1,5 +1,7 @@ package storage +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package storage // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta arm-storage/2017-10-01" + return "Azure-SDK-For-Go/" + version.Number + " storage/2017-10-01" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/trafficmanager/mgmt/2017-05-01/trafficmanager/endpoints.go b/vendor/github.com/Azure/azure-sdk-for-go/services/trafficmanager/mgmt/2017-05-01/trafficmanager/endpoints.go index 87cf2f09083a..976eb79a6b1e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/trafficmanager/mgmt/2017-05-01/trafficmanager/endpoints.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/trafficmanager/mgmt/2017-05-01/trafficmanager/endpoints.go @@ -115,8 +115,8 @@ func (client EndpointsClient) CreateOrUpdateResponder(resp *http.Response) (resu // Delete deletes a Traffic Manager endpoint. // // resourceGroupName is the name of the resource group containing the Traffic Manager endpoint to be deleted. -// profileName is the name of the Traffic Manager profile. endpointType is the type of the Traffic Manager endpoint to -// be deleted. endpointName is the name of the Traffic Manager endpoint to be deleted. +// profileName is the name of the Traffic Manager profile. endpointType is the type of the Traffic Manager endpoint +// to be deleted. endpointName is the name of the Traffic Manager endpoint to be deleted. func (client EndpointsClient) Delete(ctx context.Context, resourceGroupName string, profileName string, endpointType string, endpointName string) (result DeleteOperationResult, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, profileName, endpointType, endpointName) if err != nil { @@ -184,9 +184,9 @@ func (client EndpointsClient) DeleteResponder(resp *http.Response) (result Delet // Get gets a Traffic Manager endpoint. // -// resourceGroupName is the name of the resource group containing the Traffic Manager endpoint. profileName is the name -// of the Traffic Manager profile. endpointType is the type of the Traffic Manager endpoint. endpointName is the name -// of the Traffic Manager endpoint. +// resourceGroupName is the name of the resource group containing the Traffic Manager endpoint. profileName is the +// name of the Traffic Manager profile. endpointType is the type of the Traffic Manager endpoint. endpointName is +// the name of the Traffic Manager endpoint. func (client EndpointsClient) Get(ctx context.Context, resourceGroupName string, profileName string, endpointType string, endpointName string) (result Endpoint, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, profileName, endpointType, endpointName) if err != nil { @@ -255,8 +255,8 @@ func (client EndpointsClient) GetResponder(resp *http.Response) (result Endpoint // Update update a Traffic Manager endpoint. // // resourceGroupName is the name of the resource group containing the Traffic Manager endpoint to be updated. -// profileName is the name of the Traffic Manager profile. endpointType is the type of the Traffic Manager endpoint to -// be updated. endpointName is the name of the Traffic Manager endpoint to be updated. parameters is the Traffic +// profileName is the name of the Traffic Manager profile. endpointType is the type of the Traffic Manager endpoint +// to be updated. endpointName is the name of the Traffic Manager endpoint to be updated. parameters is the Traffic // Manager endpoint parameters supplied to the Update operation. func (client EndpointsClient) Update(ctx context.Context, resourceGroupName string, profileName string, endpointType string, endpointName string, parameters Endpoint) (result Endpoint, err error) { req, err := client.UpdatePreparer(ctx, resourceGroupName, profileName, endpointType, endpointName, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/trafficmanager/mgmt/2017-05-01/trafficmanager/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/trafficmanager/mgmt/2017-05-01/trafficmanager/models.go index 82e399bb862d..5ddd7362fe76 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/trafficmanager/mgmt/2017-05-01/trafficmanager/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/trafficmanager/mgmt/2017-05-01/trafficmanager/models.go @@ -149,14 +149,14 @@ type DNSConfig struct { // Endpoint class representing a Traffic Manager endpoint. type Endpoint struct { autorest.Response `json:"-"` + // EndpointProperties - The properties of the Traffic Manager endpoint. + *EndpointProperties `json:"properties,omitempty"` // ID - Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName} ID *string `json:"id,omitempty"` // Name - The name of the resource Name *string `json:"name,omitempty"` // Type - The type of the resource. Ex- Microsoft.Network/trafficmanagerProfiles. Type *string `json:"type,omitempty"` - // EndpointProperties - The properties of the Traffic Manager endpoint. - *EndpointProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for Endpoint struct. @@ -166,46 +166,45 @@ func (e *Endpoint) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties EndpointProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - e.EndpointProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - e.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var endpointProperties EndpointProperties + err = json.Unmarshal(*v, &endpointProperties) + if err != nil { + return err + } + e.EndpointProperties = &endpointProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + e.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + e.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + e.Type = &typeVar + } } - e.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - e.Type = &typeVar } return nil @@ -236,14 +235,14 @@ type EndpointProperties struct { // GeographicHierarchy class representing the Geographic hierarchy used with the Geographic traffic routing method. type GeographicHierarchy struct { autorest.Response `json:"-"` + // GeographicHierarchyProperties - The properties of the Geographic Hierarchy resource. + *GeographicHierarchyProperties `json:"properties,omitempty"` // ID - Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName} ID *string `json:"id,omitempty"` // Name - The name of the resource Name *string `json:"name,omitempty"` // Type - The type of the resource. Ex- Microsoft.Network/trafficmanagerProfiles. Type *string `json:"type,omitempty"` - // GeographicHierarchyProperties - The properties of the Geographic Hierarchy resource. - *GeographicHierarchyProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for GeographicHierarchy struct. @@ -253,53 +252,52 @@ func (gh *GeographicHierarchy) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties GeographicHierarchyProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - gh.GeographicHierarchyProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - gh.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var geographicHierarchyProperties GeographicHierarchyProperties + err = json.Unmarshal(*v, &geographicHierarchyProperties) + if err != nil { + return err + } + gh.GeographicHierarchyProperties = &geographicHierarchyProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + gh.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + gh.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + gh.Type = &typeVar + } } - gh.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - gh.Type = &typeVar } return nil } -// GeographicHierarchyProperties class representing the properties of the Geographic hierarchy used with the Geographic -// traffic routing method. +// GeographicHierarchyProperties class representing the properties of the Geographic hierarchy used with the +// Geographic traffic routing method. type GeographicHierarchyProperties struct { // GeographicHierarchy - The region at the root of the hierarchy from all the regions in the hierarchy can be retrieved. GeographicHierarchy *Region `json:"geographicHierarchy,omitempty"` @@ -341,87 +339,108 @@ type NameAvailability struct { // Profile class representing a Traffic Manager profile. type Profile struct { autorest.Response `json:"-"` + // ProfileProperties - The properties of the Traffic Manager profile. + *ProfileProperties `json:"properties,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The Azure Region where the resource lives + Location *string `json:"location,omitempty"` // ID - Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName} ID *string `json:"id,omitempty"` // Name - The name of the resource Name *string `json:"name,omitempty"` // Type - The type of the resource. Ex- Microsoft.Network/trafficmanagerProfiles. Type *string `json:"type,omitempty"` - // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // Location - The Azure Region where the resource lives - Location *string `json:"location,omitempty"` - // ProfileProperties - The properties of the Traffic Manager profile. - *ProfileProperties `json:"properties,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for Profile struct. -func (p *Profile) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for Profile. +func (p Profile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if p.ProfileProperties != nil { + objectMap["properties"] = p.ProfileProperties } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ProfileProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - p.ProfileProperties = &properties + if p.Tags != nil { + objectMap["tags"] = p.Tags } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - p.Tags = &tags + if p.Location != nil { + objectMap["location"] = p.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - p.Location = &location + if p.ID != nil { + objectMap["id"] = p.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - p.ID = &ID + if p.Name != nil { + objectMap["name"] = p.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - p.Name = &name + if p.Type != nil { + objectMap["type"] = p.Type } + return json.Marshal(objectMap) +} - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for Profile struct. +func (p *Profile) 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 "properties": + if v != nil { + var profileProperties ProfileProperties + err = json.Unmarshal(*v, &profileProperties) + if err != nil { + return err + } + p.ProfileProperties = &profileProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + p.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + p.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + p.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + p.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + p.Type = &typeVar + } } - p.Type = &typeVar } return nil @@ -448,8 +467,8 @@ type ProfileProperties struct { Endpoints *[]Endpoint `json:"endpoints,omitempty"` } -// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than required -// location and tags +// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than +// required location and tags type ProxyResource struct { // ID - Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName} ID *string `json:"id,omitempty"` @@ -481,14 +500,35 @@ type Resource struct { // TrackedResource the resource model definition for a ARM tracked top level resource type TrackedResource struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The Azure Region where the resource lives + Location *string `json:"location,omitempty"` // ID - Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName} ID *string `json:"id,omitempty"` // Name - The name of the resource Name *string `json:"name,omitempty"` // Type - The type of the resource. Ex- Microsoft.Network/trafficmanagerProfiles. Type *string `json:"type,omitempty"` - // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // Location - The Azure Region where the resource lives - Location *string `json:"location,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 + } + if tr.ID != nil { + objectMap["id"] = tr.ID + } + if tr.Name != nil { + objectMap["name"] = tr.Name + } + if tr.Type != nil { + objectMap["type"] = tr.Type + } + return json.Marshal(objectMap) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/trafficmanager/mgmt/2017-05-01/trafficmanager/profiles.go b/vendor/github.com/Azure/azure-sdk-for-go/services/trafficmanager/mgmt/2017-05-01/trafficmanager/profiles.go index 1e4502cf68b4..4927a9966ee4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/trafficmanager/mgmt/2017-05-01/trafficmanager/profiles.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/trafficmanager/mgmt/2017-05-01/trafficmanager/profiles.go @@ -103,9 +103,9 @@ func (client ProfilesClient) CheckTrafficManagerRelativeDNSNameAvailabilityRespo // CreateOrUpdate create or update a Traffic Manager profile. // -// resourceGroupName is the name of the resource group containing the Traffic Manager profile. profileName is the name -// of the Traffic Manager profile. parameters is the Traffic Manager profile parameters supplied to the CreateOrUpdate -// operation. +// resourceGroupName is the name of the resource group containing the Traffic Manager profile. profileName is the +// name of the Traffic Manager profile. parameters is the Traffic Manager profile parameters supplied to the +// CreateOrUpdate operation. func (client ProfilesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, profileName string, parameters Profile) (result Profile, err error) { req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, profileName, parameters) if err != nil { @@ -240,8 +240,8 @@ func (client ProfilesClient) DeleteResponder(resp *http.Response) (result Delete // Get gets a Traffic Manager profile. // -// resourceGroupName is the name of the resource group containing the Traffic Manager profile. profileName is the name -// of the Traffic Manager profile. +// resourceGroupName is the name of the resource group containing the Traffic Manager profile. profileName is the +// name of the Traffic Manager profile. func (client ProfilesClient) Get(ctx context.Context, resourceGroupName string, profileName string) (result Profile, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, profileName) if err != nil { @@ -434,8 +434,8 @@ func (client ProfilesClient) ListBySubscriptionResponder(resp *http.Response) (r // Update update a Traffic Manager profile. // -// resourceGroupName is the name of the resource group containing the Traffic Manager profile. profileName is the name -// of the Traffic Manager profile. parameters is the Traffic Manager profile parameters supplied to the Update +// resourceGroupName is the name of the resource group containing the Traffic Manager profile. profileName is the +// name of the Traffic Manager profile. parameters is the Traffic Manager profile parameters supplied to the Update // operation. func (client ProfilesClient) Update(ctx context.Context, resourceGroupName string, profileName string, parameters Profile) (result Profile, err error) { req, err := client.UpdatePreparer(ctx, resourceGroupName, profileName, parameters) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/trafficmanager/mgmt/2017-05-01/trafficmanager/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/trafficmanager/mgmt/2017-05-01/trafficmanager/version.go index fea53a7d6015..0ee2738cada2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/trafficmanager/mgmt/2017-05-01/trafficmanager/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/trafficmanager/mgmt/2017-05-01/trafficmanager/version.go @@ -1,5 +1,7 @@ package trafficmanager +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package trafficmanager // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta services" + return "Azure-SDK-For-Go/" + version.Number + " trafficmanager/2017-05-01" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/apps.go b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/apps.go index 990006552096..68fa3986395e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/apps.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/apps.go @@ -50,7 +50,7 @@ func (client AppsClient) AddPremierAddOn(ctx context.Context, 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.NewErrorWithValidationError(err, "web.AppsClient", "AddPremierAddOn") + return result, validation.NewError("web.AppsClient", "AddPremierAddOn", err.Error()) } req, err := client.AddPremierAddOnPreparer(ctx, resourceGroupName, name, premierAddOnName, premierAddOn) @@ -121,15 +121,16 @@ func (client AppsClient) AddPremierAddOnResponder(resp *http.Response) (result P // AddPremierAddOnSlot updates a named add-on of an app. // // resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. -// premierAddOnName is add-on name. premierAddOn is a JSON representation of the edited premier add-on. slot is name of -// the deployment slot. If a slot is not specified, the API will update the named add-on for the production slot. +// premierAddOnName is add-on name. premierAddOn is a JSON representation of the edited premier add-on. slot is +// name of the deployment slot. If a slot is not specified, the API will update the named add-on for the production +// slot. func (client AppsClient) AddPremierAddOnSlot(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, premierAddOn PremierAddOn, slot string) (result PremierAddOn, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "AddPremierAddOnSlot") + return result, validation.NewError("web.AppsClient", "AddPremierAddOnSlot", err.Error()) } req, err := client.AddPremierAddOnSlotPreparer(ctx, resourceGroupName, name, premierAddOnName, premierAddOn, slot) @@ -200,15 +201,15 @@ func (client AppsClient) AddPremierAddOnSlotResponder(resp *http.Response) (resu // AnalyzeCustomHostname analyze a custom hostname. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. hostName is -// custom hostname. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. hostName +// is custom hostname. func (client AppsClient) AnalyzeCustomHostname(ctx context.Context, resourceGroupName string, name string, hostName string) (result CustomHostnameAnalysisResult, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "AnalyzeCustomHostname") + return result, validation.NewError("web.AppsClient", "AnalyzeCustomHostname", err.Error()) } req, err := client.AnalyzeCustomHostnamePreparer(ctx, resourceGroupName, name, hostName) @@ -278,15 +279,15 @@ func (client AppsClient) AnalyzeCustomHostnameResponder(resp *http.Response) (re // AnalyzeCustomHostnameSlot analyze a custom hostname. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. slot is name -// of web app slot. If not specified then will default to production slot. hostName is custom hostname. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. slot is +// name of web app slot. If not specified then will default to production slot. hostName is custom hostname. func (client AppsClient) AnalyzeCustomHostnameSlot(ctx context.Context, resourceGroupName string, name string, slot string, hostName string) (result CustomHostnameAnalysisResult, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "AnalyzeCustomHostnameSlot") + return result, validation.NewError("web.AppsClient", "AnalyzeCustomHostnameSlot", err.Error()) } req, err := client.AnalyzeCustomHostnameSlotPreparer(ctx, resourceGroupName, name, slot, hostName) @@ -368,7 +369,7 @@ func (client AppsClient) ApplySlotConfigToProduction(ctx context.Context, resour {TargetValue: slotSwapEntity, Constraints: []validation.Constraint{{Target: "slotSwapEntity.TargetSlot", Name: validation.Null, Rule: true, Chain: nil}, {Target: "slotSwapEntity.PreserveVnet", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppsClient", "ApplySlotConfigToProduction") + return result, validation.NewError("web.AppsClient", "ApplySlotConfigToProduction", err.Error()) } req, err := client.ApplySlotConfigToProductionPreparer(ctx, resourceGroupName, name, slotSwapEntity) @@ -437,8 +438,8 @@ func (client AppsClient) ApplySlotConfigToProductionResponder(resp *http.Respons // ApplySlotConfigurationSlot applies the configuration settings from the target slot onto the current slot. // // resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. -// slotSwapEntity is JSON object that contains the target slot name. See example. slot is name of the source slot. If a -// slot is not specified, the production slot is used as the source slot. +// slotSwapEntity is JSON object that contains the target slot name. See example. slot is name of the source slot. +// If a slot is not specified, the production slot is used as the source slot. func (client AppsClient) ApplySlotConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slotSwapEntity CsmSlotEntity, slot string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -448,7 +449,7 @@ func (client AppsClient) ApplySlotConfigurationSlot(ctx context.Context, resourc {TargetValue: slotSwapEntity, Constraints: []validation.Constraint{{Target: "slotSwapEntity.TargetSlot", Name: validation.Null, Rule: true, Chain: nil}, {Target: "slotSwapEntity.PreserveVnet", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppsClient", "ApplySlotConfigurationSlot") + return result, validation.NewError("web.AppsClient", "ApplySlotConfigurationSlot", err.Error()) } req, err := client.ApplySlotConfigurationSlotPreparer(ctx, resourceGroupName, name, slotSwapEntity, slot) @@ -517,8 +518,8 @@ func (client AppsClient) ApplySlotConfigurationSlotResponder(resp *http.Response // Backup creates a backup of an app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. request is -// backup configuration. You can use the JSON response from the POST action as input here. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. request +// is backup configuration. You can use the JSON response from the POST action as input here. func (client AppsClient) Backup(ctx context.Context, resourceGroupName string, name string, request BackupRequest) (result BackupItem, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -535,7 +536,7 @@ func (client AppsClient) Backup(ctx context.Context, resourceGroupName string, n {Target: "request.BackupRequestProperties.BackupSchedule.RetentionPeriodInDays", Name: validation.Null, Rule: true, Chain: nil}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppsClient", "Backup") + return result, validation.NewError("web.AppsClient", "Backup", err.Error()) } req, err := client.BackupPreparer(ctx, resourceGroupName, name, request) @@ -604,8 +605,8 @@ func (client AppsClient) BackupResponder(resp *http.Response) (result BackupItem // BackupSlot creates a backup of an app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. request is -// backup configuration. You can use the JSON response from the POST action as input here. slot is name of the +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. request +// is backup configuration. You can use the JSON response from the POST action as input here. slot is name of the // deployment slot. If a slot is not specified, the API will create a backup for the production slot. func (client AppsClient) BackupSlot(ctx context.Context, resourceGroupName string, name string, request BackupRequest, slot string) (result BackupItem, err error) { if err := validation.Validate([]validation.Validation{ @@ -623,7 +624,7 @@ func (client AppsClient) BackupSlot(ctx context.Context, resourceGroupName strin {Target: "request.BackupRequestProperties.BackupSchedule.RetentionPeriodInDays", Name: validation.Null, Rule: true, Chain: nil}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppsClient", "BackupSlot") + return result, validation.NewError("web.AppsClient", "BackupSlot", err.Error()) } req, err := client.BackupSlotPreparer(ctx, resourceGroupName, name, request, slot) @@ -693,15 +694,15 @@ func (client AppsClient) BackupSlotResponder(resp *http.Response) (result Backup // CreateDeployment create a deployment for an app, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. ID is ID of -// an existing deployment. deployment is deployment details. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. ID is ID +// of an existing deployment. deployment is deployment details. func (client AppsClient) CreateDeployment(ctx context.Context, resourceGroupName string, name string, ID string, deployment Deployment) (result Deployment, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "CreateDeployment") + return result, validation.NewError("web.AppsClient", "CreateDeployment", err.Error()) } req, err := client.CreateDeploymentPreparer(ctx, resourceGroupName, name, ID, deployment) @@ -771,8 +772,8 @@ func (client AppsClient) CreateDeploymentResponder(resp *http.Response) (result // CreateDeploymentSlot create a deployment for an app, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. ID is ID of -// an existing deployment. slot is name of the deployment slot. If a slot is not specified, the API creates a +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. ID is ID +// of an existing deployment. slot is name of the deployment slot. If a slot is not specified, the API creates a // deployment for the production slot. deployment is deployment details. func (client AppsClient) CreateDeploymentSlot(ctx context.Context, resourceGroupName string, name string, ID string, slot string, deployment Deployment) (result Deployment, err error) { if err := validation.Validate([]validation.Validation{ @@ -780,7 +781,7 @@ func (client AppsClient) CreateDeploymentSlot(ctx context.Context, resourceGroup 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.NewErrorWithValidationError(err, "web.AppsClient", "CreateDeploymentSlot") + return result, validation.NewError("web.AppsClient", "CreateDeploymentSlot", err.Error()) } req, err := client.CreateDeploymentSlotPreparer(ctx, resourceGroupName, name, ID, slot, deployment) @@ -851,15 +852,15 @@ func (client AppsClient) CreateDeploymentSlotResponder(resp *http.Response) (res // CreateFunction create function for web site, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. functionName is -// function name. functionEnvelope is function details. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. functionName +// is function name. functionEnvelope is function details. func (client AppsClient) CreateFunction(ctx context.Context, resourceGroupName string, name string, functionName string, functionEnvelope FunctionEnvelope) (result AppsCreateFunctionFuture, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "CreateFunction") + return result, validation.NewError("web.AppsClient", "CreateFunction", err.Error()) } req, err := client.CreateFunctionPreparer(ctx, resourceGroupName, name, functionName, functionEnvelope) @@ -931,16 +932,16 @@ func (client AppsClient) CreateFunctionResponder(resp *http.Response) (result Fu // CreateInstanceFunctionSlot create function for web site, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. functionName is -// function name. slot is name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. functionEnvelope is function details. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. functionName +// is function name. slot is name of the deployment slot. If a slot is not specified, the API deletes a deployment +// for the production slot. functionEnvelope is function details. func (client AppsClient) CreateInstanceFunctionSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string, functionEnvelope FunctionEnvelope) (result AppsCreateInstanceFunctionSlotFuture, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "CreateInstanceFunctionSlot") + return result, validation.NewError("web.AppsClient", "CreateInstanceFunctionSlot", err.Error()) } req, err := client.CreateInstanceFunctionSlotPreparer(ctx, resourceGroupName, name, functionName, slot, functionEnvelope) @@ -1013,15 +1014,15 @@ func (client AppsClient) CreateInstanceFunctionSlotResponder(resp *http.Response // CreateInstanceMSDeployOperation invoke the MSDeploy web app extension. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. instanceID -// is ID of web app instance. mSDeploy is details of MSDeploy operation +// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. +// instanceID is ID of web app instance. mSDeploy is details of MSDeploy operation func (client AppsClient) CreateInstanceMSDeployOperation(ctx context.Context, resourceGroupName string, name string, instanceID string, mSDeploy MSDeploy) (result AppsCreateInstanceMSDeployOperationFuture, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "CreateInstanceMSDeployOperation") + return result, validation.NewError("web.AppsClient", "CreateInstanceMSDeployOperation", err.Error()) } req, err := client.CreateInstanceMSDeployOperationPreparer(ctx, resourceGroupName, name, instanceID, mSDeploy) @@ -1093,16 +1094,16 @@ func (client AppsClient) CreateInstanceMSDeployOperationResponder(resp *http.Res // CreateInstanceMSDeployOperationSlot invoke the MSDeploy web app extension. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. slot is name -// of web app slot. If not specified then will default to production slot. instanceID is ID of web app instance. -// mSDeploy is details of MSDeploy operation +// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. slot is +// name of web app slot. If not specified then will default to production slot. instanceID is ID of web app +// instance. mSDeploy is details of MSDeploy operation func (client AppsClient) CreateInstanceMSDeployOperationSlot(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string, mSDeploy MSDeploy) (result AppsCreateInstanceMSDeployOperationSlotFuture, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "CreateInstanceMSDeployOperationSlot") + return result, validation.NewError("web.AppsClient", "CreateInstanceMSDeployOperationSlot", err.Error()) } req, err := client.CreateInstanceMSDeployOperationSlotPreparer(ctx, resourceGroupName, name, slot, instanceID, mSDeploy) @@ -1175,15 +1176,15 @@ func (client AppsClient) CreateInstanceMSDeployOperationSlotResponder(resp *http // CreateMSDeployOperation invoke the MSDeploy web app extension. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. mSDeploy is -// details of MSDeploy operation +// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. mSDeploy +// is details of MSDeploy operation func (client AppsClient) CreateMSDeployOperation(ctx context.Context, resourceGroupName string, name string, mSDeploy MSDeploy) (result AppsCreateMSDeployOperationFuture, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "CreateMSDeployOperation") + return result, validation.NewError("web.AppsClient", "CreateMSDeployOperation", err.Error()) } req, err := client.CreateMSDeployOperationPreparer(ctx, resourceGroupName, name, mSDeploy) @@ -1254,15 +1255,16 @@ func (client AppsClient) CreateMSDeployOperationResponder(resp *http.Response) ( // CreateMSDeployOperationSlot invoke the MSDeploy web app extension. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. slot is name -// of web app slot. If not specified then will default to production slot. mSDeploy is details of MSDeploy operation +// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. slot is +// name of web app slot. If not specified then will default to production slot. mSDeploy is details of MSDeploy +// operation func (client AppsClient) CreateMSDeployOperationSlot(ctx context.Context, resourceGroupName string, name string, slot string, mSDeploy MSDeploy) (result AppsCreateMSDeployOperationSlotFuture, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "CreateMSDeployOperationSlot") + return result, validation.NewError("web.AppsClient", "CreateMSDeployOperationSlot", err.Error()) } req, err := client.CreateMSDeployOperationSlotPreparer(ctx, resourceGroupName, name, slot, mSDeploy) @@ -1336,11 +1338,11 @@ func (client AppsClient) CreateMSDeployOperationSlotResponder(resp *http.Respons // // resourceGroupName is name of the resource group to which the resource belongs. name is unique name of the app to // create or update. To create or update a deployment slot, use the {slot} parameter. siteEnvelope is a JSON -// representation of the app properties. See example. skipDNSRegistration is if true web app hostname is not registered -// with DNS on creation. This parameter is +// representation of the app properties. See example. skipDNSRegistration is if true web app hostname is not +// registered with DNS on creation. This parameter is // only used for app creation. skipCustomDomainVerification is if true, custom (non *.azurewebsites.net) domains -// associated with web app are not verified. forceDNSRegistration is if true, web app hostname is force registered with -// DNS. TTLInSeconds is time to live in seconds for web app's default domain name. +// associated with web app are not verified. forceDNSRegistration is if true, web app hostname is force registered +// with DNS. TTLInSeconds is time to live in seconds for web app's default domain name. func (client AppsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, name string, siteEnvelope Site, skipDNSRegistration *bool, skipCustomDomainVerification *bool, forceDNSRegistration *bool, TTLInSeconds string) (result AppsCreateOrUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -1362,7 +1364,7 @@ func (client AppsClient) CreateOrUpdate(ctx context.Context, resourceGroupName s Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SnapshotInfo.SnapshotRecoveryRequestProperties.Overwrite", Name: validation.Null, Rule: true, Chain: nil}}}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppsClient", "CreateOrUpdate") + return result, validation.NewError("web.AppsClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, name, siteEnvelope, skipDNSRegistration, skipCustomDomainVerification, forceDNSRegistration, TTLInSeconds) @@ -1445,8 +1447,8 @@ func (client AppsClient) CreateOrUpdateResponder(resp *http.Response) (result Si // CreateOrUpdateConfiguration updates the configuration of an app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. siteConfig -// is JSON representation of a SiteConfig object. See example. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. +// siteConfig is JSON representation of a SiteConfig object. See example. func (client AppsClient) CreateOrUpdateConfiguration(ctx context.Context, resourceGroupName string, name string, siteConfig SiteConfigResource) (result SiteConfigResource, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -1460,7 +1462,7 @@ func (client AppsClient) CreateOrUpdateConfiguration(ctx context.Context, resour Chain: []validation.Constraint{{Target: "siteConfig.SiteConfig.Push.PushSettingsProperties.IsPushEnabled", Name: validation.Null, Rule: true, Chain: nil}}}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppsClient", "CreateOrUpdateConfiguration") + return result, validation.NewError("web.AppsClient", "CreateOrUpdateConfiguration", err.Error()) } req, err := client.CreateOrUpdateConfigurationPreparer(ctx, resourceGroupName, name, siteConfig) @@ -1529,9 +1531,9 @@ func (client AppsClient) CreateOrUpdateConfigurationResponder(resp *http.Respons // CreateOrUpdateConfigurationSlot updates the configuration of an app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. siteConfig -// is JSON representation of a SiteConfig object. See example. slot is name of the deployment slot. If a slot is not -// specified, the API will update configuration for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. +// siteConfig is JSON representation of a SiteConfig object. See example. slot is name of the deployment slot. If a +// slot is not specified, the API will update configuration for the production slot. func (client AppsClient) CreateOrUpdateConfigurationSlot(ctx context.Context, resourceGroupName string, name string, siteConfig SiteConfigResource, slot string) (result SiteConfigResource, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -1545,7 +1547,7 @@ func (client AppsClient) CreateOrUpdateConfigurationSlot(ctx context.Context, re Chain: []validation.Constraint{{Target: "siteConfig.SiteConfig.Push.PushSettingsProperties.IsPushEnabled", Name: validation.Null, Rule: true, Chain: nil}}}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppsClient", "CreateOrUpdateConfigurationSlot") + return result, validation.NewError("web.AppsClient", "CreateOrUpdateConfigurationSlot", err.Error()) } req, err := client.CreateOrUpdateConfigurationSlotPreparer(ctx, resourceGroupName, name, siteConfig, slot) @@ -1625,7 +1627,7 @@ func (client AppsClient) CreateOrUpdateDomainOwnershipIdentifier(ctx context.Con 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.NewErrorWithValidationError(err, "web.AppsClient", "CreateOrUpdateDomainOwnershipIdentifier") + return result, validation.NewError("web.AppsClient", "CreateOrUpdateDomainOwnershipIdentifier", err.Error()) } req, err := client.CreateOrUpdateDomainOwnershipIdentifierPreparer(ctx, resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier) @@ -1698,15 +1700,15 @@ func (client AppsClient) CreateOrUpdateDomainOwnershipIdentifierResponder(resp * // // resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. // domainOwnershipIdentifierName is name of domain ownership identifier. domainOwnershipIdentifier is a JSON -// representation of the domain ownership properties. slot is name of the deployment slot. If a slot is not specified, -// the API will delete the binding for the production slot. +// representation of the domain ownership properties. slot is name of the deployment slot. If a slot is not +// specified, the API will delete the binding for the production slot. func (client AppsClient) CreateOrUpdateDomainOwnershipIdentifierSlot(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, domainOwnershipIdentifier Identifier, slot string) (result Identifier, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "CreateOrUpdateDomainOwnershipIdentifierSlot") + return result, validation.NewError("web.AppsClient", "CreateOrUpdateDomainOwnershipIdentifierSlot", err.Error()) } req, err := client.CreateOrUpdateDomainOwnershipIdentifierSlotPreparer(ctx, resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, slot) @@ -1777,8 +1779,8 @@ func (client AppsClient) CreateOrUpdateDomainOwnershipIdentifierSlotResponder(re // CreateOrUpdateHostNameBinding creates a hostname binding for an app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. hostName is -// hostname in the hostname binding. hostNameBinding is binding details. This is the JSON representation of a +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. hostName +// is hostname in the hostname binding. hostNameBinding is binding details. This is the JSON representation of a // HostNameBinding object. func (client AppsClient) CreateOrUpdateHostNameBinding(ctx context.Context, resourceGroupName string, name string, hostName string, hostNameBinding HostNameBinding) (result HostNameBinding, err error) { if err := validation.Validate([]validation.Validation{ @@ -1786,7 +1788,7 @@ func (client AppsClient) CreateOrUpdateHostNameBinding(ctx context.Context, reso 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.NewErrorWithValidationError(err, "web.AppsClient", "CreateOrUpdateHostNameBinding") + return result, validation.NewError("web.AppsClient", "CreateOrUpdateHostNameBinding", err.Error()) } req, err := client.CreateOrUpdateHostNameBindingPreparer(ctx, resourceGroupName, name, hostName, hostNameBinding) @@ -1856,8 +1858,8 @@ func (client AppsClient) CreateOrUpdateHostNameBindingResponder(resp *http.Respo // CreateOrUpdateHostNameBindingSlot creates a hostname binding for an app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. hostName is -// hostname in the hostname binding. hostNameBinding is binding details. This is the JSON representation of a +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. hostName +// is hostname in the hostname binding. hostNameBinding is binding details. This is the JSON representation of a // HostNameBinding object. slot is name of the deployment slot. If a slot is not specified, the API will create a // binding for the production slot. func (client AppsClient) CreateOrUpdateHostNameBindingSlot(ctx context.Context, resourceGroupName string, name string, hostName string, hostNameBinding HostNameBinding, slot string) (result HostNameBinding, err error) { @@ -1866,7 +1868,7 @@ func (client AppsClient) CreateOrUpdateHostNameBindingSlot(ctx context.Context, 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.NewErrorWithValidationError(err, "web.AppsClient", "CreateOrUpdateHostNameBindingSlot") + return result, validation.NewError("web.AppsClient", "CreateOrUpdateHostNameBindingSlot", err.Error()) } req, err := client.CreateOrUpdateHostNameBindingSlotPreparer(ctx, resourceGroupName, name, hostName, hostNameBinding, slot) @@ -1938,15 +1940,15 @@ func (client AppsClient) CreateOrUpdateHostNameBindingSlotResponder(resp *http.R // CreateOrUpdateHybridConnection creates a new Hybrid Connection using a Service Bus relay. // // resourceGroupName is name of the resource group to which the resource belongs. name is the name of the web app. -// namespaceName is the namespace for this hybrid connection. relayName is the relay name for this hybrid connection. -// connectionEnvelope is the details of the hybrid connection. +// namespaceName is the namespace for this hybrid connection. relayName is the relay name for this hybrid +// connection. connectionEnvelope is the details of the hybrid connection. func (client AppsClient) CreateOrUpdateHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, connectionEnvelope HybridConnection) (result HybridConnection, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "CreateOrUpdateHybridConnection") + return result, validation.NewError("web.AppsClient", "CreateOrUpdateHybridConnection", err.Error()) } req, err := client.CreateOrUpdateHybridConnectionPreparer(ctx, resourceGroupName, name, namespaceName, relayName, connectionEnvelope) @@ -2018,15 +2020,16 @@ func (client AppsClient) CreateOrUpdateHybridConnectionResponder(resp *http.Resp // CreateOrUpdateHybridConnectionSlot creates a new Hybrid Connection using a Service Bus relay. // // resourceGroupName is name of the resource group to which the resource belongs. name is the name of the web app. -// namespaceName is the namespace for this hybrid connection. relayName is the relay name for this hybrid connection. -// connectionEnvelope is the details of the hybrid connection. slot is the name of the slot for the web app. +// namespaceName is the namespace for this hybrid connection. relayName is the relay name for this hybrid +// connection. connectionEnvelope is the details of the hybrid connection. slot is the name of the slot for the web +// app. func (client AppsClient) CreateOrUpdateHybridConnectionSlot(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, connectionEnvelope HybridConnection, slot string) (result HybridConnection, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "CreateOrUpdateHybridConnectionSlot") + return result, validation.NewError("web.AppsClient", "CreateOrUpdateHybridConnectionSlot", err.Error()) } req, err := client.CreateOrUpdateHybridConnectionSlotPreparer(ctx, resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot) @@ -2099,15 +2102,15 @@ func (client AppsClient) CreateOrUpdateHybridConnectionSlotResponder(resp *http. // CreateOrUpdatePublicCertificate creates a hostname binding for an app. // // resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. -// publicCertificateName is public certificate name. publicCertificate is public certificate details. This is the JSON -// representation of a PublicCertificate object. +// publicCertificateName is public certificate name. publicCertificate is public certificate details. This is the +// JSON representation of a PublicCertificate object. func (client AppsClient) CreateOrUpdatePublicCertificate(ctx context.Context, resourceGroupName string, name string, publicCertificateName string, publicCertificate PublicCertificate) (result PublicCertificate, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "CreateOrUpdatePublicCertificate") + return result, validation.NewError("web.AppsClient", "CreateOrUpdatePublicCertificate", err.Error()) } req, err := client.CreateOrUpdatePublicCertificatePreparer(ctx, resourceGroupName, name, publicCertificateName, publicCertificate) @@ -2178,16 +2181,16 @@ func (client AppsClient) CreateOrUpdatePublicCertificateResponder(resp *http.Res // CreateOrUpdatePublicCertificateSlot creates a hostname binding for an app. // // resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. -// publicCertificateName is public certificate name. publicCertificate is public certificate details. This is the JSON -// representation of a PublicCertificate object. slot is name of the deployment slot. If a slot is not specified, the -// API will create a binding for the production slot. +// publicCertificateName is public certificate name. publicCertificate is public certificate details. This is the +// JSON representation of a PublicCertificate object. slot is name of the deployment slot. If a slot is not +// specified, the API will create a binding for the production slot. func (client AppsClient) CreateOrUpdatePublicCertificateSlot(ctx context.Context, resourceGroupName string, name string, publicCertificateName string, publicCertificate PublicCertificate, slot string) (result PublicCertificate, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "CreateOrUpdatePublicCertificateSlot") + return result, validation.NewError("web.AppsClient", "CreateOrUpdatePublicCertificateSlot", err.Error()) } req, err := client.CreateOrUpdatePublicCertificateSlotPreparer(ctx, resourceGroupName, name, publicCertificateName, publicCertificate, slot) @@ -2259,16 +2262,16 @@ func (client AppsClient) CreateOrUpdatePublicCertificateSlotResponder(resp *http // CreateOrUpdateRelayServiceConnection creates a new hybrid connection configuration (PUT), or updates an existing one // (PATCH). // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. entityName -// is name of the hybrid connection configuration. connectionEnvelope is details of the hybrid connection -// configuration. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. +// entityName is name of the hybrid connection configuration. connectionEnvelope is details of the hybrid +// connection configuration. func (client AppsClient) CreateOrUpdateRelayServiceConnection(ctx context.Context, resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity) (result RelayServiceConnectionEntity, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "CreateOrUpdateRelayServiceConnection") + return result, validation.NewError("web.AppsClient", "CreateOrUpdateRelayServiceConnection", err.Error()) } req, err := client.CreateOrUpdateRelayServiceConnectionPreparer(ctx, resourceGroupName, name, entityName, connectionEnvelope) @@ -2339,17 +2342,17 @@ func (client AppsClient) CreateOrUpdateRelayServiceConnectionResponder(resp *htt // CreateOrUpdateRelayServiceConnectionSlot creates a new hybrid connection configuration (PUT), or updates an existing // one (PATCH). // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. entityName -// is name of the hybrid connection configuration. connectionEnvelope is details of the hybrid connection -// configuration. slot is name of the deployment slot. If a slot is not specified, the API will create or update a -// hybrid connection for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. +// entityName is name of the hybrid connection configuration. connectionEnvelope is details of the hybrid +// connection configuration. slot is name of the deployment slot. If a slot is not specified, the API will create +// or update a hybrid connection for the production slot. func (client AppsClient) CreateOrUpdateRelayServiceConnectionSlot(ctx context.Context, resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity, slot string) (result RelayServiceConnectionEntity, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "CreateOrUpdateRelayServiceConnectionSlot") + return result, validation.NewError("web.AppsClient", "CreateOrUpdateRelayServiceConnectionSlot", err.Error()) } req, err := client.CreateOrUpdateRelayServiceConnectionSlotPreparer(ctx, resourceGroupName, name, entityName, connectionEnvelope, slot) @@ -2423,11 +2426,11 @@ func (client AppsClient) CreateOrUpdateRelayServiceConnectionSlotResponder(resp // resourceGroupName is name of the resource group to which the resource belongs. name is unique name of the app to // create or update. To create or update a deployment slot, use the {slot} parameter. siteEnvelope is a JSON // representation of the app properties. See example. slot is name of the deployment slot to create or update. By -// default, this API attempts to create or modify the production slot. skipDNSRegistration is if true web app hostname -// is not registered with DNS on creation. This parameter is +// default, this API attempts to create or modify the production slot. skipDNSRegistration is if true web app +// hostname is not registered with DNS on creation. This parameter is // only used for app creation. skipCustomDomainVerification is if true, custom (non *.azurewebsites.net) domains -// associated with web app are not verified. forceDNSRegistration is if true, web app hostname is force registered with -// DNS. TTLInSeconds is time to live in seconds for web app's default domain name. +// associated with web app are not verified. forceDNSRegistration is if true, web app hostname is force registered +// with DNS. TTLInSeconds is time to live in seconds for web app's default domain name. func (client AppsClient) CreateOrUpdateSlot(ctx context.Context, resourceGroupName string, name string, siteEnvelope Site, slot string, skipDNSRegistration *bool, skipCustomDomainVerification *bool, forceDNSRegistration *bool, TTLInSeconds string) (result AppsCreateOrUpdateSlotFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -2449,7 +2452,7 @@ func (client AppsClient) CreateOrUpdateSlot(ctx context.Context, resourceGroupNa Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SnapshotInfo.SnapshotRecoveryRequestProperties.Overwrite", Name: validation.Null, Rule: true, Chain: nil}}}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppsClient", "CreateOrUpdateSlot") + return result, validation.NewError("web.AppsClient", "CreateOrUpdateSlot", err.Error()) } req, err := client.CreateOrUpdateSlotPreparer(ctx, resourceGroupName, name, siteEnvelope, slot, skipDNSRegistration, skipCustomDomainVerification, forceDNSRegistration, TTLInSeconds) @@ -2541,7 +2544,7 @@ func (client AppsClient) CreateOrUpdateSourceControl(ctx context.Context, resour 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.NewErrorWithValidationError(err, "web.AppsClient", "CreateOrUpdateSourceControl") + return result, validation.NewError("web.AppsClient", "CreateOrUpdateSourceControl", err.Error()) } req, err := client.CreateOrUpdateSourceControlPreparer(ctx, resourceGroupName, name, siteSourceControl) @@ -2613,15 +2616,16 @@ func (client AppsClient) CreateOrUpdateSourceControlResponder(resp *http.Respons // CreateOrUpdateSourceControlSlot updates the source control configuration of an app. // // resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. -// siteSourceControl is JSON representation of a SiteSourceControl object. See example. slot is name of the deployment -// slot. If a slot is not specified, the API will update the source control configuration for the production slot. +// siteSourceControl is JSON representation of a SiteSourceControl object. See example. slot is name of the +// deployment slot. If a slot is not specified, the API will update the source control configuration for the +// production slot. func (client AppsClient) CreateOrUpdateSourceControlSlot(ctx context.Context, resourceGroupName string, name string, siteSourceControl SiteSourceControl, slot string) (result AppsCreateOrUpdateSourceControlSlotFuture, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "CreateOrUpdateSourceControlSlot") + return result, validation.NewError("web.AppsClient", "CreateOrUpdateSourceControlSlot", err.Error()) } req, err := client.CreateOrUpdateSourceControlSlotPreparer(ctx, resourceGroupName, name, siteSourceControl, slot) @@ -2694,8 +2698,8 @@ func (client AppsClient) CreateOrUpdateSourceControlSlotResponder(resp *http.Res // CreateOrUpdateVnetConnection adds a Virtual Network connection to an app or slot (PUT) or updates the connection // properties (PATCH). // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. vnetName is -// name of an existing Virtual Network. connectionEnvelope is properties of the Virtual Network connection. See +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. vnetName +// is name of an existing Virtual Network. connectionEnvelope is properties of the Virtual Network connection. See // example. func (client AppsClient) CreateOrUpdateVnetConnection(ctx context.Context, resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfo) (result VnetInfo, err error) { if err := validation.Validate([]validation.Validation{ @@ -2703,7 +2707,7 @@ func (client AppsClient) CreateOrUpdateVnetConnection(ctx context.Context, resou 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.NewErrorWithValidationError(err, "web.AppsClient", "CreateOrUpdateVnetConnection") + return result, validation.NewError("web.AppsClient", "CreateOrUpdateVnetConnection", err.Error()) } req, err := client.CreateOrUpdateVnetConnectionPreparer(ctx, resourceGroupName, name, vnetName, connectionEnvelope) @@ -2773,9 +2777,9 @@ func (client AppsClient) CreateOrUpdateVnetConnectionResponder(resp *http.Respon // CreateOrUpdateVnetConnectionGateway adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. vnetName is -// name of the Virtual Network. gatewayName is name of the gateway. Currently, the only supported string is "primary". -// connectionEnvelope is the properties to update this gateway with. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. vnetName +// is name of the Virtual Network. gatewayName is name of the gateway. Currently, the only supported string is +// "primary". connectionEnvelope is the properties to update this gateway with. func (client AppsClient) CreateOrUpdateVnetConnectionGateway(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway) (result VnetGateway, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -2785,7 +2789,7 @@ func (client AppsClient) CreateOrUpdateVnetConnectionGateway(ctx context.Context {TargetValue: connectionEnvelope, Constraints: []validation.Constraint{{Target: "connectionEnvelope.VnetGatewayProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "connectionEnvelope.VnetGatewayProperties.VpnPackageURI", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppsClient", "CreateOrUpdateVnetConnectionGateway") + return result, validation.NewError("web.AppsClient", "CreateOrUpdateVnetConnectionGateway", err.Error()) } req, err := client.CreateOrUpdateVnetConnectionGatewayPreparer(ctx, resourceGroupName, name, vnetName, gatewayName, connectionEnvelope) @@ -2856,10 +2860,11 @@ func (client AppsClient) CreateOrUpdateVnetConnectionGatewayResponder(resp *http // CreateOrUpdateVnetConnectionGatewaySlot adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. vnetName is -// name of the Virtual Network. gatewayName is name of the gateway. Currently, the only supported string is "primary". -// connectionEnvelope is the properties to update this gateway with. slot is name of the deployment slot. If a slot is -// not specified, the API will add or update a gateway for the production slot's Virtual Network. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. vnetName +// is name of the Virtual Network. gatewayName is name of the gateway. Currently, the only supported string is +// "primary". connectionEnvelope is the properties to update this gateway with. slot is name of the deployment +// slot. If a slot is not specified, the API will add or update a gateway for the production slot's Virtual +// Network. func (client AppsClient) CreateOrUpdateVnetConnectionGatewaySlot(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway, slot string) (result VnetGateway, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -2869,7 +2874,7 @@ func (client AppsClient) CreateOrUpdateVnetConnectionGatewaySlot(ctx context.Con {TargetValue: connectionEnvelope, Constraints: []validation.Constraint{{Target: "connectionEnvelope.VnetGatewayProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "connectionEnvelope.VnetGatewayProperties.VpnPackageURI", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppsClient", "CreateOrUpdateVnetConnectionGatewaySlot") + return result, validation.NewError("web.AppsClient", "CreateOrUpdateVnetConnectionGatewaySlot", err.Error()) } req, err := client.CreateOrUpdateVnetConnectionGatewaySlotPreparer(ctx, resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, slot) @@ -2942,17 +2947,17 @@ func (client AppsClient) CreateOrUpdateVnetConnectionGatewaySlotResponder(resp * // CreateOrUpdateVnetConnectionSlot adds a Virtual Network connection to an app or slot (PUT) or updates the connection // properties (PATCH). // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. vnetName is -// name of an existing Virtual Network. connectionEnvelope is properties of the Virtual Network connection. See -// example. slot is name of the deployment slot. If a slot is not specified, the API will add or update connections for -// the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. vnetName +// is name of an existing Virtual Network. connectionEnvelope is properties of the Virtual Network connection. See +// example. slot is name of the deployment slot. If a slot is not specified, the API will add or update connections +// for the production slot. func (client AppsClient) CreateOrUpdateVnetConnectionSlot(ctx context.Context, resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfo, slot string) (result VnetInfo, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "CreateOrUpdateVnetConnectionSlot") + return result, validation.NewError("web.AppsClient", "CreateOrUpdateVnetConnectionSlot", err.Error()) } req, err := client.CreateOrUpdateVnetConnectionSlotPreparer(ctx, resourceGroupName, name, vnetName, connectionEnvelope, slot) @@ -3023,17 +3028,17 @@ func (client AppsClient) CreateOrUpdateVnetConnectionSlotResponder(resp *http.Re // Delete deletes a web, mobile, or API app, or one of the deployment slots. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app to delete. -// deleteMetrics is if true, web app metrics are also deleted. deleteEmptyServerFarm is specify true if the App Service -// plan will be empty after app deletion and you want to delete the empty App Service plan. By default, the empty App -// Service plan is not deleted. skipDNSRegistration is if true, DNS registration is skipped. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app to +// delete. deleteMetrics is if true, web app metrics are also deleted. deleteEmptyServerFarm is specify true if the +// App Service plan will be empty after app deletion and you want to delete the empty App Service plan. By default, +// the empty App Service plan is not deleted. skipDNSRegistration is if true, DNS registration is skipped. func (client AppsClient) Delete(ctx context.Context, resourceGroupName string, name string, deleteMetrics *bool, deleteEmptyServerFarm *bool, skipDNSRegistration *bool) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "Delete") + return result, validation.NewError("web.AppsClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, name, deleteMetrics, deleteEmptyServerFarm, skipDNSRegistration) @@ -3108,15 +3113,15 @@ func (client AppsClient) DeleteResponder(resp *http.Response) (result autorest.R // DeleteBackup deletes a backup of an app by its ID. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. backupID is -// ID of the backup. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. backupID +// is ID of the backup. func (client AppsClient) DeleteBackup(ctx context.Context, resourceGroupName string, name string, backupID string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "DeleteBackup") + return result, validation.NewError("web.AppsClient", "DeleteBackup", err.Error()) } req, err := client.DeleteBackupPreparer(ctx, resourceGroupName, name, backupID) @@ -3190,7 +3195,7 @@ func (client AppsClient) DeleteBackupConfiguration(ctx context.Context, resource 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.NewErrorWithValidationError(err, "web.AppsClient", "DeleteBackupConfiguration") + return result, validation.NewError("web.AppsClient", "DeleteBackupConfiguration", err.Error()) } req, err := client.DeleteBackupConfigurationPreparer(ctx, resourceGroupName, name) @@ -3256,16 +3261,16 @@ func (client AppsClient) DeleteBackupConfigurationResponder(resp *http.Response) // DeleteBackupConfigurationSlot deletes the backup configuration of an app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API will delete the backup configuration for the production -// slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API will delete the backup configuration for the +// production slot. func (client AppsClient) DeleteBackupConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "DeleteBackupConfigurationSlot") + return result, validation.NewError("web.AppsClient", "DeleteBackupConfigurationSlot", err.Error()) } req, err := client.DeleteBackupConfigurationSlotPreparer(ctx, resourceGroupName, name, slot) @@ -3332,16 +3337,16 @@ func (client AppsClient) DeleteBackupConfigurationSlotResponder(resp *http.Respo // DeleteBackupSlot deletes a backup of an app by its ID. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. backupID is -// ID of the backup. slot is name of the deployment slot. If a slot is not specified, the API will delete a backup of -// the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. backupID +// is ID of the backup. slot is name of the deployment slot. If a slot is not specified, the API will delete a +// backup of the production slot. func (client AppsClient) DeleteBackupSlot(ctx context.Context, resourceGroupName string, name string, backupID string, slot string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "DeleteBackupSlot") + return result, validation.NewError("web.AppsClient", "DeleteBackupSlot", err.Error()) } req, err := client.DeleteBackupSlotPreparer(ctx, resourceGroupName, name, backupID, slot) @@ -3409,15 +3414,15 @@ func (client AppsClient) DeleteBackupSlotResponder(resp *http.Response) (result // DeleteContinuousWebJob delete a continuous web job by its ID for an app, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is name -// of Web Job. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is +// name of Web Job. func (client AppsClient) DeleteContinuousWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "DeleteContinuousWebJob") + return result, validation.NewError("web.AppsClient", "DeleteContinuousWebJob", err.Error()) } req, err := client.DeleteContinuousWebJobPreparer(ctx, resourceGroupName, name, webJobName) @@ -3484,16 +3489,16 @@ func (client AppsClient) DeleteContinuousWebJobResponder(resp *http.Response) (r // DeleteContinuousWebJobSlot delete a continuous web job by its ID for an app, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is name -// of Web Job. slot is name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is +// name of Web Job. slot is name of the deployment slot. If a slot is not specified, the API deletes a deployment +// for the production slot. func (client AppsClient) DeleteContinuousWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "DeleteContinuousWebJobSlot") + return result, validation.NewError("web.AppsClient", "DeleteContinuousWebJobSlot", err.Error()) } req, err := client.DeleteContinuousWebJobSlotPreparer(ctx, resourceGroupName, name, webJobName, slot) @@ -3569,7 +3574,7 @@ func (client AppsClient) DeleteDeployment(ctx context.Context, 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.NewErrorWithValidationError(err, "web.AppsClient", "DeleteDeployment") + return result, validation.NewError("web.AppsClient", "DeleteDeployment", err.Error()) } req, err := client.DeleteDeploymentPreparer(ctx, resourceGroupName, name, ID) @@ -3637,15 +3642,15 @@ func (client AppsClient) DeleteDeploymentResponder(resp *http.Response) (result // DeleteDeploymentSlot delete a deployment by its ID for an app, or a deployment slot. // // resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. ID is -// deployment ID. slot is name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. +// deployment ID. slot is name of the deployment slot. If a slot is not specified, the API deletes a deployment for +// the production slot. func (client AppsClient) DeleteDeploymentSlot(ctx context.Context, resourceGroupName string, name string, ID string, slot string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "DeleteDeploymentSlot") + return result, validation.NewError("web.AppsClient", "DeleteDeploymentSlot", err.Error()) } req, err := client.DeleteDeploymentSlotPreparer(ctx, resourceGroupName, name, ID, slot) @@ -3721,7 +3726,7 @@ func (client AppsClient) DeleteDomainOwnershipIdentifier(ctx context.Context, re 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.NewErrorWithValidationError(err, "web.AppsClient", "DeleteDomainOwnershipIdentifier") + return result, validation.NewError("web.AppsClient", "DeleteDomainOwnershipIdentifier", err.Error()) } req, err := client.DeleteDomainOwnershipIdentifierPreparer(ctx, resourceGroupName, name, domainOwnershipIdentifierName) @@ -3789,15 +3794,15 @@ func (client AppsClient) DeleteDomainOwnershipIdentifierResponder(resp *http.Res // DeleteDomainOwnershipIdentifierSlot deletes a domain ownership identifier for a web app. // // resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. -// domainOwnershipIdentifierName is name of domain ownership identifier. slot is name of the deployment slot. If a slot -// is not specified, the API will delete the binding for the production slot. +// domainOwnershipIdentifierName is name of domain ownership identifier. slot is name of the deployment slot. If a +// slot is not specified, the API will delete the binding for the production slot. func (client AppsClient) DeleteDomainOwnershipIdentifierSlot(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, slot string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "DeleteDomainOwnershipIdentifierSlot") + return result, validation.NewError("web.AppsClient", "DeleteDomainOwnershipIdentifierSlot", err.Error()) } req, err := client.DeleteDomainOwnershipIdentifierSlotPreparer(ctx, resourceGroupName, name, domainOwnershipIdentifierName, slot) @@ -3865,15 +3870,15 @@ func (client AppsClient) DeleteDomainOwnershipIdentifierSlotResponder(resp *http // DeleteFunction delete a function for web site, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. functionName is -// function name. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. functionName +// is function name. func (client AppsClient) DeleteFunction(ctx context.Context, resourceGroupName string, name string, functionName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "DeleteFunction") + return result, validation.NewError("web.AppsClient", "DeleteFunction", err.Error()) } req, err := client.DeleteFunctionPreparer(ctx, resourceGroupName, name, functionName) @@ -3940,15 +3945,15 @@ func (client AppsClient) DeleteFunctionResponder(resp *http.Response) (result au // DeleteHostNameBinding deletes a hostname binding for an app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. hostName is -// hostname in the hostname binding. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. hostName +// is hostname in the hostname binding. func (client AppsClient) DeleteHostNameBinding(ctx context.Context, resourceGroupName string, name string, hostName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "DeleteHostNameBinding") + return result, validation.NewError("web.AppsClient", "DeleteHostNameBinding", err.Error()) } req, err := client.DeleteHostNameBindingPreparer(ctx, resourceGroupName, name, hostName) @@ -4015,16 +4020,16 @@ func (client AppsClient) DeleteHostNameBindingResponder(resp *http.Response) (re // DeleteHostNameBindingSlot deletes a hostname binding for an app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. -// hostName is hostname in the hostname binding. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API will delete the binding for the production +// slot. hostName is hostname in the hostname binding. func (client AppsClient) DeleteHostNameBindingSlot(ctx context.Context, resourceGroupName string, name string, slot string, hostName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "DeleteHostNameBindingSlot") + return result, validation.NewError("web.AppsClient", "DeleteHostNameBindingSlot", err.Error()) } req, err := client.DeleteHostNameBindingSlotPreparer(ctx, resourceGroupName, name, slot, hostName) @@ -4093,14 +4098,15 @@ func (client AppsClient) DeleteHostNameBindingSlotResponder(resp *http.Response) // DeleteHybridConnection removes a Hybrid Connection from this site. // // resourceGroupName is name of the resource group to which the resource belongs. name is the name of the web app. -// namespaceName is the namespace for this hybrid connection. relayName is the relay name for this hybrid connection. +// namespaceName is the namespace for this hybrid connection. relayName is the relay name for this hybrid +// connection. func (client AppsClient) DeleteHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "DeleteHybridConnection") + return result, validation.NewError("web.AppsClient", "DeleteHybridConnection", err.Error()) } req, err := client.DeleteHybridConnectionPreparer(ctx, resourceGroupName, name, namespaceName, relayName) @@ -4169,15 +4175,15 @@ func (client AppsClient) DeleteHybridConnectionResponder(resp *http.Response) (r // DeleteHybridConnectionSlot removes a Hybrid Connection from this site. // // resourceGroupName is name of the resource group to which the resource belongs. name is the name of the web app. -// namespaceName is the namespace for this hybrid connection. relayName is the relay name for this hybrid connection. -// slot is the name of the slot for the web app. +// namespaceName is the namespace for this hybrid connection. relayName is the relay name for this hybrid +// connection. slot is the name of the slot for the web app. func (client AppsClient) DeleteHybridConnectionSlot(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, slot string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "DeleteHybridConnectionSlot") + return result, validation.NewError("web.AppsClient", "DeleteHybridConnectionSlot", err.Error()) } req, err := client.DeleteHybridConnectionSlotPreparer(ctx, resourceGroupName, name, namespaceName, relayName, slot) @@ -4246,16 +4252,16 @@ func (client AppsClient) DeleteHybridConnectionSlotResponder(resp *http.Response // DeleteInstanceFunctionSlot delete a function for web site, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. functionName is -// function name. slot is name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. functionName +// is function name. slot is name of the deployment slot. If a slot is not specified, the API deletes a deployment +// for the production slot. func (client AppsClient) DeleteInstanceFunctionSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "DeleteInstanceFunctionSlot") + return result, validation.NewError("web.AppsClient", "DeleteInstanceFunctionSlot", err.Error()) } req, err := client.DeleteInstanceFunctionSlotPreparer(ctx, resourceGroupName, name, functionName, slot) @@ -4324,16 +4330,16 @@ func (client AppsClient) DeleteInstanceFunctionSlotResponder(resp *http.Response // DeleteInstanceProcess terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out // instance in a web site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is pID. -// instanceID is ID of a specific scaled-out instance. This is the value of the name property in the JSON response from -// "GET api/sites/{siteName}/instances". +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is +// pID. instanceID is ID of a specific scaled-out instance. This is the value of the name property in the JSON +// response from "GET api/sites/{siteName}/instances". func (client AppsClient) DeleteInstanceProcess(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "DeleteInstanceProcess") + return result, validation.NewError("web.AppsClient", "DeleteInstanceProcess", err.Error()) } req, err := client.DeleteInstanceProcessPreparer(ctx, resourceGroupName, name, processID, instanceID) @@ -4402,17 +4408,17 @@ func (client AppsClient) DeleteInstanceProcessResponder(resp *http.Response) (re // DeleteInstanceProcessSlot terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out // instance in a web site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is pID. -// slot is name of the deployment slot. If a slot is not specified, the API returns deployments for the production -// slot. instanceID is ID of a specific scaled-out instance. This is the value of the name property in the JSON -// response from "GET api/sites/{siteName}/instances". +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is +// pID. slot is name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. instanceID is ID of a specific scaled-out instance. This is the value of the name property in +// the JSON response from "GET api/sites/{siteName}/instances". func (client AppsClient) DeleteInstanceProcessSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "DeleteInstanceProcessSlot") + return result, validation.NewError("web.AppsClient", "DeleteInstanceProcessSlot", err.Error()) } req, err := client.DeleteInstanceProcessSlotPreparer(ctx, resourceGroupName, name, processID, slot, instanceID) @@ -4489,7 +4495,7 @@ func (client AppsClient) DeletePremierAddOn(ctx context.Context, resourceGroupNa 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.NewErrorWithValidationError(err, "web.AppsClient", "DeletePremierAddOn") + return result, validation.NewError("web.AppsClient", "DeletePremierAddOn", err.Error()) } req, err := client.DeletePremierAddOnPreparer(ctx, resourceGroupName, name, premierAddOnName) @@ -4565,7 +4571,7 @@ func (client AppsClient) DeletePremierAddOnSlot(ctx context.Context, resourceGro 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.NewErrorWithValidationError(err, "web.AppsClient", "DeletePremierAddOnSlot") + return result, validation.NewError("web.AppsClient", "DeletePremierAddOnSlot", err.Error()) } req, err := client.DeletePremierAddOnSlotPreparer(ctx, resourceGroupName, name, premierAddOnName, slot) @@ -4634,14 +4640,15 @@ func (client AppsClient) DeletePremierAddOnSlotResponder(resp *http.Response) (r // DeleteProcess terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in // a web site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is pID. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is +// pID. func (client AppsClient) DeleteProcess(ctx context.Context, resourceGroupName string, name string, processID string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "DeleteProcess") + return result, validation.NewError("web.AppsClient", "DeleteProcess", err.Error()) } req, err := client.DeleteProcessPreparer(ctx, resourceGroupName, name, processID) @@ -4709,16 +4716,16 @@ func (client AppsClient) DeleteProcessResponder(resp *http.Response) (result aut // DeleteProcessSlot terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out // instance in a web site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is pID. -// slot is name of the deployment slot. If a slot is not specified, the API returns deployments for the production -// slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is +// pID. slot is name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. func (client AppsClient) DeleteProcessSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "DeleteProcessSlot") + return result, validation.NewError("web.AppsClient", "DeleteProcessSlot", err.Error()) } req, err := client.DeleteProcessSlotPreparer(ctx, resourceGroupName, name, processID, slot) @@ -4794,7 +4801,7 @@ func (client AppsClient) DeletePublicCertificate(ctx context.Context, resourceGr 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.NewErrorWithValidationError(err, "web.AppsClient", "DeletePublicCertificate") + return result, validation.NewError("web.AppsClient", "DeletePublicCertificate", err.Error()) } req, err := client.DeletePublicCertificatePreparer(ctx, resourceGroupName, name, publicCertificateName) @@ -4861,16 +4868,16 @@ func (client AppsClient) DeletePublicCertificateResponder(resp *http.Response) ( // DeletePublicCertificateSlot deletes a hostname binding for an app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. -// publicCertificateName is public certificate name. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API will delete the binding for the production +// slot. publicCertificateName is public certificate name. func (client AppsClient) DeletePublicCertificateSlot(ctx context.Context, resourceGroupName string, name string, slot string, publicCertificateName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "DeletePublicCertificateSlot") + return result, validation.NewError("web.AppsClient", "DeletePublicCertificateSlot", err.Error()) } req, err := client.DeletePublicCertificateSlotPreparer(ctx, resourceGroupName, name, slot, publicCertificateName) @@ -4938,15 +4945,15 @@ func (client AppsClient) DeletePublicCertificateSlotResponder(resp *http.Respons // DeleteRelayServiceConnection deletes a relay service connection by its name. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. entityName -// is name of the hybrid connection configuration. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. +// entityName is name of the hybrid connection configuration. func (client AppsClient) DeleteRelayServiceConnection(ctx context.Context, resourceGroupName string, name string, entityName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "DeleteRelayServiceConnection") + return result, validation.NewError("web.AppsClient", "DeleteRelayServiceConnection", err.Error()) } req, err := client.DeleteRelayServiceConnectionPreparer(ctx, resourceGroupName, name, entityName) @@ -5013,16 +5020,16 @@ func (client AppsClient) DeleteRelayServiceConnectionResponder(resp *http.Respon // DeleteRelayServiceConnectionSlot deletes a relay service connection by its name. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. entityName -// is name of the hybrid connection configuration. slot is name of the deployment slot. If a slot is not specified, the -// API will delete a hybrid connection for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. +// entityName is name of the hybrid connection configuration. slot is name of the deployment slot. If a slot is not +// specified, the API will delete a hybrid connection for the production slot. func (client AppsClient) DeleteRelayServiceConnectionSlot(ctx context.Context, resourceGroupName string, name string, entityName string, slot string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "DeleteRelayServiceConnectionSlot") + return result, validation.NewError("web.AppsClient", "DeleteRelayServiceConnectionSlot", err.Error()) } req, err := client.DeleteRelayServiceConnectionSlotPreparer(ctx, resourceGroupName, name, entityName, slot) @@ -5090,15 +5097,15 @@ func (client AppsClient) DeleteRelayServiceConnectionSlotResponder(resp *http.Re // DeleteSiteExtension remove a site extension from a web site, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. siteExtensionID is -// site extension name. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. +// siteExtensionID is site extension name. func (client AppsClient) DeleteSiteExtension(ctx context.Context, resourceGroupName string, name string, siteExtensionID string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "DeleteSiteExtension") + return result, validation.NewError("web.AppsClient", "DeleteSiteExtension", err.Error()) } req, err := client.DeleteSiteExtensionPreparer(ctx, resourceGroupName, name, siteExtensionID) @@ -5165,16 +5172,16 @@ func (client AppsClient) DeleteSiteExtensionResponder(resp *http.Response) (resu // DeleteSiteExtensionSlot remove a site extension from a web site, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. siteExtensionID is -// site extension name. slot is name of the deployment slot. If a slot is not specified, the API deletes a deployment -// for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. +// siteExtensionID is site extension name. slot is name of the deployment slot. If a slot is not specified, the API +// deletes a deployment for the production slot. func (client AppsClient) DeleteSiteExtensionSlot(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "DeleteSiteExtensionSlot") + return result, validation.NewError("web.AppsClient", "DeleteSiteExtensionSlot", err.Error()) } req, err := client.DeleteSiteExtensionSlotPreparer(ctx, resourceGroupName, name, siteExtensionID, slot) @@ -5242,18 +5249,18 @@ func (client AppsClient) DeleteSiteExtensionSlotResponder(resp *http.Response) ( // DeleteSlot deletes a web, mobile, or API app, or one of the deployment slots. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app to delete. -// slot is name of the deployment slot to delete. By default, the API deletes the production slot. deleteMetrics is if -// true, web app metrics are also deleted. deleteEmptyServerFarm is specify true if the App Service plan will be empty -// after app deletion and you want to delete the empty App Service plan. By default, the empty App Service plan is not -// deleted. skipDNSRegistration is if true, DNS registration is skipped. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app to +// delete. slot is name of the deployment slot to delete. By default, the API deletes the production slot. +// deleteMetrics is if true, web app metrics are also deleted. deleteEmptyServerFarm is specify true if the App +// Service plan will be empty after app deletion and you want to delete the empty App Service plan. By default, the +// empty App Service plan is not deleted. skipDNSRegistration is if true, DNS registration is skipped. func (client AppsClient) DeleteSlot(ctx context.Context, resourceGroupName string, name string, slot string, deleteMetrics *bool, deleteEmptyServerFarm *bool, skipDNSRegistration *bool) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "DeleteSlot") + return result, validation.NewError("web.AppsClient", "DeleteSlot", err.Error()) } req, err := client.DeleteSlotPreparer(ctx, resourceGroupName, name, slot, deleteMetrics, deleteEmptyServerFarm, skipDNSRegistration) @@ -5336,7 +5343,7 @@ func (client AppsClient) DeleteSourceControl(ctx context.Context, resourceGroupN 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.NewErrorWithValidationError(err, "web.AppsClient", "DeleteSourceControl") + return result, validation.NewError("web.AppsClient", "DeleteSourceControl", err.Error()) } req, err := client.DeleteSourceControlPreparer(ctx, resourceGroupName, name) @@ -5402,16 +5409,16 @@ func (client AppsClient) DeleteSourceControlResponder(resp *http.Response) (resu // DeleteSourceControlSlot deletes the source control configuration of an app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API will delete the source control configuration for the -// production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API will delete the source control configuration +// for the production slot. func (client AppsClient) DeleteSourceControlSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "DeleteSourceControlSlot") + return result, validation.NewError("web.AppsClient", "DeleteSourceControlSlot", err.Error()) } req, err := client.DeleteSourceControlSlotPreparer(ctx, resourceGroupName, name, slot) @@ -5478,15 +5485,15 @@ func (client AppsClient) DeleteSourceControlSlotResponder(resp *http.Response) ( // DeleteTriggeredWebJob delete a triggered web job by its ID for an app, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is name -// of Web Job. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is +// name of Web Job. func (client AppsClient) DeleteTriggeredWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "DeleteTriggeredWebJob") + return result, validation.NewError("web.AppsClient", "DeleteTriggeredWebJob", err.Error()) } req, err := client.DeleteTriggeredWebJobPreparer(ctx, resourceGroupName, name, webJobName) @@ -5553,16 +5560,16 @@ func (client AppsClient) DeleteTriggeredWebJobResponder(resp *http.Response) (re // DeleteTriggeredWebJobSlot delete a triggered web job by its ID for an app, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is name -// of Web Job. slot is name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is +// name of Web Job. slot is name of the deployment slot. If a slot is not specified, the API deletes a deployment +// for the production slot. func (client AppsClient) DeleteTriggeredWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "DeleteTriggeredWebJobSlot") + return result, validation.NewError("web.AppsClient", "DeleteTriggeredWebJobSlot", err.Error()) } req, err := client.DeleteTriggeredWebJobSlotPreparer(ctx, resourceGroupName, name, webJobName, slot) @@ -5630,15 +5637,15 @@ func (client AppsClient) DeleteTriggeredWebJobSlotResponder(resp *http.Response) // DeleteVnetConnection deletes a connection from an app (or deployment slot to a named virtual network. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. vnetName is -// name of the virtual network. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. vnetName +// is name of the virtual network. func (client AppsClient) DeleteVnetConnection(ctx context.Context, resourceGroupName string, name string, vnetName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "DeleteVnetConnection") + return result, validation.NewError("web.AppsClient", "DeleteVnetConnection", err.Error()) } req, err := client.DeleteVnetConnectionPreparer(ctx, resourceGroupName, name, vnetName) @@ -5705,16 +5712,16 @@ func (client AppsClient) DeleteVnetConnectionResponder(resp *http.Response) (res // DeleteVnetConnectionSlot deletes a connection from an app (or deployment slot to a named virtual network. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. vnetName is -// name of the virtual network. slot is name of the deployment slot. If a slot is not specified, the API will delete -// the connection for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. vnetName +// is name of the virtual network. slot is name of the deployment slot. If a slot is not specified, the API will +// delete the connection for the production slot. func (client AppsClient) DeleteVnetConnectionSlot(ctx context.Context, resourceGroupName string, name string, vnetName string, slot string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "DeleteVnetConnectionSlot") + return result, validation.NewError("web.AppsClient", "DeleteVnetConnectionSlot", err.Error()) } req, err := client.DeleteVnetConnectionSlotPreparer(ctx, resourceGroupName, name, vnetName, slot) @@ -5782,8 +5789,8 @@ func (client AppsClient) DeleteVnetConnectionSlotResponder(resp *http.Response) // DiscoverRestore discovers an existing app backup that can be restored from a blob in Azure storage. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. request is a -// RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. request +// is a RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. func (client AppsClient) DiscoverRestore(ctx context.Context, resourceGroupName string, name string, request RestoreRequest) (result RestoreRequest, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -5795,7 +5802,7 @@ func (client AppsClient) DiscoverRestore(ctx context.Context, resourceGroupName Chain: []validation.Constraint{{Target: "request.RestoreRequestProperties.StorageAccountURL", Name: validation.Null, Rule: true, Chain: nil}, {Target: "request.RestoreRequestProperties.Overwrite", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppsClient", "DiscoverRestore") + return result, validation.NewError("web.AppsClient", "DiscoverRestore", err.Error()) } req, err := client.DiscoverRestorePreparer(ctx, resourceGroupName, name, request) @@ -5864,9 +5871,9 @@ func (client AppsClient) DiscoverRestoreResponder(resp *http.Response) (result R // DiscoverRestoreSlot discovers an existing app backup that can be restored from a blob in Azure storage. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. request is a -// RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. slot is name of the -// deployment slot. If a slot is not specified, the API will perform discovery for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. request +// is a RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. slot is name +// of the deployment slot. If a slot is not specified, the API will perform discovery for the production slot. func (client AppsClient) DiscoverRestoreSlot(ctx context.Context, resourceGroupName string, name string, request RestoreRequest, slot string) (result RestoreRequest, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -5878,7 +5885,7 @@ func (client AppsClient) DiscoverRestoreSlot(ctx context.Context, resourceGroupN Chain: []validation.Constraint{{Target: "request.RestoreRequestProperties.StorageAccountURL", Name: validation.Null, Rule: true, Chain: nil}, {Target: "request.RestoreRequestProperties.Overwrite", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppsClient", "DiscoverRestoreSlot") + return result, validation.NewError("web.AppsClient", "DiscoverRestoreSlot", err.Error()) } req, err := client.DiscoverRestoreSlotPreparer(ctx, resourceGroupName, name, request, slot) @@ -5955,7 +5962,7 @@ func (client AppsClient) GenerateNewSitePublishingPassword(ctx context.Context, 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.NewErrorWithValidationError(err, "web.AppsClient", "GenerateNewSitePublishingPassword") + return result, validation.NewError("web.AppsClient", "GenerateNewSitePublishingPassword", err.Error()) } req, err := client.GenerateNewSitePublishingPasswordPreparer(ctx, resourceGroupName, name) @@ -6022,16 +6029,16 @@ func (client AppsClient) GenerateNewSitePublishingPasswordResponder(resp *http.R // GenerateNewSitePublishingPasswordSlot generates a new publishing password for an app (or deployment slot, if // specified). // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API generate a new publishing password for the production -// slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API generate a new publishing password for the +// production slot. func (client AppsClient) GenerateNewSitePublishingPasswordSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GenerateNewSitePublishingPasswordSlot") + return result, validation.NewError("web.AppsClient", "GenerateNewSitePublishingPasswordSlot", err.Error()) } req, err := client.GenerateNewSitePublishingPasswordSlotPreparer(ctx, resourceGroupName, name, slot) @@ -6105,7 +6112,7 @@ func (client AppsClient) Get(ctx context.Context, resourceGroupName string, name 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.NewErrorWithValidationError(err, "web.AppsClient", "Get") + return result, validation.NewError("web.AppsClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, name) @@ -6179,7 +6186,7 @@ func (client AppsClient) GetAuthSettings(ctx context.Context, 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.NewErrorWithValidationError(err, "web.AppsClient", "GetAuthSettings") + return result, validation.NewError("web.AppsClient", "GetAuthSettings", err.Error()) } req, err := client.GetAuthSettingsPreparer(ctx, resourceGroupName, name) @@ -6246,15 +6253,15 @@ func (client AppsClient) GetAuthSettingsResponder(resp *http.Response) (result S // GetAuthSettingsSlot gets the Authentication/Authorization settings of an app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API will get the settings for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API will get the settings for the production slot. func (client AppsClient) GetAuthSettingsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteAuthSettings, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetAuthSettingsSlot") + return result, validation.NewError("web.AppsClient", "GetAuthSettingsSlot", err.Error()) } req, err := client.GetAuthSettingsSlotPreparer(ctx, resourceGroupName, name, slot) @@ -6329,7 +6336,7 @@ func (client AppsClient) GetBackupConfiguration(ctx context.Context, resourceGro 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.NewErrorWithValidationError(err, "web.AppsClient", "GetBackupConfiguration") + return result, validation.NewError("web.AppsClient", "GetBackupConfiguration", err.Error()) } req, err := client.GetBackupConfigurationPreparer(ctx, resourceGroupName, name) @@ -6396,16 +6403,16 @@ func (client AppsClient) GetBackupConfigurationResponder(resp *http.Response) (r // GetBackupConfigurationSlot gets the backup configuration of an app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API will get the backup configuration for the production -// slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API will get the backup configuration for the +// production slot. func (client AppsClient) GetBackupConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result BackupRequest, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetBackupConfigurationSlot") + return result, validation.NewError("web.AppsClient", "GetBackupConfigurationSlot", err.Error()) } req, err := client.GetBackupConfigurationSlotPreparer(ctx, resourceGroupName, name, slot) @@ -6473,15 +6480,15 @@ func (client AppsClient) GetBackupConfigurationSlotResponder(resp *http.Response // GetBackupStatus gets a backup of an app by its ID. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. backupID is -// ID of the backup. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. backupID +// is ID of the backup. func (client AppsClient) GetBackupStatus(ctx context.Context, resourceGroupName string, name string, backupID string) (result BackupItem, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetBackupStatus") + return result, validation.NewError("web.AppsClient", "GetBackupStatus", err.Error()) } req, err := client.GetBackupStatusPreparer(ctx, resourceGroupName, name, backupID) @@ -6549,16 +6556,16 @@ func (client AppsClient) GetBackupStatusResponder(resp *http.Response) (result B // GetBackupStatusSlot gets a backup of an app by its ID. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. backupID is -// ID of the backup. slot is name of the deployment slot. If a slot is not specified, the API will get a backup of the -// production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. backupID +// is ID of the backup. slot is name of the deployment slot. If a slot is not specified, the API will get a backup +// of the production slot. func (client AppsClient) GetBackupStatusSlot(ctx context.Context, resourceGroupName string, name string, backupID string, slot string) (result BackupItem, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetBackupStatusSlot") + return result, validation.NewError("web.AppsClient", "GetBackupStatusSlot", err.Error()) } req, err := client.GetBackupStatusSlotPreparer(ctx, resourceGroupName, name, backupID, slot) @@ -6635,7 +6642,7 @@ func (client AppsClient) GetConfiguration(ctx context.Context, 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.NewErrorWithValidationError(err, "web.AppsClient", "GetConfiguration") + return result, validation.NewError("web.AppsClient", "GetConfiguration", err.Error()) } req, err := client.GetConfigurationPreparer(ctx, resourceGroupName, name) @@ -6703,15 +6710,16 @@ func (client AppsClient) GetConfigurationResponder(resp *http.Response) (result // GetConfigurationSlot gets the configuration of an app, such as platform version and bitness, default documents, // virtual applications, Always On, etc. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API will return configuration for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API will return configuration for the production +// slot. func (client AppsClient) GetConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteConfigResource, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetConfigurationSlot") + return result, validation.NewError("web.AppsClient", "GetConfigurationSlot", err.Error()) } req, err := client.GetConfigurationSlotPreparer(ctx, resourceGroupName, name, slot) @@ -6779,15 +6787,15 @@ func (client AppsClient) GetConfigurationSlotResponder(resp *http.Response) (res // GetConfigurationSnapshot gets a snapshot of the configuration of an app at a previous point in time. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. snapshotID -// is the ID of the snapshot to read. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. +// snapshotID is the ID of the snapshot to read. func (client AppsClient) GetConfigurationSnapshot(ctx context.Context, resourceGroupName string, name string, snapshotID string) (result SiteConfigResource, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetConfigurationSnapshot") + return result, validation.NewError("web.AppsClient", "GetConfigurationSnapshot", err.Error()) } req, err := client.GetConfigurationSnapshotPreparer(ctx, resourceGroupName, name, snapshotID) @@ -6855,16 +6863,16 @@ func (client AppsClient) GetConfigurationSnapshotResponder(resp *http.Response) // GetConfigurationSnapshotSlot gets a snapshot of the configuration of an app at a previous point in time. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. snapshotID -// is the ID of the snapshot to read. slot is name of the deployment slot. If a slot is not specified, the API will -// return configuration for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. +// snapshotID is the ID of the snapshot to read. slot is name of the deployment slot. If a slot is not specified, +// the API will return configuration for the production slot. func (client AppsClient) GetConfigurationSnapshotSlot(ctx context.Context, resourceGroupName string, name string, snapshotID string, slot string) (result SiteConfigResource, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetConfigurationSnapshotSlot") + return result, validation.NewError("web.AppsClient", "GetConfigurationSnapshotSlot", err.Error()) } req, err := client.GetConfigurationSnapshotSlotPreparer(ctx, resourceGroupName, name, snapshotID, slot) @@ -6933,15 +6941,15 @@ func (client AppsClient) GetConfigurationSnapshotSlotResponder(resp *http.Respon // GetContinuousWebJob gets a continuous web job by its ID for an app, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is name -// of Web Job. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is +// name of Web Job. func (client AppsClient) GetContinuousWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result ContinuousWebJob, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetContinuousWebJob") + return result, validation.NewError("web.AppsClient", "GetContinuousWebJob", err.Error()) } req, err := client.GetContinuousWebJobPreparer(ctx, resourceGroupName, name, webJobName) @@ -7009,16 +7017,16 @@ func (client AppsClient) GetContinuousWebJobResponder(resp *http.Response) (resu // GetContinuousWebJobSlot gets a continuous web job by its ID for an app, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is name -// of Web Job. slot is name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is +// name of Web Job. slot is name of the deployment slot. If a slot is not specified, the API deletes a deployment +// for the production slot. func (client AppsClient) GetContinuousWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result ContinuousWebJob, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetContinuousWebJobSlot") + return result, validation.NewError("web.AppsClient", "GetContinuousWebJobSlot", err.Error()) } req, err := client.GetContinuousWebJobSlotPreparer(ctx, resourceGroupName, name, webJobName, slot) @@ -7095,7 +7103,7 @@ func (client AppsClient) GetDeployment(ctx context.Context, resourceGroupName st 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.NewErrorWithValidationError(err, "web.AppsClient", "GetDeployment") + return result, validation.NewError("web.AppsClient", "GetDeployment", err.Error()) } req, err := client.GetDeploymentPreparer(ctx, resourceGroupName, name, ID) @@ -7164,15 +7172,15 @@ func (client AppsClient) GetDeploymentResponder(resp *http.Response) (result Dep // GetDeploymentSlot get a deployment by its ID for an app, or a deployment slot. // // resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. ID is -// deployment ID. slot is name of the deployment slot. If a slot is not specified, the API gets a deployment for the -// production slot. +// deployment ID. slot is name of the deployment slot. If a slot is not specified, the API gets a deployment for +// the production slot. func (client AppsClient) GetDeploymentSlot(ctx context.Context, resourceGroupName string, name string, ID string, slot string) (result Deployment, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetDeploymentSlot") + return result, validation.NewError("web.AppsClient", "GetDeploymentSlot", err.Error()) } req, err := client.GetDeploymentSlotPreparer(ctx, resourceGroupName, name, ID, slot) @@ -7248,7 +7256,7 @@ func (client AppsClient) GetDiagnosticLogsConfiguration(ctx context.Context, res 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.NewErrorWithValidationError(err, "web.AppsClient", "GetDiagnosticLogsConfiguration") + return result, validation.NewError("web.AppsClient", "GetDiagnosticLogsConfiguration", err.Error()) } req, err := client.GetDiagnosticLogsConfigurationPreparer(ctx, resourceGroupName, name) @@ -7315,16 +7323,16 @@ func (client AppsClient) GetDiagnosticLogsConfigurationResponder(resp *http.Resp // GetDiagnosticLogsConfigurationSlot gets the logging configuration of an app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API will get the logging configuration for the production -// slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API will get the logging configuration for the +// production slot. func (client AppsClient) GetDiagnosticLogsConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteLogsConfig, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetDiagnosticLogsConfigurationSlot") + return result, validation.NewError("web.AppsClient", "GetDiagnosticLogsConfigurationSlot", err.Error()) } req, err := client.GetDiagnosticLogsConfigurationSlotPreparer(ctx, resourceGroupName, name, slot) @@ -7400,7 +7408,7 @@ func (client AppsClient) GetDomainOwnershipIdentifier(ctx context.Context, resou 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.NewErrorWithValidationError(err, "web.AppsClient", "GetDomainOwnershipIdentifier") + return result, validation.NewError("web.AppsClient", "GetDomainOwnershipIdentifier", err.Error()) } req, err := client.GetDomainOwnershipIdentifierPreparer(ctx, resourceGroupName, name, domainOwnershipIdentifierName) @@ -7469,15 +7477,15 @@ func (client AppsClient) GetDomainOwnershipIdentifierResponder(resp *http.Respon // GetDomainOwnershipIdentifierSlot get domain ownership identifier for web app. // // resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. -// domainOwnershipIdentifierName is name of domain ownership identifier. slot is name of the deployment slot. If a slot -// is not specified, the API will delete the binding for the production slot. +// domainOwnershipIdentifierName is name of domain ownership identifier. slot is name of the deployment slot. If a +// slot is not specified, the API will delete the binding for the production slot. func (client AppsClient) GetDomainOwnershipIdentifierSlot(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, slot string) (result Identifier, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetDomainOwnershipIdentifierSlot") + return result, validation.NewError("web.AppsClient", "GetDomainOwnershipIdentifierSlot", err.Error()) } req, err := client.GetDomainOwnershipIdentifierSlotPreparer(ctx, resourceGroupName, name, domainOwnershipIdentifierName, slot) @@ -7546,15 +7554,15 @@ func (client AppsClient) GetDomainOwnershipIdentifierSlotResponder(resp *http.Re // GetFunction get function information by its ID for web site, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. functionName is -// function name. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. functionName +// is function name. func (client AppsClient) GetFunction(ctx context.Context, resourceGroupName string, name string, functionName string) (result FunctionEnvelope, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetFunction") + return result, validation.NewError("web.AppsClient", "GetFunction", err.Error()) } req, err := client.GetFunctionPreparer(ctx, resourceGroupName, name, functionName) @@ -7629,7 +7637,7 @@ func (client AppsClient) GetFunctionsAdminToken(ctx context.Context, resourceGro 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.NewErrorWithValidationError(err, "web.AppsClient", "GetFunctionsAdminToken") + return result, validation.NewError("web.AppsClient", "GetFunctionsAdminToken", err.Error()) } req, err := client.GetFunctionsAdminTokenPreparer(ctx, resourceGroupName, name) @@ -7696,15 +7704,15 @@ func (client AppsClient) GetFunctionsAdminTokenResponder(resp *http.Response) (r // GetFunctionsAdminTokenSlot fetch a short lived token that can be exchanged for a master key. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. slot is name -// of web app slot. If not specified then will default to production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. slot is +// name of web app slot. If not specified then will default to production slot. func (client AppsClient) GetFunctionsAdminTokenSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result String, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetFunctionsAdminTokenSlot") + return result, validation.NewError("web.AppsClient", "GetFunctionsAdminTokenSlot", err.Error()) } req, err := client.GetFunctionsAdminTokenSlotPreparer(ctx, resourceGroupName, name, slot) @@ -7772,15 +7780,15 @@ func (client AppsClient) GetFunctionsAdminTokenSlotResponder(resp *http.Response // GetHostNameBinding get the named hostname binding for an app (or deployment slot, if specified). // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. hostName is -// hostname in the hostname binding. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. hostName +// is hostname in the hostname binding. func (client AppsClient) GetHostNameBinding(ctx context.Context, resourceGroupName string, name string, hostName string) (result HostNameBinding, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetHostNameBinding") + return result, validation.NewError("web.AppsClient", "GetHostNameBinding", err.Error()) } req, err := client.GetHostNameBindingPreparer(ctx, resourceGroupName, name, hostName) @@ -7848,16 +7856,16 @@ func (client AppsClient) GetHostNameBindingResponder(resp *http.Response) (resul // GetHostNameBindingSlot get the named hostname binding for an app (or deployment slot, if specified). // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API the named binding for the production slot. hostName is -// hostname in the hostname binding. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API the named binding for the production slot. +// hostName is hostname in the hostname binding. func (client AppsClient) GetHostNameBindingSlot(ctx context.Context, resourceGroupName string, name string, slot string, hostName string) (result HostNameBinding, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetHostNameBindingSlot") + return result, validation.NewError("web.AppsClient", "GetHostNameBindingSlot", err.Error()) } req, err := client.GetHostNameBindingSlotPreparer(ctx, resourceGroupName, name, slot, hostName) @@ -7927,14 +7935,15 @@ func (client AppsClient) GetHostNameBindingSlotResponder(resp *http.Response) (r // GetHybridConnection retrieves a specific Service Bus Hybrid Connection used by this Web App. // // resourceGroupName is name of the resource group to which the resource belongs. name is the name of the web app. -// namespaceName is the namespace for this hybrid connection. relayName is the relay name for this hybrid connection. +// namespaceName is the namespace for this hybrid connection. relayName is the relay name for this hybrid +// connection. func (client AppsClient) GetHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (result HybridConnection, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetHybridConnection") + return result, validation.NewError("web.AppsClient", "GetHybridConnection", err.Error()) } req, err := client.GetHybridConnectionPreparer(ctx, resourceGroupName, name, namespaceName, relayName) @@ -8004,15 +8013,15 @@ func (client AppsClient) GetHybridConnectionResponder(resp *http.Response) (resu // GetHybridConnectionSlot retrieves a specific Service Bus Hybrid Connection used by this Web App. // // resourceGroupName is name of the resource group to which the resource belongs. name is the name of the web app. -// namespaceName is the namespace for this hybrid connection. relayName is the relay name for this hybrid connection. -// slot is the name of the slot for the web app. +// namespaceName is the namespace for this hybrid connection. relayName is the relay name for this hybrid +// connection. slot is the name of the slot for the web app. func (client AppsClient) GetHybridConnectionSlot(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, slot string) (result HybridConnection, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetHybridConnectionSlot") + return result, validation.NewError("web.AppsClient", "GetHybridConnectionSlot", err.Error()) } req, err := client.GetHybridConnectionSlotPreparer(ctx, resourceGroupName, name, namespaceName, relayName, slot) @@ -8082,16 +8091,16 @@ func (client AppsClient) GetHybridConnectionSlotResponder(resp *http.Response) ( // GetInstanceFunctionSlot get function information by its ID for web site, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. functionName is -// function name. slot is name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. functionName +// is function name. slot is name of the deployment slot. If a slot is not specified, the API deletes a deployment +// for the production slot. func (client AppsClient) GetInstanceFunctionSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (result FunctionEnvelope, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetInstanceFunctionSlot") + return result, validation.NewError("web.AppsClient", "GetInstanceFunctionSlot", err.Error()) } req, err := client.GetInstanceFunctionSlotPreparer(ctx, resourceGroupName, name, functionName, slot) @@ -8160,15 +8169,15 @@ func (client AppsClient) GetInstanceFunctionSlotResponder(resp *http.Response) ( // GetInstanceMSDeployLog get the MSDeploy Log for the last MSDeploy operation. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. instanceID -// is ID of web app instance. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. +// instanceID is ID of web app instance. func (client AppsClient) GetInstanceMSDeployLog(ctx context.Context, resourceGroupName string, name string, instanceID string) (result MSDeployLog, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetInstanceMSDeployLog") + return result, validation.NewError("web.AppsClient", "GetInstanceMSDeployLog", err.Error()) } req, err := client.GetInstanceMSDeployLogPreparer(ctx, resourceGroupName, name, instanceID) @@ -8236,15 +8245,16 @@ func (client AppsClient) GetInstanceMSDeployLogResponder(resp *http.Response) (r // GetInstanceMSDeployLogSlot get the MSDeploy Log for the last MSDeploy operation. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. slot is name -// of web app slot. If not specified then will default to production slot. instanceID is ID of web app instance. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. slot is +// name of web app slot. If not specified then will default to production slot. instanceID is ID of web app +// instance. func (client AppsClient) GetInstanceMSDeployLogSlot(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string) (result MSDeployLog, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetInstanceMSDeployLogSlot") + return result, validation.NewError("web.AppsClient", "GetInstanceMSDeployLogSlot", err.Error()) } req, err := client.GetInstanceMSDeployLogSlotPreparer(ctx, resourceGroupName, name, slot, instanceID) @@ -8313,15 +8323,15 @@ func (client AppsClient) GetInstanceMSDeployLogSlotResponder(resp *http.Response // GetInstanceMsDeployStatus get the status of the last MSDeploy operation. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. instanceID -// is ID of web app instance. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. +// instanceID is ID of web app instance. func (client AppsClient) GetInstanceMsDeployStatus(ctx context.Context, resourceGroupName string, name string, instanceID string) (result MSDeployStatus, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetInstanceMsDeployStatus") + return result, validation.NewError("web.AppsClient", "GetInstanceMsDeployStatus", err.Error()) } req, err := client.GetInstanceMsDeployStatusPreparer(ctx, resourceGroupName, name, instanceID) @@ -8389,15 +8399,16 @@ func (client AppsClient) GetInstanceMsDeployStatusResponder(resp *http.Response) // GetInstanceMsDeployStatusSlot get the status of the last MSDeploy operation. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. slot is name -// of web app slot. If not specified then will default to production slot. instanceID is ID of web app instance. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. slot is +// name of web app slot. If not specified then will default to production slot. instanceID is ID of web app +// instance. func (client AppsClient) GetInstanceMsDeployStatusSlot(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string) (result MSDeployStatus, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetInstanceMsDeployStatusSlot") + return result, validation.NewError("web.AppsClient", "GetInstanceMsDeployStatusSlot", err.Error()) } req, err := client.GetInstanceMsDeployStatusSlotPreparer(ctx, resourceGroupName, name, slot, instanceID) @@ -8466,16 +8477,16 @@ func (client AppsClient) GetInstanceMsDeployStatusSlotResponder(resp *http.Respo // GetInstanceProcess get process information by its ID for a specific scaled-out instance in a web site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is pID. -// instanceID is ID of a specific scaled-out instance. This is the value of the name property in the JSON response from -// "GET api/sites/{siteName}/instances". +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is +// pID. instanceID is ID of a specific scaled-out instance. This is the value of the name property in the JSON +// response from "GET api/sites/{siteName}/instances". func (client AppsClient) GetInstanceProcess(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (result ProcessInfo, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetInstanceProcess") + return result, validation.NewError("web.AppsClient", "GetInstanceProcess", err.Error()) } req, err := client.GetInstanceProcessPreparer(ctx, resourceGroupName, name, processID, instanceID) @@ -8544,16 +8555,16 @@ func (client AppsClient) GetInstanceProcessResponder(resp *http.Response) (resul // GetInstanceProcessDump get a memory dump of a process by its ID for a specific scaled-out instance in a web site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is pID. -// instanceID is ID of a specific scaled-out instance. This is the value of the name property in the JSON response from -// "GET api/sites/{siteName}/instances". +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is +// pID. instanceID is ID of a specific scaled-out instance. This is the value of the name property in the JSON +// response from "GET api/sites/{siteName}/instances". func (client AppsClient) GetInstanceProcessDump(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (result ReadCloser, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetInstanceProcessDump") + return result, validation.NewError("web.AppsClient", "GetInstanceProcessDump", err.Error()) } req, err := client.GetInstanceProcessDumpPreparer(ctx, resourceGroupName, name, processID, instanceID) @@ -8622,17 +8633,17 @@ func (client AppsClient) GetInstanceProcessDumpResponder(resp *http.Response) (r // GetInstanceProcessDumpSlot get a memory dump of a process by its ID for a specific scaled-out instance in a web // site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is pID. -// slot is name of the deployment slot. If a slot is not specified, the API returns deployments for the production -// slot. instanceID is ID of a specific scaled-out instance. This is the value of the name property in the JSON -// response from "GET api/sites/{siteName}/instances". +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is +// pID. slot is name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. instanceID is ID of a specific scaled-out instance. This is the value of the name property in +// the JSON response from "GET api/sites/{siteName}/instances". func (client AppsClient) GetInstanceProcessDumpSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (result ReadCloser, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetInstanceProcessDumpSlot") + return result, validation.NewError("web.AppsClient", "GetInstanceProcessDumpSlot", err.Error()) } req, err := client.GetInstanceProcessDumpSlotPreparer(ctx, resourceGroupName, name, processID, slot, instanceID) @@ -8701,16 +8712,16 @@ func (client AppsClient) GetInstanceProcessDumpSlotResponder(resp *http.Response // GetInstanceProcessModule get process information by its ID for a specific scaled-out instance in a web site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is pID. -// baseAddress is module base address. instanceID is ID of a specific scaled-out instance. This is the value of the -// name property in the JSON response from "GET api/sites/{siteName}/instances". +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is +// pID. baseAddress is module base address. instanceID is ID of a specific scaled-out instance. This is the value +// of the name property in the JSON response from "GET api/sites/{siteName}/instances". func (client AppsClient) GetInstanceProcessModule(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, instanceID string) (result ProcessModuleInfo, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetInstanceProcessModule") + return result, validation.NewError("web.AppsClient", "GetInstanceProcessModule", err.Error()) } req, err := client.GetInstanceProcessModulePreparer(ctx, resourceGroupName, name, processID, baseAddress, instanceID) @@ -8780,17 +8791,17 @@ func (client AppsClient) GetInstanceProcessModuleResponder(resp *http.Response) // GetInstanceProcessModuleSlot get process information by its ID for a specific scaled-out instance in a web site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is pID. -// baseAddress is module base address. slot is name of the deployment slot. If a slot is not specified, the API returns -// deployments for the production slot. instanceID is ID of a specific scaled-out instance. This is the value of the -// name property in the JSON response from "GET api/sites/{siteName}/instances". +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is +// pID. baseAddress is module base address. slot is name of the deployment slot. If a slot is not specified, the +// API returns deployments for the production slot. instanceID is ID of a specific scaled-out instance. This is the +// value of the name property in the JSON response from "GET api/sites/{siteName}/instances". func (client AppsClient) GetInstanceProcessModuleSlot(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, slot string, instanceID string) (result ProcessModuleInfo, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetInstanceProcessModuleSlot") + return result, validation.NewError("web.AppsClient", "GetInstanceProcessModuleSlot", err.Error()) } req, err := client.GetInstanceProcessModuleSlotPreparer(ctx, resourceGroupName, name, processID, baseAddress, slot, instanceID) @@ -8861,17 +8872,17 @@ func (client AppsClient) GetInstanceProcessModuleSlotResponder(resp *http.Respon // GetInstanceProcessSlot get process information by its ID for a specific scaled-out instance in a web site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is pID. -// slot is name of the deployment slot. If a slot is not specified, the API returns deployments for the production -// slot. instanceID is ID of a specific scaled-out instance. This is the value of the name property in the JSON -// response from "GET api/sites/{siteName}/instances". +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is +// pID. slot is name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. instanceID is ID of a specific scaled-out instance. This is the value of the name property in +// the JSON response from "GET api/sites/{siteName}/instances". func (client AppsClient) GetInstanceProcessSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (result ProcessInfo, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetInstanceProcessSlot") + return result, validation.NewError("web.AppsClient", "GetInstanceProcessSlot", err.Error()) } req, err := client.GetInstanceProcessSlotPreparer(ctx, resourceGroupName, name, processID, slot, instanceID) @@ -8942,16 +8953,16 @@ func (client AppsClient) GetInstanceProcessSlotResponder(resp *http.Response) (r // GetInstanceProcessThread get thread information by Thread ID for a specific process, in a specific scaled-out // instance in a web site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is pID. -// threadID is tID. instanceID is ID of a specific scaled-out instance. This is the value of the name property in the -// JSON response from "GET api/sites/{siteName}/instances". +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is +// pID. threadID is tID. instanceID is ID of a specific scaled-out instance. This is the value of the name property +// in the JSON response from "GET api/sites/{siteName}/instances". func (client AppsClient) GetInstanceProcessThread(ctx context.Context, resourceGroupName string, name string, processID string, threadID string, instanceID string) (result ProcessThreadInfo, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetInstanceProcessThread") + return result, validation.NewError("web.AppsClient", "GetInstanceProcessThread", err.Error()) } req, err := client.GetInstanceProcessThreadPreparer(ctx, resourceGroupName, name, processID, threadID, instanceID) @@ -9022,17 +9033,17 @@ func (client AppsClient) GetInstanceProcessThreadResponder(resp *http.Response) // GetInstanceProcessThreadSlot get thread information by Thread ID for a specific process, in a specific scaled-out // instance in a web site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is pID. -// threadID is tID. slot is name of the deployment slot. If a slot is not specified, the API returns deployments for -// the production slot. instanceID is ID of a specific scaled-out instance. This is the value of the name property in -// the JSON response from "GET api/sites/{siteName}/instances". +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is +// pID. threadID is tID. slot is name of the deployment slot. If a slot is not specified, the API returns +// deployments for the production slot. instanceID is ID of a specific scaled-out instance. This is the value of +// the name property in the JSON response from "GET api/sites/{siteName}/instances". func (client AppsClient) GetInstanceProcessThreadSlot(ctx context.Context, resourceGroupName string, name string, processID string, threadID string, slot string, instanceID string) (result ProcessThreadInfo, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetInstanceProcessThreadSlot") + return result, validation.NewError("web.AppsClient", "GetInstanceProcessThreadSlot", err.Error()) } req, err := client.GetInstanceProcessThreadSlotPreparer(ctx, resourceGroupName, name, processID, threadID, slot, instanceID) @@ -9111,7 +9122,7 @@ func (client AppsClient) GetMigrateMySQLStatus(ctx context.Context, resourceGrou 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.NewErrorWithValidationError(err, "web.AppsClient", "GetMigrateMySQLStatus") + return result, validation.NewError("web.AppsClient", "GetMigrateMySQLStatus", err.Error()) } req, err := client.GetMigrateMySQLStatusPreparer(ctx, resourceGroupName, name) @@ -9179,15 +9190,15 @@ func (client AppsClient) GetMigrateMySQLStatusResponder(resp *http.Response) (re // GetMigrateMySQLStatusSlot returns the status of MySql in app migration, if one is active, and whether or not MySql // in app is enabled // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. slot is name -// of the deployment slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. slot is +// name of the deployment slot. func (client AppsClient) GetMigrateMySQLStatusSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result MigrateMySQLStatus, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetMigrateMySQLStatusSlot") + return result, validation.NewError("web.AppsClient", "GetMigrateMySQLStatusSlot", err.Error()) } req, err := client.GetMigrateMySQLStatusSlotPreparer(ctx, resourceGroupName, name, slot) @@ -9262,7 +9273,7 @@ func (client AppsClient) GetMSDeployLog(ctx context.Context, resourceGroupName s 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.NewErrorWithValidationError(err, "web.AppsClient", "GetMSDeployLog") + return result, validation.NewError("web.AppsClient", "GetMSDeployLog", err.Error()) } req, err := client.GetMSDeployLogPreparer(ctx, resourceGroupName, name) @@ -9329,15 +9340,15 @@ func (client AppsClient) GetMSDeployLogResponder(resp *http.Response) (result MS // GetMSDeployLogSlot get the MSDeploy Log for the last MSDeploy operation. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. slot is name -// of web app slot. If not specified then will default to production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. slot is +// name of web app slot. If not specified then will default to production slot. func (client AppsClient) GetMSDeployLogSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result MSDeployLog, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetMSDeployLogSlot") + return result, validation.NewError("web.AppsClient", "GetMSDeployLogSlot", err.Error()) } req, err := client.GetMSDeployLogSlotPreparer(ctx, resourceGroupName, name, slot) @@ -9412,7 +9423,7 @@ func (client AppsClient) GetMSDeployStatus(ctx context.Context, resourceGroupNam 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.NewErrorWithValidationError(err, "web.AppsClient", "GetMSDeployStatus") + return result, validation.NewError("web.AppsClient", "GetMSDeployStatus", err.Error()) } req, err := client.GetMSDeployStatusPreparer(ctx, resourceGroupName, name) @@ -9479,15 +9490,15 @@ func (client AppsClient) GetMSDeployStatusResponder(resp *http.Response) (result // GetMSDeployStatusSlot get the status of the last MSDeploy operation. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. slot is name -// of web app slot. If not specified then will default to production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. slot is +// name of web app slot. If not specified then will default to production slot. func (client AppsClient) GetMSDeployStatusSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result MSDeployStatus, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetMSDeployStatusSlot") + return result, validation.NewError("web.AppsClient", "GetMSDeployStatusSlot", err.Error()) } req, err := client.GetMSDeployStatusSlotPreparer(ctx, resourceGroupName, name, slot) @@ -9563,7 +9574,7 @@ func (client AppsClient) GetPremierAddOn(ctx context.Context, 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.NewErrorWithValidationError(err, "web.AppsClient", "GetPremierAddOn") + return result, validation.NewError("web.AppsClient", "GetPremierAddOn", err.Error()) } req, err := client.GetPremierAddOnPreparer(ctx, resourceGroupName, name, premierAddOnName) @@ -9632,15 +9643,15 @@ func (client AppsClient) GetPremierAddOnResponder(resp *http.Response) (result P // GetPremierAddOnSlot gets a named add-on of an app. // // resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. -// premierAddOnName is add-on name. slot is name of the deployment slot. If a slot is not specified, the API will get -// the named add-on for the production slot. +// premierAddOnName is add-on name. slot is name of the deployment slot. If a slot is not specified, the API will +// get the named add-on for the production slot. func (client AppsClient) GetPremierAddOnSlot(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, slot string) (result PremierAddOn, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetPremierAddOnSlot") + return result, validation.NewError("web.AppsClient", "GetPremierAddOnSlot", err.Error()) } req, err := client.GetPremierAddOnSlotPreparer(ctx, resourceGroupName, name, premierAddOnName, slot) @@ -9709,14 +9720,15 @@ func (client AppsClient) GetPremierAddOnSlotResponder(resp *http.Response) (resu // GetProcess get process information by its ID for a specific scaled-out instance in a web site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is pID. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is +// pID. func (client AppsClient) GetProcess(ctx context.Context, resourceGroupName string, name string, processID string) (result ProcessInfo, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetProcess") + return result, validation.NewError("web.AppsClient", "GetProcess", err.Error()) } req, err := client.GetProcessPreparer(ctx, resourceGroupName, name, processID) @@ -9784,14 +9796,15 @@ func (client AppsClient) GetProcessResponder(resp *http.Response) (result Proces // GetProcessDump get a memory dump of a process by its ID for a specific scaled-out instance in a web site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is pID. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is +// pID. func (client AppsClient) GetProcessDump(ctx context.Context, resourceGroupName string, name string, processID string) (result ReadCloser, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetProcessDump") + return result, validation.NewError("web.AppsClient", "GetProcessDump", err.Error()) } req, err := client.GetProcessDumpPreparer(ctx, resourceGroupName, name, processID) @@ -9858,16 +9871,16 @@ func (client AppsClient) GetProcessDumpResponder(resp *http.Response) (result Re // GetProcessDumpSlot get a memory dump of a process by its ID for a specific scaled-out instance in a web site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is pID. -// slot is name of the deployment slot. If a slot is not specified, the API returns deployments for the production -// slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is +// pID. slot is name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. func (client AppsClient) GetProcessDumpSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (result ReadCloser, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetProcessDumpSlot") + return result, validation.NewError("web.AppsClient", "GetProcessDumpSlot", err.Error()) } req, err := client.GetProcessDumpSlotPreparer(ctx, resourceGroupName, name, processID, slot) @@ -9935,15 +9948,15 @@ func (client AppsClient) GetProcessDumpSlotResponder(resp *http.Response) (resul // GetProcessModule get process information by its ID for a specific scaled-out instance in a web site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is pID. -// baseAddress is module base address. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is +// pID. baseAddress is module base address. func (client AppsClient) GetProcessModule(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string) (result ProcessModuleInfo, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetProcessModule") + return result, validation.NewError("web.AppsClient", "GetProcessModule", err.Error()) } req, err := client.GetProcessModulePreparer(ctx, resourceGroupName, name, processID, baseAddress) @@ -10012,16 +10025,16 @@ func (client AppsClient) GetProcessModuleResponder(resp *http.Response) (result // GetProcessModuleSlot get process information by its ID for a specific scaled-out instance in a web site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is pID. -// baseAddress is module base address. slot is name of the deployment slot. If a slot is not specified, the API returns -// deployments for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is +// pID. baseAddress is module base address. slot is name of the deployment slot. If a slot is not specified, the +// API returns deployments for the production slot. func (client AppsClient) GetProcessModuleSlot(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, slot string) (result ProcessModuleInfo, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetProcessModuleSlot") + return result, validation.NewError("web.AppsClient", "GetProcessModuleSlot", err.Error()) } req, err := client.GetProcessModuleSlotPreparer(ctx, resourceGroupName, name, processID, baseAddress, slot) @@ -10091,16 +10104,16 @@ func (client AppsClient) GetProcessModuleSlotResponder(resp *http.Response) (res // GetProcessSlot get process information by its ID for a specific scaled-out instance in a web site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is pID. -// slot is name of the deployment slot. If a slot is not specified, the API returns deployments for the production -// slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is +// pID. slot is name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. func (client AppsClient) GetProcessSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (result ProcessInfo, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetProcessSlot") + return result, validation.NewError("web.AppsClient", "GetProcessSlot", err.Error()) } req, err := client.GetProcessSlotPreparer(ctx, resourceGroupName, name, processID, slot) @@ -10170,15 +10183,15 @@ func (client AppsClient) GetProcessSlotResponder(resp *http.Response) (result Pr // GetProcessThread get thread information by Thread ID for a specific process, in a specific scaled-out instance in a // web site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is pID. -// threadID is tID. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is +// pID. threadID is tID. func (client AppsClient) GetProcessThread(ctx context.Context, resourceGroupName string, name string, processID string, threadID string) (result ProcessThreadInfo, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetProcessThread") + return result, validation.NewError("web.AppsClient", "GetProcessThread", err.Error()) } req, err := client.GetProcessThreadPreparer(ctx, resourceGroupName, name, processID, threadID) @@ -10248,16 +10261,16 @@ func (client AppsClient) GetProcessThreadResponder(resp *http.Response) (result // GetProcessThreadSlot get thread information by Thread ID for a specific process, in a specific scaled-out instance // in a web site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is pID. -// threadID is tID. slot is name of the deployment slot. If a slot is not specified, the API returns deployments for -// the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is +// pID. threadID is tID. slot is name of the deployment slot. If a slot is not specified, the API returns +// deployments for the production slot. func (client AppsClient) GetProcessThreadSlot(ctx context.Context, resourceGroupName string, name string, processID string, threadID string, slot string) (result ProcessThreadInfo, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetProcessThreadSlot") + return result, validation.NewError("web.AppsClient", "GetProcessThreadSlot", err.Error()) } req, err := client.GetProcessThreadSlotPreparer(ctx, resourceGroupName, name, processID, threadID, slot) @@ -10335,7 +10348,7 @@ func (client AppsClient) GetPublicCertificate(ctx context.Context, resourceGroup 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.NewErrorWithValidationError(err, "web.AppsClient", "GetPublicCertificate") + return result, validation.NewError("web.AppsClient", "GetPublicCertificate", err.Error()) } req, err := client.GetPublicCertificatePreparer(ctx, resourceGroupName, name, publicCertificateName) @@ -10403,8 +10416,8 @@ func (client AppsClient) GetPublicCertificateResponder(resp *http.Response) (res // GetPublicCertificateSlot get the named public certificate for an app (or deployment slot, if specified). // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API the named binding for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API the named binding for the production slot. // publicCertificateName is public certificate name. func (client AppsClient) GetPublicCertificateSlot(ctx context.Context, resourceGroupName string, name string, slot string, publicCertificateName string) (result PublicCertificate, err error) { if err := validation.Validate([]validation.Validation{ @@ -10412,7 +10425,7 @@ func (client AppsClient) GetPublicCertificateSlot(ctx context.Context, resourceG 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.NewErrorWithValidationError(err, "web.AppsClient", "GetPublicCertificateSlot") + return result, validation.NewError("web.AppsClient", "GetPublicCertificateSlot", err.Error()) } req, err := client.GetPublicCertificateSlotPreparer(ctx, resourceGroupName, name, slot, publicCertificateName) @@ -10481,15 +10494,15 @@ func (client AppsClient) GetPublicCertificateSlotResponder(resp *http.Response) // GetRelayServiceConnection gets a hybrid connection configuration by its name. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. entityName -// is name of the hybrid connection. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. +// entityName is name of the hybrid connection. func (client AppsClient) GetRelayServiceConnection(ctx context.Context, resourceGroupName string, name string, entityName string) (result RelayServiceConnectionEntity, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetRelayServiceConnection") + return result, validation.NewError("web.AppsClient", "GetRelayServiceConnection", err.Error()) } req, err := client.GetRelayServiceConnectionPreparer(ctx, resourceGroupName, name, entityName) @@ -10557,16 +10570,16 @@ func (client AppsClient) GetRelayServiceConnectionResponder(resp *http.Response) // GetRelayServiceConnectionSlot gets a hybrid connection configuration by its name. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. entityName -// is name of the hybrid connection. slot is name of the deployment slot. If a slot is not specified, the API will get -// a hybrid connection for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. +// entityName is name of the hybrid connection. slot is name of the deployment slot. If a slot is not specified, +// the API will get a hybrid connection for the production slot. func (client AppsClient) GetRelayServiceConnectionSlot(ctx context.Context, resourceGroupName string, name string, entityName string, slot string) (result RelayServiceConnectionEntity, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetRelayServiceConnectionSlot") + return result, validation.NewError("web.AppsClient", "GetRelayServiceConnectionSlot", err.Error()) } req, err := client.GetRelayServiceConnectionSlotPreparer(ctx, resourceGroupName, name, entityName, slot) @@ -10635,15 +10648,15 @@ func (client AppsClient) GetRelayServiceConnectionSlotResponder(resp *http.Respo // GetSiteExtension get site extension information by its ID for a web site, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. siteExtensionID is -// site extension name. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. +// siteExtensionID is site extension name. func (client AppsClient) GetSiteExtension(ctx context.Context, resourceGroupName string, name string, siteExtensionID string) (result SiteExtensionInfo, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetSiteExtension") + return result, validation.NewError("web.AppsClient", "GetSiteExtension", err.Error()) } req, err := client.GetSiteExtensionPreparer(ctx, resourceGroupName, name, siteExtensionID) @@ -10711,16 +10724,16 @@ func (client AppsClient) GetSiteExtensionResponder(resp *http.Response) (result // GetSiteExtensionSlot get site extension information by its ID for a web site, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. siteExtensionID is -// site extension name. slot is name of the deployment slot. If a slot is not specified, the API deletes a deployment -// for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. +// siteExtensionID is site extension name. slot is name of the deployment slot. If a slot is not specified, the API +// deletes a deployment for the production slot. func (client AppsClient) GetSiteExtensionSlot(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string) (result SiteExtensionInfo, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetSiteExtensionSlot") + return result, validation.NewError("web.AppsClient", "GetSiteExtensionSlot", err.Error()) } req, err := client.GetSiteExtensionSlotPreparer(ctx, resourceGroupName, name, siteExtensionID, slot) @@ -10796,7 +10809,7 @@ func (client AppsClient) GetSitePhpErrorLogFlag(ctx context.Context, resourceGro 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.NewErrorWithValidationError(err, "web.AppsClient", "GetSitePhpErrorLogFlag") + return result, validation.NewError("web.AppsClient", "GetSitePhpErrorLogFlag", err.Error()) } req, err := client.GetSitePhpErrorLogFlagPreparer(ctx, resourceGroupName, name) @@ -10863,15 +10876,15 @@ func (client AppsClient) GetSitePhpErrorLogFlagResponder(resp *http.Response) (r // GetSitePhpErrorLogFlagSlot gets web app's event logs. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. slot is name -// of web app slot. If not specified then will default to production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. slot is +// name of web app slot. If not specified then will default to production slot. func (client AppsClient) GetSitePhpErrorLogFlagSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SitePhpErrorLogFlag, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetSitePhpErrorLogFlagSlot") + return result, validation.NewError("web.AppsClient", "GetSitePhpErrorLogFlagSlot", err.Error()) } req, err := client.GetSitePhpErrorLogFlagSlotPreparer(ctx, resourceGroupName, name, slot) @@ -10939,15 +10952,15 @@ func (client AppsClient) GetSitePhpErrorLogFlagSlotResponder(resp *http.Response // GetSlot gets the details of a web, mobile, or API app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. By default, this API returns the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. By default, this API returns the production slot. func (client AppsClient) GetSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result Site, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetSlot") + return result, validation.NewError("web.AppsClient", "GetSlot", err.Error()) } req, err := client.GetSlotPreparer(ctx, resourceGroupName, name, slot) @@ -11022,7 +11035,7 @@ func (client AppsClient) GetSourceControl(ctx context.Context, 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.NewErrorWithValidationError(err, "web.AppsClient", "GetSourceControl") + return result, validation.NewError("web.AppsClient", "GetSourceControl", err.Error()) } req, err := client.GetSourceControlPreparer(ctx, resourceGroupName, name) @@ -11089,16 +11102,16 @@ func (client AppsClient) GetSourceControlResponder(resp *http.Response) (result // GetSourceControlSlot gets the source control configuration of an app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API will get the source control configuration for the -// production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API will get the source control configuration for +// the production slot. func (client AppsClient) GetSourceControlSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteSourceControl, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetSourceControlSlot") + return result, validation.NewError("web.AppsClient", "GetSourceControlSlot", err.Error()) } req, err := client.GetSourceControlSlotPreparer(ctx, resourceGroupName, name, slot) @@ -11166,15 +11179,15 @@ func (client AppsClient) GetSourceControlSlotResponder(resp *http.Response) (res // GetTriggeredWebJob gets a triggered web job by its ID for an app, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is name -// of Web Job. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is +// name of Web Job. func (client AppsClient) GetTriggeredWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result TriggeredWebJob, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetTriggeredWebJob") + return result, validation.NewError("web.AppsClient", "GetTriggeredWebJob", err.Error()) } req, err := client.GetTriggeredWebJobPreparer(ctx, resourceGroupName, name, webJobName) @@ -11242,15 +11255,15 @@ func (client AppsClient) GetTriggeredWebJobResponder(resp *http.Response) (resul // GetTriggeredWebJobHistory gets a triggered web job's history by its ID for an app, , or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is name -// of Web Job. ID is history ID. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is +// name of Web Job. ID is history ID. func (client AppsClient) GetTriggeredWebJobHistory(ctx context.Context, resourceGroupName string, name string, webJobName string, ID string) (result TriggeredJobHistory, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetTriggeredWebJobHistory") + return result, validation.NewError("web.AppsClient", "GetTriggeredWebJobHistory", err.Error()) } req, err := client.GetTriggeredWebJobHistoryPreparer(ctx, resourceGroupName, name, webJobName, ID) @@ -11319,16 +11332,16 @@ func (client AppsClient) GetTriggeredWebJobHistoryResponder(resp *http.Response) // GetTriggeredWebJobHistorySlot gets a triggered web job's history by its ID for an app, , or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is name -// of Web Job. ID is history ID. slot is name of the deployment slot. If a slot is not specified, the API deletes a -// deployment for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is +// name of Web Job. ID is history ID. slot is name of the deployment slot. If a slot is not specified, the API +// deletes a deployment for the production slot. func (client AppsClient) GetTriggeredWebJobHistorySlot(ctx context.Context, resourceGroupName string, name string, webJobName string, ID string, slot string) (result TriggeredJobHistory, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetTriggeredWebJobHistorySlot") + return result, validation.NewError("web.AppsClient", "GetTriggeredWebJobHistorySlot", err.Error()) } req, err := client.GetTriggeredWebJobHistorySlotPreparer(ctx, resourceGroupName, name, webJobName, ID, slot) @@ -11398,16 +11411,16 @@ func (client AppsClient) GetTriggeredWebJobHistorySlotResponder(resp *http.Respo // GetTriggeredWebJobSlot gets a triggered web job by its ID for an app, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is name -// of Web Job. slot is name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is +// name of Web Job. slot is name of the deployment slot. If a slot is not specified, the API deletes a deployment +// for the production slot. func (client AppsClient) GetTriggeredWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result TriggeredWebJob, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetTriggeredWebJobSlot") + return result, validation.NewError("web.AppsClient", "GetTriggeredWebJobSlot", err.Error()) } req, err := client.GetTriggeredWebJobSlotPreparer(ctx, resourceGroupName, name, webJobName, slot) @@ -11476,15 +11489,15 @@ func (client AppsClient) GetTriggeredWebJobSlotResponder(resp *http.Response) (r // GetVnetConnection gets a virtual network the app (or deployment slot) is connected to by name. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. vnetName is -// name of the virtual network. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. vnetName +// is name of the virtual network. func (client AppsClient) GetVnetConnection(ctx context.Context, resourceGroupName string, name string, vnetName string) (result VnetInfo, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetVnetConnection") + return result, validation.NewError("web.AppsClient", "GetVnetConnection", err.Error()) } req, err := client.GetVnetConnectionPreparer(ctx, resourceGroupName, name, vnetName) @@ -11552,15 +11565,16 @@ func (client AppsClient) GetVnetConnectionResponder(resp *http.Response) (result // GetVnetConnectionGateway gets an app's Virtual Network gateway. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. vnetName is -// name of the Virtual Network. gatewayName is name of the gateway. Currently, the only supported string is "primary". +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. vnetName +// is name of the Virtual Network. gatewayName is name of the gateway. Currently, the only supported string is +// "primary". func (client AppsClient) GetVnetConnectionGateway(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string) (result VnetGateway, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetVnetConnectionGateway") + return result, validation.NewError("web.AppsClient", "GetVnetConnectionGateway", err.Error()) } req, err := client.GetVnetConnectionGatewayPreparer(ctx, resourceGroupName, name, vnetName, gatewayName) @@ -11629,17 +11643,17 @@ func (client AppsClient) GetVnetConnectionGatewayResponder(resp *http.Response) // GetVnetConnectionGatewaySlot gets an app's Virtual Network gateway. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. vnetName is -// name of the Virtual Network. gatewayName is name of the gateway. Currently, the only supported string is "primary". -// slot is name of the deployment slot. If a slot is not specified, the API will get a gateway for the production -// slot's Virtual Network. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. vnetName +// is name of the Virtual Network. gatewayName is name of the gateway. Currently, the only supported string is +// "primary". slot is name of the deployment slot. If a slot is not specified, the API will get a gateway for the +// production slot's Virtual Network. func (client AppsClient) GetVnetConnectionGatewaySlot(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, slot string) (result VnetGateway, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetVnetConnectionGatewaySlot") + return result, validation.NewError("web.AppsClient", "GetVnetConnectionGatewaySlot", err.Error()) } req, err := client.GetVnetConnectionGatewaySlotPreparer(ctx, resourceGroupName, name, vnetName, gatewayName, slot) @@ -11709,16 +11723,16 @@ func (client AppsClient) GetVnetConnectionGatewaySlotResponder(resp *http.Respon // GetVnetConnectionSlot gets a virtual network the app (or deployment slot) is connected to by name. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. vnetName is -// name of the virtual network. slot is name of the deployment slot. If a slot is not specified, the API will get the -// named virtual network for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. vnetName +// is name of the virtual network. slot is name of the deployment slot. If a slot is not specified, the API will +// get the named virtual network for the production slot. func (client AppsClient) GetVnetConnectionSlot(ctx context.Context, resourceGroupName string, name string, vnetName string, slot string) (result VnetInfo, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetVnetConnectionSlot") + return result, validation.NewError("web.AppsClient", "GetVnetConnectionSlot", err.Error()) } req, err := client.GetVnetConnectionSlotPreparer(ctx, resourceGroupName, name, vnetName, slot) @@ -11787,15 +11801,15 @@ func (client AppsClient) GetVnetConnectionSlotResponder(resp *http.Response) (re // GetWebJob get webjob information for an app, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is name -// of the web job. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is +// name of the web job. func (client AppsClient) GetWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result Job, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetWebJob") + return result, validation.NewError("web.AppsClient", "GetWebJob", err.Error()) } req, err := client.GetWebJobPreparer(ctx, resourceGroupName, name, webJobName) @@ -11863,16 +11877,16 @@ func (client AppsClient) GetWebJobResponder(resp *http.Response) (result Job, er // GetWebJobSlot get webjob information for an app, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is name -// of the web job. slot is name of the deployment slot. If a slot is not specified, the API returns deployments for the -// production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is +// name of the web job. slot is name of the deployment slot. If a slot is not specified, the API returns +// deployments for the production slot. func (client AppsClient) GetWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result Job, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetWebJobSlot") + return result, validation.NewError("web.AppsClient", "GetWebJobSlot", err.Error()) } req, err := client.GetWebJobSlotPreparer(ctx, resourceGroupName, name, webJobName, slot) @@ -11948,7 +11962,7 @@ func (client AppsClient) GetWebSiteContainerLogs(ctx context.Context, resourceGr 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.NewErrorWithValidationError(err, "web.AppsClient", "GetWebSiteContainerLogs") + return result, validation.NewError("web.AppsClient", "GetWebSiteContainerLogs", err.Error()) } req, err := client.GetWebSiteContainerLogsPreparer(ctx, resourceGroupName, name) @@ -12014,15 +12028,15 @@ func (client AppsClient) GetWebSiteContainerLogsResponder(resp *http.Response) ( // GetWebSiteContainerLogsSlot gets the last lines of docker logs for the given site // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. slot is name -// of web app slot. If not specified then will default to production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. slot is +// name of web app slot. If not specified then will default to production slot. func (client AppsClient) GetWebSiteContainerLogsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result ReadCloser, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetWebSiteContainerLogsSlot") + return result, validation.NewError("web.AppsClient", "GetWebSiteContainerLogsSlot", err.Error()) } req, err := client.GetWebSiteContainerLogsSlotPreparer(ctx, resourceGroupName, name, slot) @@ -12096,7 +12110,7 @@ func (client AppsClient) GetWebSiteContainerLogsZip(ctx context.Context, resourc 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.NewErrorWithValidationError(err, "web.AppsClient", "GetWebSiteContainerLogsZip") + return result, validation.NewError("web.AppsClient", "GetWebSiteContainerLogsZip", err.Error()) } req, err := client.GetWebSiteContainerLogsZipPreparer(ctx, resourceGroupName, name) @@ -12162,15 +12176,15 @@ func (client AppsClient) GetWebSiteContainerLogsZipResponder(resp *http.Response // GetWebSiteContainerLogsZipSlot gets the ZIP archived docker log files for the given site // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. slot is name -// of web app slot. If not specified then will default to production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. slot is +// name of web app slot. If not specified then will default to production slot. func (client AppsClient) GetWebSiteContainerLogsZipSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result ReadCloser, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "GetWebSiteContainerLogsZipSlot") + return result, validation.NewError("web.AppsClient", "GetWebSiteContainerLogsZipSlot", err.Error()) } req, err := client.GetWebSiteContainerLogsZipSlotPreparer(ctx, resourceGroupName, name, slot) @@ -12237,15 +12251,15 @@ func (client AppsClient) GetWebSiteContainerLogsZipSlotResponder(resp *http.Resp // InstallSiteExtension install site extension on a web site, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. siteExtensionID is -// site extension name. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. +// siteExtensionID is site extension name. func (client AppsClient) InstallSiteExtension(ctx context.Context, resourceGroupName string, name string, siteExtensionID string) (result AppsInstallSiteExtensionFuture, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "InstallSiteExtension") + return result, validation.NewError("web.AppsClient", "InstallSiteExtension", err.Error()) } req, err := client.InstallSiteExtensionPreparer(ctx, resourceGroupName, name, siteExtensionID) @@ -12315,16 +12329,16 @@ func (client AppsClient) InstallSiteExtensionResponder(resp *http.Response) (res // InstallSiteExtensionSlot install site extension on a web site, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. siteExtensionID is -// site extension name. slot is name of the deployment slot. If a slot is not specified, the API deletes a deployment -// for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. +// siteExtensionID is site extension name. slot is name of the deployment slot. If a slot is not specified, the API +// deletes a deployment for the production slot. func (client AppsClient) InstallSiteExtensionSlot(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string) (result AppsInstallSiteExtensionSlotFuture, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "InstallSiteExtensionSlot") + return result, validation.NewError("web.AppsClient", "InstallSiteExtensionSlot", err.Error()) } req, err := client.InstallSiteExtensionSlotPreparer(ctx, resourceGroupName, name, siteExtensionID, slot) @@ -12402,7 +12416,7 @@ func (client AppsClient) IsCloneable(ctx context.Context, resourceGroupName stri 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.NewErrorWithValidationError(err, "web.AppsClient", "IsCloneable") + return result, validation.NewError("web.AppsClient", "IsCloneable", err.Error()) } req, err := client.IsCloneablePreparer(ctx, resourceGroupName, name) @@ -12469,15 +12483,15 @@ func (client AppsClient) IsCloneableResponder(resp *http.Response) (result SiteC // IsCloneableSlot shows whether an app can be cloned to another resource group or subscription. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. By default, this API returns information on the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. By default, this API returns information on the production slot. func (client AppsClient) IsCloneableSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteCloneability, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "IsCloneableSlot") + return result, validation.NewError("web.AppsClient", "IsCloneableSlot", err.Error()) } req, err := client.IsCloneableSlotPreparer(ctx, resourceGroupName, name, slot) @@ -12642,7 +12656,7 @@ func (client AppsClient) ListApplicationSettings(ctx context.Context, resourceGr 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.NewErrorWithValidationError(err, "web.AppsClient", "ListApplicationSettings") + return result, validation.NewError("web.AppsClient", "ListApplicationSettings", err.Error()) } req, err := client.ListApplicationSettingsPreparer(ctx, resourceGroupName, name) @@ -12709,16 +12723,16 @@ func (client AppsClient) ListApplicationSettingsResponder(resp *http.Response) ( // ListApplicationSettingsSlot gets the application settings of an app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API will get the application settings for the production -// slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API will get the application settings for the +// production slot. func (client AppsClient) ListApplicationSettingsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result StringDictionary, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListApplicationSettingsSlot") + return result, validation.NewError("web.AppsClient", "ListApplicationSettingsSlot", err.Error()) } req, err := client.ListApplicationSettingsSlotPreparer(ctx, resourceGroupName, name, slot) @@ -12793,7 +12807,7 @@ func (client AppsClient) ListBackups(ctx context.Context, resourceGroupName stri 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.NewErrorWithValidationError(err, "web.AppsClient", "ListBackups") + return result, validation.NewError("web.AppsClient", "ListBackups", err.Error()) } result.fn = client.listBackupsNextResults @@ -12888,15 +12902,15 @@ func (client AppsClient) ListBackupsComplete(ctx context.Context, resourceGroupN // ListBackupsSlot gets existing backups of an app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API will get backups of the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API will get backups of the production slot. func (client AppsClient) ListBackupsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result BackupItemCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListBackupsSlot") + return result, validation.NewError("web.AppsClient", "ListBackupsSlot", err.Error()) } result.fn = client.listBackupsSlotNextResults @@ -12994,8 +13008,8 @@ func (client AppsClient) ListBackupsSlotComplete(ctx context.Context, resourceGr // the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is // passed in the request body. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. backupID is -// ID of backup. request is information on backup request. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. backupID +// is ID of backup. request is information on backup request. func (client AppsClient) ListBackupStatusSecrets(ctx context.Context, resourceGroupName string, name string, backupID string, request BackupRequest) (result BackupItem, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -13012,7 +13026,7 @@ func (client AppsClient) ListBackupStatusSecrets(ctx context.Context, resourceGr {Target: "request.BackupRequestProperties.BackupSchedule.RetentionPeriodInDays", Name: validation.Null, Rule: true, Chain: nil}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppsClient", "ListBackupStatusSecrets") + return result, validation.NewError("web.AppsClient", "ListBackupStatusSecrets", err.Error()) } req, err := client.ListBackupStatusSecretsPreparer(ctx, resourceGroupName, name, backupID, request) @@ -13084,9 +13098,9 @@ func (client AppsClient) ListBackupStatusSecretsResponder(resp *http.Response) ( // with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new // URL is passed in the request body. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. backupID is -// ID of backup. request is information on backup request. slot is name of web app slot. If not specified then will -// default to production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. backupID +// is ID of backup. request is information on backup request. slot is name of web app slot. If not specified then +// will default to production slot. func (client AppsClient) ListBackupStatusSecretsSlot(ctx context.Context, resourceGroupName string, name string, backupID string, request BackupRequest, slot string) (result BackupItem, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -13103,7 +13117,7 @@ func (client AppsClient) ListBackupStatusSecretsSlot(ctx context.Context, resour {Target: "request.BackupRequestProperties.BackupSchedule.RetentionPeriodInDays", Name: validation.Null, Rule: true, Chain: nil}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppsClient", "ListBackupStatusSecretsSlot") + return result, validation.NewError("web.AppsClient", "ListBackupStatusSecretsSlot", err.Error()) } req, err := client.ListBackupStatusSecretsSlotPreparer(ctx, resourceGroupName, name, backupID, request, slot) @@ -13183,7 +13197,7 @@ func (client AppsClient) ListByResourceGroup(ctx context.Context, resourceGroupN 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.NewErrorWithValidationError(err, "web.AppsClient", "ListByResourceGroup") + return result, validation.NewError("web.AppsClient", "ListByResourceGroup", err.Error()) } result.fn = client.listByResourceGroupNextResults @@ -13287,7 +13301,7 @@ func (client AppsClient) ListConfigurations(ctx context.Context, resourceGroupNa 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.NewErrorWithValidationError(err, "web.AppsClient", "ListConfigurations") + return result, validation.NewError("web.AppsClient", "ListConfigurations", err.Error()) } result.fn = client.listConfigurationsNextResults @@ -13390,7 +13404,7 @@ func (client AppsClient) ListConfigurationSnapshotInfo(ctx context.Context, reso 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.NewErrorWithValidationError(err, "web.AppsClient", "ListConfigurationSnapshotInfo") + return result, validation.NewError("web.AppsClient", "ListConfigurationSnapshotInfo", err.Error()) } result.fn = client.listConfigurationSnapshotInfoNextResults @@ -13486,15 +13500,16 @@ func (client AppsClient) ListConfigurationSnapshotInfoComplete(ctx context.Conte // ListConfigurationSnapshotInfoSlot gets a list of web app configuration snapshots identifiers. Each element of the // list contains a timestamp and the ID of the snapshot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API will return configuration for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API will return configuration for the production +// slot. func (client AppsClient) ListConfigurationSnapshotInfoSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteConfigurationSnapshotInfoCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListConfigurationSnapshotInfoSlot") + return result, validation.NewError("web.AppsClient", "ListConfigurationSnapshotInfoSlot", err.Error()) } result.fn = client.listConfigurationSnapshotInfoSlotNextResults @@ -13590,15 +13605,16 @@ func (client AppsClient) ListConfigurationSnapshotInfoSlotComplete(ctx context.C // ListConfigurationsSlot list the configurations of an app // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API will return configuration for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API will return configuration for the production +// slot. func (client AppsClient) ListConfigurationsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteConfigResourceCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListConfigurationsSlot") + return result, validation.NewError("web.AppsClient", "ListConfigurationsSlot", err.Error()) } result.fn = client.listConfigurationsSlotNextResults @@ -13701,7 +13717,7 @@ func (client AppsClient) ListConnectionStrings(ctx context.Context, resourceGrou 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.NewErrorWithValidationError(err, "web.AppsClient", "ListConnectionStrings") + return result, validation.NewError("web.AppsClient", "ListConnectionStrings", err.Error()) } req, err := client.ListConnectionStringsPreparer(ctx, resourceGroupName, name) @@ -13768,16 +13784,16 @@ func (client AppsClient) ListConnectionStringsResponder(resp *http.Response) (re // ListConnectionStringsSlot gets the connection strings of an app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API will get the connection settings for the production -// slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API will get the connection settings for the +// production slot. func (client AppsClient) ListConnectionStringsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result ConnectionStringDictionary, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListConnectionStringsSlot") + return result, validation.NewError("web.AppsClient", "ListConnectionStringsSlot", err.Error()) } req, err := client.ListConnectionStringsSlotPreparer(ctx, resourceGroupName, name, slot) @@ -13852,7 +13868,7 @@ func (client AppsClient) ListContinuousWebJobs(ctx context.Context, resourceGrou 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.NewErrorWithValidationError(err, "web.AppsClient", "ListContinuousWebJobs") + return result, validation.NewError("web.AppsClient", "ListContinuousWebJobs", err.Error()) } result.fn = client.listContinuousWebJobsNextResults @@ -13947,15 +13963,15 @@ func (client AppsClient) ListContinuousWebJobsComplete(ctx context.Context, reso // ListContinuousWebJobsSlot list continuous web jobs for an app, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. slot is name of -// the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. slot is name +// of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. func (client AppsClient) ListContinuousWebJobsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result ContinuousWebJobCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListContinuousWebJobsSlot") + return result, validation.NewError("web.AppsClient", "ListContinuousWebJobsSlot", err.Error()) } result.fn = client.listContinuousWebJobsSlotNextResults @@ -14051,8 +14067,8 @@ func (client AppsClient) ListContinuousWebJobsSlotComplete(ctx context.Context, // ListDeploymentLog list deployment log for specific deployment for an app, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. ID is the ID -// of a specific deployment. This is the value of the name property in the JSON response from "GET +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. ID is +// the ID of a specific deployment. This is the value of the name property in the JSON response from "GET // /api/sites/{siteName}/deployments". func (client AppsClient) ListDeploymentLog(ctx context.Context, resourceGroupName string, name string, ID string) (result Deployment, err error) { if err := validation.Validate([]validation.Validation{ @@ -14060,7 +14076,7 @@ func (client AppsClient) ListDeploymentLog(ctx context.Context, resourceGroupNam 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.NewErrorWithValidationError(err, "web.AppsClient", "ListDeploymentLog") + return result, validation.NewError("web.AppsClient", "ListDeploymentLog", err.Error()) } req, err := client.ListDeploymentLogPreparer(ctx, resourceGroupName, name, ID) @@ -14128,17 +14144,17 @@ func (client AppsClient) ListDeploymentLogResponder(resp *http.Response) (result // ListDeploymentLogSlot list deployment log for specific deployment for an app, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. ID is the ID -// of a specific deployment. This is the value of the name property in the JSON response from "GET -// /api/sites/{siteName}/deployments". slot is name of the deployment slot. If a slot is not specified, the API returns -// deployments for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. ID is +// the ID of a specific deployment. This is the value of the name property in the JSON response from "GET +// /api/sites/{siteName}/deployments". slot is name of the deployment slot. If a slot is not specified, the API +// returns deployments for the production slot. func (client AppsClient) ListDeploymentLogSlot(ctx context.Context, resourceGroupName string, name string, ID string, slot string) (result Deployment, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListDeploymentLogSlot") + return result, validation.NewError("web.AppsClient", "ListDeploymentLogSlot", err.Error()) } req, err := client.ListDeploymentLogSlotPreparer(ctx, resourceGroupName, name, ID, slot) @@ -14214,7 +14230,7 @@ func (client AppsClient) ListDeployments(ctx context.Context, 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.NewErrorWithValidationError(err, "web.AppsClient", "ListDeployments") + return result, validation.NewError("web.AppsClient", "ListDeployments", err.Error()) } result.fn = client.listDeploymentsNextResults @@ -14309,15 +14325,15 @@ func (client AppsClient) ListDeploymentsComplete(ctx context.Context, resourceGr // ListDeploymentsSlot list deployments for an app, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. func (client AppsClient) ListDeploymentsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result DeploymentCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListDeploymentsSlot") + return result, validation.NewError("web.AppsClient", "ListDeploymentsSlot", err.Error()) } result.fn = client.listDeploymentsSlotNextResults @@ -14420,7 +14436,7 @@ func (client AppsClient) ListDomainOwnershipIdentifiers(ctx context.Context, res 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.NewErrorWithValidationError(err, "web.AppsClient", "ListDomainOwnershipIdentifiers") + return result, validation.NewError("web.AppsClient", "ListDomainOwnershipIdentifiers", err.Error()) } result.fn = client.listDomainOwnershipIdentifiersNextResults @@ -14515,15 +14531,16 @@ func (client AppsClient) ListDomainOwnershipIdentifiersComplete(ctx context.Cont // ListDomainOwnershipIdentifiersSlot lists ownership identifiers for domain associated with web app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API will delete the binding for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API will delete the binding for the production +// slot. func (client AppsClient) ListDomainOwnershipIdentifiersSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result IdentifierCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListDomainOwnershipIdentifiersSlot") + return result, validation.NewError("web.AppsClient", "ListDomainOwnershipIdentifiersSlot", err.Error()) } result.fn = client.listDomainOwnershipIdentifiersSlotNextResults @@ -14626,7 +14643,7 @@ func (client AppsClient) ListFunctions(ctx context.Context, resourceGroupName st 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.NewErrorWithValidationError(err, "web.AppsClient", "ListFunctions") + return result, validation.NewError("web.AppsClient", "ListFunctions", err.Error()) } result.fn = client.listFunctionsNextResults @@ -14721,15 +14738,15 @@ func (client AppsClient) ListFunctionsComplete(ctx context.Context, resourceGrou // ListFunctionSecrets get function secrets for a function in a web site, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. functionName is -// function name. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. functionName +// is function name. func (client AppsClient) ListFunctionSecrets(ctx context.Context, resourceGroupName string, name string, functionName string) (result FunctionSecrets, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListFunctionSecrets") + return result, validation.NewError("web.AppsClient", "ListFunctionSecrets", err.Error()) } req, err := client.ListFunctionSecretsPreparer(ctx, resourceGroupName, name, functionName) @@ -14797,16 +14814,16 @@ func (client AppsClient) ListFunctionSecretsResponder(resp *http.Response) (resu // ListFunctionSecretsSlot get function secrets for a function in a web site, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. functionName is -// function name. slot is name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. functionName +// is function name. slot is name of the deployment slot. If a slot is not specified, the API deletes a deployment +// for the production slot. func (client AppsClient) ListFunctionSecretsSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (result FunctionSecrets, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListFunctionSecretsSlot") + return result, validation.NewError("web.AppsClient", "ListFunctionSecretsSlot", err.Error()) } req, err := client.ListFunctionSecretsSlotPreparer(ctx, resourceGroupName, name, functionName, slot) @@ -14882,7 +14899,7 @@ func (client AppsClient) ListHostNameBindings(ctx context.Context, resourceGroup 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.NewErrorWithValidationError(err, "web.AppsClient", "ListHostNameBindings") + return result, validation.NewError("web.AppsClient", "ListHostNameBindings", err.Error()) } result.fn = client.listHostNameBindingsNextResults @@ -14977,15 +14994,15 @@ func (client AppsClient) ListHostNameBindingsComplete(ctx context.Context, resou // ListHostNameBindingsSlot get hostname bindings for an app or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API gets hostname bindings for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the production slot. func (client AppsClient) ListHostNameBindingsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result HostNameBindingCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListHostNameBindingsSlot") + return result, validation.NewError("web.AppsClient", "ListHostNameBindingsSlot", err.Error()) } result.fn = client.listHostNameBindingsSlotNextResults @@ -15082,14 +15099,15 @@ func (client AppsClient) ListHostNameBindingsSlotComplete(ctx context.Context, r // ListHybridConnectionKeys gets the send key name and value for a Hybrid Connection. // // resourceGroupName is name of the resource group to which the resource belongs. name is the name of the web app. -// namespaceName is the namespace for this hybrid connection. relayName is the relay name for this hybrid connection. +// namespaceName is the namespace for this hybrid connection. relayName is the relay name for this hybrid +// connection. func (client AppsClient) ListHybridConnectionKeys(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (result HybridConnectionKey, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListHybridConnectionKeys") + return result, validation.NewError("web.AppsClient", "ListHybridConnectionKeys", err.Error()) } req, err := client.ListHybridConnectionKeysPreparer(ctx, resourceGroupName, name, namespaceName, relayName) @@ -15159,15 +15177,15 @@ func (client AppsClient) ListHybridConnectionKeysResponder(resp *http.Response) // ListHybridConnectionKeysSlot gets the send key name and value for a Hybrid Connection. // // resourceGroupName is name of the resource group to which the resource belongs. name is the name of the web app. -// namespaceName is the namespace for this hybrid connection. relayName is the relay name for this hybrid connection. -// slot is the name of the slot for the web app. +// namespaceName is the namespace for this hybrid connection. relayName is the relay name for this hybrid +// connection. slot is the name of the slot for the web app. func (client AppsClient) ListHybridConnectionKeysSlot(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, slot string) (result HybridConnectionKey, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListHybridConnectionKeysSlot") + return result, validation.NewError("web.AppsClient", "ListHybridConnectionKeysSlot", err.Error()) } req, err := client.ListHybridConnectionKeysSlotPreparer(ctx, resourceGroupName, name, namespaceName, relayName, slot) @@ -15244,7 +15262,7 @@ func (client AppsClient) ListHybridConnections(ctx context.Context, resourceGrou 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.NewErrorWithValidationError(err, "web.AppsClient", "ListHybridConnections") + return result, validation.NewError("web.AppsClient", "ListHybridConnections", err.Error()) } req, err := client.ListHybridConnectionsPreparer(ctx, resourceGroupName, name) @@ -15311,15 +15329,15 @@ func (client AppsClient) ListHybridConnectionsResponder(resp *http.Response) (re // ListHybridConnectionsSlot retrieves all Service Bus Hybrid Connections used by this Web App. // -// resourceGroupName is name of the resource group to which the resource belongs. name is the name of the web app. slot -// is the name of the slot for the web app. +// resourceGroupName is name of the resource group to which the resource belongs. name is the name of the web app. +// slot is the name of the slot for the web app. func (client AppsClient) ListHybridConnectionsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result HybridConnection, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListHybridConnectionsSlot") + return result, validation.NewError("web.AppsClient", "ListHybridConnectionsSlot", err.Error()) } req, err := client.ListHybridConnectionsSlotPreparer(ctx, resourceGroupName, name, slot) @@ -15387,15 +15405,15 @@ func (client AppsClient) ListHybridConnectionsSlotResponder(resp *http.Response) // ListInstanceFunctionsSlot list the functions for a web site, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. slot is name of -// the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. slot is name +// of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. func (client AppsClient) ListInstanceFunctionsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result FunctionEnvelopeCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListInstanceFunctionsSlot") + return result, validation.NewError("web.AppsClient", "ListInstanceFunctionsSlot", err.Error()) } result.fn = client.listInstanceFunctionsSlotNextResults @@ -15498,7 +15516,7 @@ func (client AppsClient) ListInstanceIdentifiers(ctx context.Context, resourceGr 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.NewErrorWithValidationError(err, "web.AppsClient", "ListInstanceIdentifiers") + return result, validation.NewError("web.AppsClient", "ListInstanceIdentifiers", err.Error()) } result.fn = client.listInstanceIdentifiersNextResults @@ -15593,15 +15611,15 @@ func (client AppsClient) ListInstanceIdentifiersComplete(ctx context.Context, re // ListInstanceIdentifiersSlot gets all scale-out instances of an app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API gets the production slot instances. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API gets the production slot instances. func (client AppsClient) ListInstanceIdentifiersSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result AppInstanceCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListInstanceIdentifiersSlot") + return result, validation.NewError("web.AppsClient", "ListInstanceIdentifiersSlot", err.Error()) } result.fn = client.listInstanceIdentifiersSlotNextResults @@ -15698,8 +15716,8 @@ func (client AppsClient) ListInstanceIdentifiersSlotComplete(ctx context.Context // ListInstanceProcesses get list of processes for a web site, or a deployment slot, or for a specific scaled-out // instance in a web site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. instanceID is ID -// of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. instanceID is +// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET // api/sites/{siteName}/instances". func (client AppsClient) ListInstanceProcesses(ctx context.Context, resourceGroupName string, name string, instanceID string) (result ProcessInfoCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ @@ -15707,7 +15725,7 @@ func (client AppsClient) ListInstanceProcesses(ctx context.Context, resourceGrou 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.NewErrorWithValidationError(err, "web.AppsClient", "ListInstanceProcesses") + return result, validation.NewError("web.AppsClient", "ListInstanceProcesses", err.Error()) } result.fn = client.listInstanceProcessesNextResults @@ -15804,17 +15822,17 @@ func (client AppsClient) ListInstanceProcessesComplete(ctx context.Context, reso // ListInstanceProcessesSlot get list of processes for a web site, or a deployment slot, or for a specific scaled-out // instance in a web site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. slot is name of -// the deployment slot. If a slot is not specified, the API returns deployments for the production slot. instanceID is -// ID of a specific scaled-out instance. This is the value of the name property in the JSON response from "GET -// api/sites/{siteName}/instances". +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. slot is name +// of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. +// instanceID is ID of a specific scaled-out instance. This is the value of the name property in the JSON response +// from "GET api/sites/{siteName}/instances". func (client AppsClient) ListInstanceProcessesSlot(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string) (result ProcessInfoCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListInstanceProcessesSlot") + return result, validation.NewError("web.AppsClient", "ListInstanceProcessesSlot", err.Error()) } result.fn = client.listInstanceProcessesSlotNextResults @@ -15912,16 +15930,16 @@ func (client AppsClient) ListInstanceProcessesSlotComplete(ctx context.Context, // ListInstanceProcessModules list module information for a process by its ID for a specific scaled-out instance in a // web site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is pID. -// instanceID is ID of a specific scaled-out instance. This is the value of the name property in the JSON response from -// "GET api/sites/{siteName}/instances". +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is +// pID. instanceID is ID of a specific scaled-out instance. This is the value of the name property in the JSON +// response from "GET api/sites/{siteName}/instances". func (client AppsClient) ListInstanceProcessModules(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (result ProcessModuleInfoCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListInstanceProcessModules") + return result, validation.NewError("web.AppsClient", "ListInstanceProcessModules", err.Error()) } result.fn = client.listInstanceProcessModulesNextResults @@ -16019,17 +16037,17 @@ func (client AppsClient) ListInstanceProcessModulesComplete(ctx context.Context, // ListInstanceProcessModulesSlot list module information for a process by its ID for a specific scaled-out instance in // a web site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is pID. -// slot is name of the deployment slot. If a slot is not specified, the API returns deployments for the production -// slot. instanceID is ID of a specific scaled-out instance. This is the value of the name property in the JSON -// response from "GET api/sites/{siteName}/instances". +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is +// pID. slot is name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. instanceID is ID of a specific scaled-out instance. This is the value of the name property in +// the JSON response from "GET api/sites/{siteName}/instances". func (client AppsClient) ListInstanceProcessModulesSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (result ProcessModuleInfoCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListInstanceProcessModulesSlot") + return result, validation.NewError("web.AppsClient", "ListInstanceProcessModulesSlot", err.Error()) } result.fn = client.listInstanceProcessModulesSlotNextResults @@ -16127,16 +16145,16 @@ func (client AppsClient) ListInstanceProcessModulesSlotComplete(ctx context.Cont // ListInstanceProcessThreads list the threads in a process by its ID for a specific scaled-out instance in a web site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is pID. -// instanceID is ID of a specific scaled-out instance. This is the value of the name property in the JSON response from -// "GET api/sites/{siteName}/instances". +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is +// pID. instanceID is ID of a specific scaled-out instance. This is the value of the name property in the JSON +// response from "GET api/sites/{siteName}/instances". func (client AppsClient) ListInstanceProcessThreads(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (result ProcessThreadInfoCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListInstanceProcessThreads") + return result, validation.NewError("web.AppsClient", "ListInstanceProcessThreads", err.Error()) } result.fn = client.listInstanceProcessThreadsNextResults @@ -16234,17 +16252,17 @@ func (client AppsClient) ListInstanceProcessThreadsComplete(ctx context.Context, // ListInstanceProcessThreadsSlot list the threads in a process by its ID for a specific scaled-out instance in a web // site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is pID. -// slot is name of the deployment slot. If a slot is not specified, the API returns deployments for the production -// slot. instanceID is ID of a specific scaled-out instance. This is the value of the name property in the JSON -// response from "GET api/sites/{siteName}/instances". +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is +// pID. slot is name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. instanceID is ID of a specific scaled-out instance. This is the value of the name property in +// the JSON response from "GET api/sites/{siteName}/instances". func (client AppsClient) ListInstanceProcessThreadsSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (result ProcessThreadInfoCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListInstanceProcessThreadsSlot") + return result, validation.NewError("web.AppsClient", "ListInstanceProcessThreadsSlot", err.Error()) } result.fn = client.listInstanceProcessThreadsSlotNextResults @@ -16349,7 +16367,7 @@ func (client AppsClient) ListMetadata(ctx context.Context, resourceGroupName str 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.NewErrorWithValidationError(err, "web.AppsClient", "ListMetadata") + return result, validation.NewError("web.AppsClient", "ListMetadata", err.Error()) } req, err := client.ListMetadataPreparer(ctx, resourceGroupName, name) @@ -16416,15 +16434,15 @@ func (client AppsClient) ListMetadataResponder(resp *http.Response) (result Stri // ListMetadataSlot gets the metadata of an app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API will get the metadata for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API will get the metadata for the production slot. func (client AppsClient) ListMetadataSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result StringDictionary, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListMetadataSlot") + return result, validation.NewError("web.AppsClient", "ListMetadataSlot", err.Error()) } req, err := client.ListMetadataSlotPreparer(ctx, resourceGroupName, name, slot) @@ -16499,7 +16517,7 @@ func (client AppsClient) ListMetricDefinitions(ctx context.Context, resourceGrou 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.NewErrorWithValidationError(err, "web.AppsClient", "ListMetricDefinitions") + return result, validation.NewError("web.AppsClient", "ListMetricDefinitions", err.Error()) } result.fn = client.listMetricDefinitionsNextResults @@ -16594,15 +16612,16 @@ func (client AppsClient) ListMetricDefinitionsComplete(ctx context.Context, reso // ListMetricDefinitionsSlot gets all metric definitions of an app (or deployment slot, if specified). // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API will get metric definitions of the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API will get metric definitions of the production +// slot. func (client AppsClient) ListMetricDefinitionsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result ResourceMetricDefinitionCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListMetricDefinitionsSlot") + return result, validation.NewError("web.AppsClient", "ListMetricDefinitionsSlot", err.Error()) } result.fn = client.listMetricDefinitionsSlotNextResults @@ -16698,18 +16717,18 @@ func (client AppsClient) ListMetricDefinitionsSlotComplete(ctx context.Context, // ListMetrics gets performance metrics of an app (or deployment slot, if specified). // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. details is -// specify "true" to include metric details in the response. It is "false" by default. filter is return only metrics -// specified in the filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' or name.value eq -// 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq -// duration'[Hour|Minute|Day]'. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. details +// is specify "true" to include metric details in the response. It is "false" by default. filter is return only +// metrics specified in the filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' or +// name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and +// timeGrain eq duration'[Hour|Minute|Day]'. func (client AppsClient) ListMetrics(ctx context.Context, resourceGroupName string, name string, details *bool, filter string) (result ResourceMetricCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListMetrics") + return result, validation.NewError("web.AppsClient", "ListMetrics", err.Error()) } result.fn = client.listMetricsNextResults @@ -16810,19 +16829,19 @@ func (client AppsClient) ListMetricsComplete(ctx context.Context, resourceGroupN // ListMetricsSlot gets performance metrics of an app (or deployment slot, if specified). // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API will get metrics of the production slot. details is -// specify "true" to include metric details in the response. It is "false" by default. filter is return only metrics -// specified in the filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' or name.value eq -// 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq -// duration'[Hour|Minute|Day]'. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API will get metrics of the production slot. +// details is specify "true" to include metric details in the response. It is "false" by default. filter is return +// only metrics specified in the filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' or +// name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and +// timeGrain eq duration'[Hour|Minute|Day]'. func (client AppsClient) ListMetricsSlot(ctx context.Context, resourceGroupName string, name string, slot string, details *bool, filter string) (result ResourceMetricCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListMetricsSlot") + return result, validation.NewError("web.AppsClient", "ListMetricsSlot", err.Error()) } result.fn = client.listMetricsSlotNextResults @@ -16924,15 +16943,15 @@ func (client AppsClient) ListMetricsSlotComplete(ctx context.Context, resourceGr // ListNetworkFeatures gets all network features used by the app (or deployment slot, if specified). // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. view is the -// type of view. This can either be "summary" or "detailed". +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. view is +// the type of view. This can either be "summary" or "detailed". func (client AppsClient) ListNetworkFeatures(ctx context.Context, resourceGroupName string, name string, view string) (result NetworkFeatures, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListNetworkFeatures") + return result, validation.NewError("web.AppsClient", "ListNetworkFeatures", err.Error()) } req, err := client.ListNetworkFeaturesPreparer(ctx, resourceGroupName, name, view) @@ -17000,16 +17019,16 @@ func (client AppsClient) ListNetworkFeaturesResponder(resp *http.Response) (resu // ListNetworkFeaturesSlot gets all network features used by the app (or deployment slot, if specified). // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. view is the -// type of view. This can either be "summary" or "detailed". slot is name of the deployment slot. If a slot is not -// specified, the API will get network features for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. view is +// the type of view. This can either be "summary" or "detailed". slot is name of the deployment slot. If a slot is +// not specified, the API will get network features for the production slot. func (client AppsClient) ListNetworkFeaturesSlot(ctx context.Context, resourceGroupName string, name string, view string, slot string) (result NetworkFeatures, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListNetworkFeaturesSlot") + return result, validation.NewError("web.AppsClient", "ListNetworkFeaturesSlot", err.Error()) } req, err := client.ListNetworkFeaturesSlotPreparer(ctx, resourceGroupName, name, view, slot) @@ -17078,16 +17097,17 @@ func (client AppsClient) ListNetworkFeaturesSlotResponder(resp *http.Response) ( // ListPerfMonCounters gets perfmon counters for web app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. filter is -// return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(startTime eq -// '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. filter +// is return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: +// $filter=(startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq +// duration'[Hour|Minute|Day]'. func (client AppsClient) ListPerfMonCounters(ctx context.Context, resourceGroupName string, name string, filter string) (result PerfMonCounterCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListPerfMonCounters") + return result, validation.NewError("web.AppsClient", "ListPerfMonCounters", err.Error()) } result.fn = client.listPerfMonCountersNextResults @@ -17185,17 +17205,17 @@ func (client AppsClient) ListPerfMonCountersComplete(ctx context.Context, resour // ListPerfMonCountersSlot gets perfmon counters for web app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. slot is name -// of web app slot. If not specified then will default to production slot. filter is return only usages/metrics -// specified in the filter. Filter conforms to odata syntax. Example: $filter=(startTime eq '2014-01-01T00:00:00Z' and -// endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. slot is +// name of web app slot. If not specified then will default to production slot. filter is return only +// usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(startTime eq +// '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. func (client AppsClient) ListPerfMonCountersSlot(ctx context.Context, resourceGroupName string, name string, slot string, filter string) (result PerfMonCounterCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListPerfMonCountersSlot") + return result, validation.NewError("web.AppsClient", "ListPerfMonCountersSlot", err.Error()) } result.fn = client.listPerfMonCountersSlotNextResults @@ -17301,7 +17321,7 @@ func (client AppsClient) ListPremierAddOns(ctx context.Context, resourceGroupNam 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.NewErrorWithValidationError(err, "web.AppsClient", "ListPremierAddOns") + return result, validation.NewError("web.AppsClient", "ListPremierAddOns", err.Error()) } req, err := client.ListPremierAddOnsPreparer(ctx, resourceGroupName, name) @@ -17368,15 +17388,16 @@ func (client AppsClient) ListPremierAddOnsResponder(resp *http.Response) (result // ListPremierAddOnsSlot gets the premier add-ons of an app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API will get the premier add-ons for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API will get the premier add-ons for the production +// slot. func (client AppsClient) ListPremierAddOnsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result PremierAddOn, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListPremierAddOnsSlot") + return result, validation.NewError("web.AppsClient", "ListPremierAddOnsSlot", err.Error()) } req, err := client.ListPremierAddOnsSlotPreparer(ctx, resourceGroupName, name, slot) @@ -17452,7 +17473,7 @@ func (client AppsClient) ListProcesses(ctx context.Context, resourceGroupName st 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.NewErrorWithValidationError(err, "web.AppsClient", "ListProcesses") + return result, validation.NewError("web.AppsClient", "ListProcesses", err.Error()) } result.fn = client.listProcessesNextResults @@ -17548,15 +17569,15 @@ func (client AppsClient) ListProcessesComplete(ctx context.Context, resourceGrou // ListProcessesSlot get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance // in a web site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. slot is name of -// the deployment slot. If a slot is not specified, the API returns deployments for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. slot is name +// of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. func (client AppsClient) ListProcessesSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result ProcessInfoCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListProcessesSlot") + return result, validation.NewError("web.AppsClient", "ListProcessesSlot", err.Error()) } result.fn = client.listProcessesSlotNextResults @@ -17652,14 +17673,15 @@ func (client AppsClient) ListProcessesSlotComplete(ctx context.Context, resource // ListProcessModules list module information for a process by its ID for a specific scaled-out instance in a web site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is pID. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is +// pID. func (client AppsClient) ListProcessModules(ctx context.Context, resourceGroupName string, name string, processID string) (result ProcessModuleInfoCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListProcessModules") + return result, validation.NewError("web.AppsClient", "ListProcessModules", err.Error()) } result.fn = client.listProcessModulesNextResults @@ -17756,16 +17778,16 @@ func (client AppsClient) ListProcessModulesComplete(ctx context.Context, resourc // ListProcessModulesSlot list module information for a process by its ID for a specific scaled-out instance in a web // site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is pID. -// slot is name of the deployment slot. If a slot is not specified, the API returns deployments for the production -// slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is +// pID. slot is name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. func (client AppsClient) ListProcessModulesSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (result ProcessModuleInfoCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListProcessModulesSlot") + return result, validation.NewError("web.AppsClient", "ListProcessModulesSlot", err.Error()) } result.fn = client.listProcessModulesSlotNextResults @@ -17862,14 +17884,15 @@ func (client AppsClient) ListProcessModulesSlotComplete(ctx context.Context, res // ListProcessThreads list the threads in a process by its ID for a specific scaled-out instance in a web site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is pID. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is +// pID. func (client AppsClient) ListProcessThreads(ctx context.Context, resourceGroupName string, name string, processID string) (result ProcessThreadInfoCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListProcessThreads") + return result, validation.NewError("web.AppsClient", "ListProcessThreads", err.Error()) } result.fn = client.listProcessThreadsNextResults @@ -17965,16 +17988,16 @@ func (client AppsClient) ListProcessThreadsComplete(ctx context.Context, resourc // ListProcessThreadsSlot list the threads in a process by its ID for a specific scaled-out instance in a web site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is pID. -// slot is name of the deployment slot. If a slot is not specified, the API returns deployments for the production -// slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. processID is +// pID. slot is name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. func (client AppsClient) ListProcessThreadsSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (result ProcessThreadInfoCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListProcessThreadsSlot") + return result, validation.NewError("web.AppsClient", "ListProcessThreadsSlot", err.Error()) } result.fn = client.listProcessThreadsSlotNextResults @@ -18078,7 +18101,7 @@ func (client AppsClient) ListPublicCertificates(ctx context.Context, resourceGro 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.NewErrorWithValidationError(err, "web.AppsClient", "ListPublicCertificates") + return result, validation.NewError("web.AppsClient", "ListPublicCertificates", err.Error()) } result.fn = client.listPublicCertificatesNextResults @@ -18173,15 +18196,15 @@ func (client AppsClient) ListPublicCertificatesComplete(ctx context.Context, res // ListPublicCertificatesSlot get public certificates for an app or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API gets hostname bindings for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the production slot. func (client AppsClient) ListPublicCertificatesSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result PublicCertificateCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListPublicCertificatesSlot") + return result, validation.NewError("web.AppsClient", "ListPublicCertificatesSlot", err.Error()) } result.fn = client.listPublicCertificatesSlotNextResults @@ -18284,7 +18307,7 @@ func (client AppsClient) ListPublishingCredentials(ctx context.Context, resource 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.NewErrorWithValidationError(err, "web.AppsClient", "ListPublishingCredentials") + return result, validation.NewError("web.AppsClient", "ListPublishingCredentials", err.Error()) } req, err := client.ListPublishingCredentialsPreparer(ctx, resourceGroupName, name) @@ -18353,16 +18376,16 @@ func (client AppsClient) ListPublishingCredentialsResponder(resp *http.Response) // ListPublishingCredentialsSlot gets the Git/FTP publishing credentials of an app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API will get the publishing credentials for the production -// slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API will get the publishing credentials for the +// production slot. func (client AppsClient) ListPublishingCredentialsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result AppsListPublishingCredentialsSlotFuture, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListPublishingCredentialsSlot") + return result, validation.NewError("web.AppsClient", "ListPublishingCredentialsSlot", err.Error()) } req, err := client.ListPublishingCredentialsSlotPreparer(ctx, resourceGroupName, name, slot) @@ -18433,15 +18456,15 @@ func (client AppsClient) ListPublishingCredentialsSlotResponder(resp *http.Respo // ListPublishingProfileXMLWithSecrets gets the publishing profile for an app (or deployment slot, if specified). // // resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. -// publishingProfileOptions is specifies publishingProfileOptions for publishing profile. For example, use {"format": -// "FileZilla3"} to get a FileZilla publishing profile. +// publishingProfileOptions is specifies publishingProfileOptions for publishing profile. For example, use +// {"format": "FileZilla3"} to get a FileZilla publishing profile. func (client AppsClient) ListPublishingProfileXMLWithSecrets(ctx context.Context, resourceGroupName string, name string, publishingProfileOptions CsmPublishingProfileOptions) (result ReadCloser, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListPublishingProfileXMLWithSecrets") + return result, validation.NewError("web.AppsClient", "ListPublishingProfileXMLWithSecrets", err.Error()) } req, err := client.ListPublishingProfileXMLWithSecretsPreparer(ctx, resourceGroupName, name, publishingProfileOptions) @@ -18510,16 +18533,16 @@ func (client AppsClient) ListPublishingProfileXMLWithSecretsResponder(resp *http // ListPublishingProfileXMLWithSecretsSlot gets the publishing profile for an app (or deployment slot, if specified). // // resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. -// publishingProfileOptions is specifies publishingProfileOptions for publishing profile. For example, use {"format": -// "FileZilla3"} to get a FileZilla publishing profile. slot is name of the deployment slot. If a slot is not -// specified, the API will get the publishing profile for the production slot. +// publishingProfileOptions is specifies publishingProfileOptions for publishing profile. For example, use +// {"format": "FileZilla3"} to get a FileZilla publishing profile. slot is name of the deployment slot. If a slot +// is not specified, the API will get the publishing profile for the production slot. func (client AppsClient) ListPublishingProfileXMLWithSecretsSlot(ctx context.Context, resourceGroupName string, name string, publishingProfileOptions CsmPublishingProfileOptions, slot string) (result ReadCloser, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListPublishingProfileXMLWithSecretsSlot") + return result, validation.NewError("web.AppsClient", "ListPublishingProfileXMLWithSecretsSlot", err.Error()) } req, err := client.ListPublishingProfileXMLWithSecretsSlotPreparer(ctx, resourceGroupName, name, publishingProfileOptions, slot) @@ -18595,7 +18618,7 @@ func (client AppsClient) ListRelayServiceConnections(ctx context.Context, resour 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.NewErrorWithValidationError(err, "web.AppsClient", "ListRelayServiceConnections") + return result, validation.NewError("web.AppsClient", "ListRelayServiceConnections", err.Error()) } req, err := client.ListRelayServiceConnectionsPreparer(ctx, resourceGroupName, name) @@ -18662,15 +18685,16 @@ func (client AppsClient) ListRelayServiceConnectionsResponder(resp *http.Respons // ListRelayServiceConnectionsSlot gets hybrid connections configured for an app (or deployment slot, if specified). // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API will get hybrid connections for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API will get hybrid connections for the production +// slot. func (client AppsClient) ListRelayServiceConnectionsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result RelayServiceConnectionEntity, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListRelayServiceConnectionsSlot") + return result, validation.NewError("web.AppsClient", "ListRelayServiceConnectionsSlot", err.Error()) } req, err := client.ListRelayServiceConnectionsSlotPreparer(ctx, resourceGroupName, name, slot) @@ -18745,7 +18769,7 @@ func (client AppsClient) ListSiteExtensions(ctx context.Context, resourceGroupNa 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.NewErrorWithValidationError(err, "web.AppsClient", "ListSiteExtensions") + return result, validation.NewError("web.AppsClient", "ListSiteExtensions", err.Error()) } result.fn = client.listSiteExtensionsNextResults @@ -18840,15 +18864,15 @@ func (client AppsClient) ListSiteExtensionsComplete(ctx context.Context, resourc // ListSiteExtensionsSlot get list of siteextensions for a web site, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. slot is name of -// the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. slot is name +// of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. func (client AppsClient) ListSiteExtensionsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteExtensionInfoCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListSiteExtensionsSlot") + return result, validation.NewError("web.AppsClient", "ListSiteExtensionsSlot", err.Error()) } result.fn = client.listSiteExtensionsSlotNextResults @@ -18951,7 +18975,7 @@ func (client AppsClient) ListSitePushSettings(ctx context.Context, resourceGroup 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.NewErrorWithValidationError(err, "web.AppsClient", "ListSitePushSettings") + return result, validation.NewError("web.AppsClient", "ListSitePushSettings", err.Error()) } req, err := client.ListSitePushSettingsPreparer(ctx, resourceGroupName, name) @@ -19018,15 +19042,15 @@ func (client AppsClient) ListSitePushSettingsResponder(resp *http.Response) (res // ListSitePushSettingsSlot gets the Push settings associated with web app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. slot is name -// of web app slot. If not specified then will default to production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. slot is +// name of web app slot. If not specified then will default to production slot. func (client AppsClient) ListSitePushSettingsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result PushSettings, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListSitePushSettingsSlot") + return result, validation.NewError("web.AppsClient", "ListSitePushSettingsSlot", err.Error()) } req, err := client.ListSitePushSettingsSlotPreparer(ctx, resourceGroupName, name, slot) @@ -19102,7 +19126,7 @@ func (client AppsClient) ListSlotConfigurationNames(ctx context.Context, resourc 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.NewErrorWithValidationError(err, "web.AppsClient", "ListSlotConfigurationNames") + return result, validation.NewError("web.AppsClient", "ListSlotConfigurationNames", err.Error()) } req, err := client.ListSlotConfigurationNamesPreparer(ctx, resourceGroupName, name) @@ -19180,7 +19204,7 @@ func (client AppsClient) ListSlotDifferencesFromProduction(ctx context.Context, {TargetValue: slotSwapEntity, Constraints: []validation.Constraint{{Target: "slotSwapEntity.TargetSlot", Name: validation.Null, Rule: true, Chain: nil}, {Target: "slotSwapEntity.PreserveVnet", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppsClient", "ListSlotDifferencesFromProduction") + return result, validation.NewError("web.AppsClient", "ListSlotDifferencesFromProduction", err.Error()) } result.fn = client.listSlotDifferencesFromProductionNextResults @@ -19278,8 +19302,8 @@ func (client AppsClient) ListSlotDifferencesFromProductionComplete(ctx context.C // ListSlotDifferencesSlot get the difference in configuration settings between two web app slots. // // resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. -// slotSwapEntity is JSON object that contains the target slot name. See example. slot is name of the source slot. If a -// slot is not specified, the production slot is used as the source slot. +// slotSwapEntity is JSON object that contains the target slot name. See example. slot is name of the source slot. +// If a slot is not specified, the production slot is used as the source slot. func (client AppsClient) ListSlotDifferencesSlot(ctx context.Context, resourceGroupName string, name string, slotSwapEntity CsmSlotEntity, slot string) (result SlotDifferenceCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -19289,7 +19313,7 @@ func (client AppsClient) ListSlotDifferencesSlot(ctx context.Context, resourceGr {TargetValue: slotSwapEntity, Constraints: []validation.Constraint{{Target: "slotSwapEntity.TargetSlot", Name: validation.Null, Rule: true, Chain: nil}, {Target: "slotSwapEntity.PreserveVnet", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppsClient", "ListSlotDifferencesSlot") + return result, validation.NewError("web.AppsClient", "ListSlotDifferencesSlot", err.Error()) } result.fn = client.listSlotDifferencesSlotNextResults @@ -19394,7 +19418,7 @@ func (client AppsClient) ListSlots(ctx context.Context, resourceGroupName string 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.NewErrorWithValidationError(err, "web.AppsClient", "ListSlots") + return result, validation.NewError("web.AppsClient", "ListSlots", err.Error()) } result.fn = client.listSlotsNextResults @@ -19496,7 +19520,7 @@ func (client AppsClient) ListSnapshots(ctx context.Context, resourceGroupName st 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.NewErrorWithValidationError(err, "web.AppsClient", "ListSnapshots") + return result, validation.NewError("web.AppsClient", "ListSnapshots", err.Error()) } result.fn = client.listSnapshotsNextResults @@ -19591,15 +19615,15 @@ func (client AppsClient) ListSnapshotsComplete(ctx context.Context, resourceGrou // ListSnapshotsSlot returns all Snapshots to the user. // -// resourceGroupName is name of the resource group to which the resource belongs. name is website Name. slot is website -// Slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is website Name. slot is +// website Slot. func (client AppsClient) ListSnapshotsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SnapshotCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListSnapshotsSlot") + return result, validation.NewError("web.AppsClient", "ListSnapshotsSlot", err.Error()) } result.fn = client.listSnapshotsSlotNextResults @@ -19702,7 +19726,7 @@ func (client AppsClient) ListSyncFunctionTriggers(ctx context.Context, resourceG 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.NewErrorWithValidationError(err, "web.AppsClient", "ListSyncFunctionTriggers") + return result, validation.NewError("web.AppsClient", "ListSyncFunctionTriggers", err.Error()) } req, err := client.ListSyncFunctionTriggersPreparer(ctx, resourceGroupName, name) @@ -19769,15 +19793,15 @@ func (client AppsClient) ListSyncFunctionTriggersResponder(resp *http.Response) // ListSyncFunctionTriggersSlot this is to allow calling via powershell and ARM template. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API will restore a backup of the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API will restore a backup of the production slot. func (client AppsClient) ListSyncFunctionTriggersSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result FunctionSecrets, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListSyncFunctionTriggersSlot") + return result, validation.NewError("web.AppsClient", "ListSyncFunctionTriggersSlot", err.Error()) } req, err := client.ListSyncFunctionTriggersSlotPreparer(ctx, resourceGroupName, name, slot) @@ -19845,15 +19869,15 @@ func (client AppsClient) ListSyncFunctionTriggersSlotResponder(resp *http.Respon // ListTriggeredWebJobHistory list a triggered web job's history for an app, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is name -// of Web Job. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is +// name of Web Job. func (client AppsClient) ListTriggeredWebJobHistory(ctx context.Context, resourceGroupName string, name string, webJobName string) (result TriggeredJobHistoryCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListTriggeredWebJobHistory") + return result, validation.NewError("web.AppsClient", "ListTriggeredWebJobHistory", err.Error()) } result.fn = client.listTriggeredWebJobHistoryNextResults @@ -19949,16 +19973,16 @@ func (client AppsClient) ListTriggeredWebJobHistoryComplete(ctx context.Context, // ListTriggeredWebJobHistorySlot list a triggered web job's history for an app, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is name -// of Web Job. slot is name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is +// name of Web Job. slot is name of the deployment slot. If a slot is not specified, the API deletes a deployment +// for the production slot. func (client AppsClient) ListTriggeredWebJobHistorySlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result TriggeredJobHistoryCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListTriggeredWebJobHistorySlot") + return result, validation.NewError("web.AppsClient", "ListTriggeredWebJobHistorySlot", err.Error()) } result.fn = client.listTriggeredWebJobHistorySlotNextResults @@ -20062,7 +20086,7 @@ func (client AppsClient) ListTriggeredWebJobs(ctx context.Context, resourceGroup 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.NewErrorWithValidationError(err, "web.AppsClient", "ListTriggeredWebJobs") + return result, validation.NewError("web.AppsClient", "ListTriggeredWebJobs", err.Error()) } result.fn = client.listTriggeredWebJobsNextResults @@ -20157,15 +20181,15 @@ func (client AppsClient) ListTriggeredWebJobsComplete(ctx context.Context, resou // ListTriggeredWebJobsSlot list triggered web jobs for an app, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. slot is name of -// the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. slot is name +// of the deployment slot. If a slot is not specified, the API deletes a deployment for the production slot. func (client AppsClient) ListTriggeredWebJobsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result TriggeredWebJobCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListTriggeredWebJobsSlot") + return result, validation.NewError("web.AppsClient", "ListTriggeredWebJobsSlot", err.Error()) } result.fn = client.listTriggeredWebJobsSlotNextResults @@ -20261,17 +20285,17 @@ func (client AppsClient) ListTriggeredWebJobsSlotComplete(ctx context.Context, r // ListUsages gets the quota usage information of an app (or deployment slot, if specified). // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. filter is -// return only information specified in the filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' -// or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and -// timeGrain eq duration'[Hour|Minute|Day]'. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. filter +// is return only information specified in the filter (using OData syntax). For example: $filter=(name.value eq +// 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq +// '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. func (client AppsClient) ListUsages(ctx context.Context, resourceGroupName string, name string, filter string) (result CsmUsageQuotaCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListUsages") + return result, validation.NewError("web.AppsClient", "ListUsages", err.Error()) } result.fn = client.listUsagesNextResults @@ -20369,18 +20393,18 @@ func (client AppsClient) ListUsagesComplete(ctx context.Context, resourceGroupNa // ListUsagesSlot gets the quota usage information of an app (or deployment slot, if specified). // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API will get quota information of the production slot. -// filter is return only information specified in the filter (using OData syntax). For example: $filter=(name.value eq -// 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' -// and timeGrain eq duration'[Hour|Minute|Day]'. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API will get quota information of the production +// slot. filter is return only information specified in the filter (using OData syntax). For example: +// $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime +// eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. func (client AppsClient) ListUsagesSlot(ctx context.Context, resourceGroupName string, name string, slot string, filter string) (result CsmUsageQuotaCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListUsagesSlot") + return result, validation.NewError("web.AppsClient", "ListUsagesSlot", err.Error()) } result.fn = client.listUsagesSlotNextResults @@ -20486,7 +20510,7 @@ func (client AppsClient) ListVnetConnections(ctx context.Context, resourceGroupN 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.NewErrorWithValidationError(err, "web.AppsClient", "ListVnetConnections") + return result, validation.NewError("web.AppsClient", "ListVnetConnections", err.Error()) } req, err := client.ListVnetConnectionsPreparer(ctx, resourceGroupName, name) @@ -20553,16 +20577,16 @@ func (client AppsClient) ListVnetConnectionsResponder(resp *http.Response) (resu // ListVnetConnectionsSlot gets the virtual networks the app (or deployment slot) is connected to. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API will get virtual network connections for the production -// slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API will get virtual network connections for the +// production slot. func (client AppsClient) ListVnetConnectionsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result ListVnetInfo, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListVnetConnectionsSlot") + return result, validation.NewError("web.AppsClient", "ListVnetConnectionsSlot", err.Error()) } req, err := client.ListVnetConnectionsSlotPreparer(ctx, resourceGroupName, name, slot) @@ -20637,7 +20661,7 @@ func (client AppsClient) ListWebJobs(ctx context.Context, resourceGroupName stri 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.NewErrorWithValidationError(err, "web.AppsClient", "ListWebJobs") + return result, validation.NewError("web.AppsClient", "ListWebJobs", err.Error()) } result.fn = client.listWebJobsNextResults @@ -20732,15 +20756,15 @@ func (client AppsClient) ListWebJobsComplete(ctx context.Context, resourceGroupN // ListWebJobsSlot list webjobs for an app, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. slot is name of -// the deployment slot. If a slot is not specified, the API returns deployments for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. slot is name +// of the deployment slot. If a slot is not specified, the API returns deployments for the production slot. func (client AppsClient) ListWebJobsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result JobCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ListWebJobsSlot") + return result, validation.NewError("web.AppsClient", "ListWebJobsSlot", err.Error()) } result.fn = client.listWebJobsSlotNextResults @@ -20847,7 +20871,7 @@ func (client AppsClient) MigrateMySQL(ctx context.Context, resourceGroupName str {TargetValue: migrationRequestEnvelope, Constraints: []validation.Constraint{{Target: "migrationRequestEnvelope.MigrateMySQLRequestProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "migrationRequestEnvelope.MigrateMySQLRequestProperties.ConnectionString", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppsClient", "MigrateMySQL") + return result, validation.NewError("web.AppsClient", "MigrateMySQL", err.Error()) } req, err := client.MigrateMySQLPreparer(ctx, resourceGroupName, name, migrationRequestEnvelope) @@ -20931,7 +20955,7 @@ func (client AppsClient) MigrateStorage(ctx context.Context, subscriptionName st Chain: []validation.Constraint{{Target: "migrationOptions.StorageMigrationOptionsProperties.AzurefilesConnectionString", Name: validation.Null, Rule: true, Chain: nil}, {Target: "migrationOptions.StorageMigrationOptionsProperties.AzurefilesShare", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppsClient", "MigrateStorage") + return result, validation.NewError("web.AppsClient", "MigrateStorage", err.Error()) } req, err := client.MigrateStoragePreparer(ctx, subscriptionName, resourceGroupName, name, migrationOptions) @@ -21015,7 +21039,7 @@ func (client AppsClient) Recover(ctx context.Context, resourceGroupName string, {TargetValue: recoveryEntity, Constraints: []validation.Constraint{{Target: "recoveryEntity.SnapshotRecoveryRequestProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "recoveryEntity.SnapshotRecoveryRequestProperties.Overwrite", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppsClient", "Recover") + return result, validation.NewError("web.AppsClient", "Recover", err.Error()) } req, err := client.RecoverPreparer(ctx, resourceGroupName, name, recoveryEntity) @@ -21085,15 +21109,15 @@ func (client AppsClient) RecoverResponder(resp *http.Response) (result autorest. // RecoverSiteConfigurationSnapshot reverts the configuration of an app to a previous snapshot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. snapshotID -// is the ID of the snapshot to read. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. +// snapshotID is the ID of the snapshot to read. func (client AppsClient) RecoverSiteConfigurationSnapshot(ctx context.Context, resourceGroupName string, name string, snapshotID string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "RecoverSiteConfigurationSnapshot") + return result, validation.NewError("web.AppsClient", "RecoverSiteConfigurationSnapshot", err.Error()) } req, err := client.RecoverSiteConfigurationSnapshotPreparer(ctx, resourceGroupName, name, snapshotID) @@ -21160,16 +21184,16 @@ func (client AppsClient) RecoverSiteConfigurationSnapshotResponder(resp *http.Re // RecoverSiteConfigurationSnapshotSlot reverts the configuration of an app to a previous snapshot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. snapshotID -// is the ID of the snapshot to read. slot is name of the deployment slot. If a slot is not specified, the API will -// return configuration for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. +// snapshotID is the ID of the snapshot to read. slot is name of the deployment slot. If a slot is not specified, +// the API will return configuration for the production slot. func (client AppsClient) RecoverSiteConfigurationSnapshotSlot(ctx context.Context, resourceGroupName string, name string, snapshotID string, slot string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "RecoverSiteConfigurationSnapshotSlot") + return result, validation.NewError("web.AppsClient", "RecoverSiteConfigurationSnapshotSlot", err.Error()) } req, err := client.RecoverSiteConfigurationSnapshotSlotPreparer(ctx, resourceGroupName, name, snapshotID, slot) @@ -21250,7 +21274,7 @@ func (client AppsClient) RecoverSlot(ctx context.Context, resourceGroupName stri {TargetValue: recoveryEntity, Constraints: []validation.Constraint{{Target: "recoveryEntity.SnapshotRecoveryRequestProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "recoveryEntity.SnapshotRecoveryRequestProperties.Overwrite", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppsClient", "RecoverSlot") + return result, validation.NewError("web.AppsClient", "RecoverSlot", err.Error()) } req, err := client.RecoverSlotPreparer(ctx, resourceGroupName, name, recoveryEntity, slot) @@ -21329,7 +21353,7 @@ func (client AppsClient) ResetProductionSlotConfig(ctx context.Context, resource 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.NewErrorWithValidationError(err, "web.AppsClient", "ResetProductionSlotConfig") + return result, validation.NewError("web.AppsClient", "ResetProductionSlotConfig", err.Error()) } req, err := client.ResetProductionSlotConfigPreparer(ctx, resourceGroupName, name) @@ -21396,15 +21420,16 @@ func (client AppsClient) ResetProductionSlotConfigResponder(resp *http.Response) // ResetSlotConfigurationSlot resets the configuration settings of the current slot if they were previously modified by // calling the API with POST. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API resets configuration settings for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API resets configuration settings for the +// production slot. func (client AppsClient) ResetSlotConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "ResetSlotConfigurationSlot") + return result, validation.NewError("web.AppsClient", "ResetSlotConfigurationSlot", err.Error()) } req, err := client.ResetSlotConfigurationSlotPreparer(ctx, resourceGroupName, name, slot) @@ -21471,17 +21496,17 @@ func (client AppsClient) ResetSlotConfigurationSlotResponder(resp *http.Response // Restart restarts an app (or deployment slot, if specified). // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. softRestart -// is specify true to apply the configuration settings and restarts the app only if necessary. By default, the API -// always restarts and reprovisions the app. synchronous is specify true to block until the app is restarted. By -// default, it is set to false, and the API responds immediately (asynchronous). +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. +// softRestart is specify true to apply the configuration settings and restarts the app only if necessary. By +// default, the API always restarts and reprovisions the app. synchronous is specify true to block until the app is +// restarted. By default, it is set to false, and the API responds immediately (asynchronous). func (client AppsClient) Restart(ctx context.Context, resourceGroupName string, name string, softRestart *bool, synchronous *bool) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "Restart") + return result, validation.NewError("web.AppsClient", "Restart", err.Error()) } req, err := client.RestartPreparer(ctx, resourceGroupName, name, softRestart, synchronous) @@ -21553,18 +21578,18 @@ func (client AppsClient) RestartResponder(resp *http.Response) (result autorest. // RestartSlot restarts an app (or deployment slot, if specified). // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API will restart the production slot. softRestart is specify -// true to apply the configuration settings and restarts the app only if necessary. By default, the API always restarts -// and reprovisions the app. synchronous is specify true to block until the app is restarted. By default, it is set to -// false, and the API responds immediately (asynchronous). +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API will restart the production slot. softRestart +// is specify true to apply the configuration settings and restarts the app only if necessary. By default, the API +// always restarts and reprovisions the app. synchronous is specify true to block until the app is restarted. By +// default, it is set to false, and the API responds immediately (asynchronous). func (client AppsClient) RestartSlot(ctx context.Context, resourceGroupName string, name string, slot string, softRestart *bool, synchronous *bool) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "RestartSlot") + return result, validation.NewError("web.AppsClient", "RestartSlot", err.Error()) } req, err := client.RestartSlotPreparer(ctx, resourceGroupName, name, slot, softRestart, synchronous) @@ -21637,8 +21662,8 @@ func (client AppsClient) RestartSlotResponder(resp *http.Response) (result autor // Restore restores a specific backup to another app (or deployment slot, if specified). // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. backupID is -// ID of the backup. request is information on restore request . +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. backupID +// is ID of the backup. request is information on restore request . func (client AppsClient) Restore(ctx context.Context, resourceGroupName string, name string, backupID string, request RestoreRequest) (result AppsRestoreFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -21650,7 +21675,7 @@ func (client AppsClient) Restore(ctx context.Context, resourceGroupName string, Chain: []validation.Constraint{{Target: "request.RestoreRequestProperties.StorageAccountURL", Name: validation.Null, Rule: true, Chain: nil}, {Target: "request.RestoreRequestProperties.Overwrite", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppsClient", "Restore") + return result, validation.NewError("web.AppsClient", "Restore", err.Error()) } req, err := client.RestorePreparer(ctx, resourceGroupName, name, backupID, request) @@ -21722,9 +21747,9 @@ func (client AppsClient) RestoreResponder(resp *http.Response) (result RestoreRe // RestoreSlot restores a specific backup to another app (or deployment slot, if specified). // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. backupID is -// ID of the backup. request is information on restore request . slot is name of the deployment slot. If a slot is not -// specified, the API will restore a backup of the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. backupID +// is ID of the backup. request is information on restore request . slot is name of the deployment slot. If a slot +// is not specified, the API will restore a backup of the production slot. func (client AppsClient) RestoreSlot(ctx context.Context, resourceGroupName string, name string, backupID string, request RestoreRequest, slot string) (result AppsRestoreSlotFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -21736,7 +21761,7 @@ func (client AppsClient) RestoreSlot(ctx context.Context, resourceGroupName stri Chain: []validation.Constraint{{Target: "request.RestoreRequestProperties.StorageAccountURL", Name: validation.Null, Rule: true, Chain: nil}, {Target: "request.RestoreRequestProperties.Overwrite", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppsClient", "RestoreSlot") + return result, validation.NewError("web.AppsClient", "RestoreSlot", err.Error()) } req, err := client.RestoreSlotPreparer(ctx, resourceGroupName, name, backupID, request, slot) @@ -21809,15 +21834,15 @@ func (client AppsClient) RestoreSlotResponder(resp *http.Response) (result Resto // RunTriggeredWebJob run a triggered web job for an app, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is name -// of Web Job. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is +// name of Web Job. func (client AppsClient) RunTriggeredWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "RunTriggeredWebJob") + return result, validation.NewError("web.AppsClient", "RunTriggeredWebJob", err.Error()) } req, err := client.RunTriggeredWebJobPreparer(ctx, resourceGroupName, name, webJobName) @@ -21884,16 +21909,16 @@ func (client AppsClient) RunTriggeredWebJobResponder(resp *http.Response) (resul // RunTriggeredWebJobSlot run a triggered web job for an app, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is name -// of Web Job. slot is name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is +// name of Web Job. slot is name of the deployment slot. If a slot is not specified, the API deletes a deployment +// for the production slot. func (client AppsClient) RunTriggeredWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "RunTriggeredWebJobSlot") + return result, validation.NewError("web.AppsClient", "RunTriggeredWebJobSlot", err.Error()) } req, err := client.RunTriggeredWebJobSlotPreparer(ctx, resourceGroupName, name, webJobName, slot) @@ -21968,7 +21993,7 @@ func (client AppsClient) Start(ctx context.Context, resourceGroupName string, na 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.NewErrorWithValidationError(err, "web.AppsClient", "Start") + return result, validation.NewError("web.AppsClient", "Start", err.Error()) } req, err := client.StartPreparer(ctx, resourceGroupName, name) @@ -22034,15 +22059,15 @@ func (client AppsClient) StartResponder(resp *http.Response) (result autorest.Re // StartContinuousWebJob start a continuous web job for an app, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is name -// of Web Job. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is +// name of Web Job. func (client AppsClient) StartContinuousWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "StartContinuousWebJob") + return result, validation.NewError("web.AppsClient", "StartContinuousWebJob", err.Error()) } req, err := client.StartContinuousWebJobPreparer(ctx, resourceGroupName, name, webJobName) @@ -22109,16 +22134,16 @@ func (client AppsClient) StartContinuousWebJobResponder(resp *http.Response) (re // StartContinuousWebJobSlot start a continuous web job for an app, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is name -// of Web Job. slot is name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is +// name of Web Job. slot is name of the deployment slot. If a slot is not specified, the API deletes a deployment +// for the production slot. func (client AppsClient) StartContinuousWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "StartContinuousWebJobSlot") + return result, validation.NewError("web.AppsClient", "StartContinuousWebJobSlot", err.Error()) } req, err := client.StartContinuousWebJobSlotPreparer(ctx, resourceGroupName, name, webJobName, slot) @@ -22186,15 +22211,15 @@ func (client AppsClient) StartContinuousWebJobSlotResponder(resp *http.Response) // StartSlot starts an app (or deployment slot, if specified). // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API will start the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API will start the production slot. func (client AppsClient) StartSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "StartSlot") + return result, validation.NewError("web.AppsClient", "StartSlot", err.Error()) } req, err := client.StartSlotPreparer(ctx, resourceGroupName, name, slot) @@ -22262,15 +22287,15 @@ func (client AppsClient) StartSlotResponder(resp *http.Response) (result autores // StartWebSiteNetworkTrace start capturing network packets for the site. // // resourceGroupName is name of the resource group to which the resource belongs. name is the name of the web app. -// durationInSeconds is the duration to keep capturing in seconds. maxFrameLength is the maximum frame length in bytes -// (Optional). sasURL is the Blob URL to store capture file. +// durationInSeconds is the duration to keep capturing in seconds. maxFrameLength is the maximum frame length in +// bytes (Optional). sasURL is the Blob URL to store capture file. func (client AppsClient) StartWebSiteNetworkTrace(ctx context.Context, resourceGroupName string, name string, durationInSeconds *int32, maxFrameLength *int32, sasURL string) (result String, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "StartWebSiteNetworkTrace") + return result, validation.NewError("web.AppsClient", "StartWebSiteNetworkTrace", err.Error()) } req, err := client.StartWebSiteNetworkTracePreparer(ctx, resourceGroupName, name, durationInSeconds, maxFrameLength, sasURL) @@ -22346,8 +22371,8 @@ func (client AppsClient) StartWebSiteNetworkTraceResponder(resp *http.Response) // StartWebSiteNetworkTraceSlot start capturing network packets for the site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is the name of the web app. slot -// is the name of the slot for this web app. durationInSeconds is the duration to keep capturing in seconds. +// resourceGroupName is name of the resource group to which the resource belongs. name is the name of the web app. +// slot is the name of the slot for this web app. durationInSeconds is the duration to keep capturing in seconds. // maxFrameLength is the maximum frame length in bytes (Optional). sasURL is the Blob URL to store capture file. func (client AppsClient) StartWebSiteNetworkTraceSlot(ctx context.Context, resourceGroupName string, name string, slot string, durationInSeconds *int32, maxFrameLength *int32, sasURL string) (result String, err error) { if err := validation.Validate([]validation.Validation{ @@ -22355,7 +22380,7 @@ func (client AppsClient) StartWebSiteNetworkTraceSlot(ctx context.Context, resou 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.NewErrorWithValidationError(err, "web.AppsClient", "StartWebSiteNetworkTraceSlot") + return result, validation.NewError("web.AppsClient", "StartWebSiteNetworkTraceSlot", err.Error()) } req, err := client.StartWebSiteNetworkTraceSlotPreparer(ctx, resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasURL) @@ -22439,7 +22464,7 @@ func (client AppsClient) Stop(ctx context.Context, resourceGroupName string, nam 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.NewErrorWithValidationError(err, "web.AppsClient", "Stop") + return result, validation.NewError("web.AppsClient", "Stop", err.Error()) } req, err := client.StopPreparer(ctx, resourceGroupName, name) @@ -22505,15 +22530,15 @@ func (client AppsClient) StopResponder(resp *http.Response) (result autorest.Res // StopContinuousWebJob stop a continuous web job for an app, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is name -// of Web Job. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is +// name of Web Job. func (client AppsClient) StopContinuousWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "StopContinuousWebJob") + return result, validation.NewError("web.AppsClient", "StopContinuousWebJob", err.Error()) } req, err := client.StopContinuousWebJobPreparer(ctx, resourceGroupName, name, webJobName) @@ -22580,16 +22605,16 @@ func (client AppsClient) StopContinuousWebJobResponder(resp *http.Response) (res // StopContinuousWebJobSlot stop a continuous web job for an app, or a deployment slot. // -// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is name -// of Web Job. slot is name of the deployment slot. If a slot is not specified, the API deletes a deployment for the -// production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is site name. webJobName is +// name of Web Job. slot is name of the deployment slot. If a slot is not specified, the API deletes a deployment +// for the production slot. func (client AppsClient) StopContinuousWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "StopContinuousWebJobSlot") + return result, validation.NewError("web.AppsClient", "StopContinuousWebJobSlot", err.Error()) } req, err := client.StopContinuousWebJobSlotPreparer(ctx, resourceGroupName, name, webJobName, slot) @@ -22657,15 +22682,15 @@ func (client AppsClient) StopContinuousWebJobSlotResponder(resp *http.Response) // StopSlot stops an app (or deployment slot, if specified). // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API will stop the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API will stop the production slot. func (client AppsClient) StopSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "StopSlot") + return result, validation.NewError("web.AppsClient", "StopSlot", err.Error()) } req, err := client.StopSlotPreparer(ctx, resourceGroupName, name, slot) @@ -22739,7 +22764,7 @@ func (client AppsClient) StopWebSiteNetworkTrace(ctx context.Context, resourceGr 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.NewErrorWithValidationError(err, "web.AppsClient", "StopWebSiteNetworkTrace") + return result, validation.NewError("web.AppsClient", "StopWebSiteNetworkTrace", err.Error()) } req, err := client.StopWebSiteNetworkTracePreparer(ctx, resourceGroupName, name) @@ -22806,15 +22831,15 @@ func (client AppsClient) StopWebSiteNetworkTraceResponder(resp *http.Response) ( // StopWebSiteNetworkTraceSlot stop ongoing capturing network packets for the site. // -// resourceGroupName is name of the resource group to which the resource belongs. name is the name of the web app. slot -// is the name of the slot for this web app. +// resourceGroupName is name of the resource group to which the resource belongs. name is the name of the web app. +// slot is the name of the slot for this web app. func (client AppsClient) StopWebSiteNetworkTraceSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result String, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "StopWebSiteNetworkTraceSlot") + return result, validation.NewError("web.AppsClient", "StopWebSiteNetworkTraceSlot", err.Error()) } req, err := client.StopWebSiteNetworkTraceSlotPreparer(ctx, resourceGroupName, name, slot) @@ -22883,8 +22908,8 @@ func (client AppsClient) StopWebSiteNetworkTraceSlotResponder(resp *http.Respons // SwapSlotSlot swaps two deployment slots of an app. // // resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. -// slotSwapEntity is JSON object that contains the target slot name. See example. slot is name of the source slot. If a -// slot is not specified, the production slot is used as the source slot. +// slotSwapEntity is JSON object that contains the target slot name. See example. slot is name of the source slot. +// If a slot is not specified, the production slot is used as the source slot. func (client AppsClient) SwapSlotSlot(ctx context.Context, resourceGroupName string, name string, slotSwapEntity CsmSlotEntity, slot string) (result AppsSwapSlotSlotFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -22894,7 +22919,7 @@ func (client AppsClient) SwapSlotSlot(ctx context.Context, resourceGroupName str {TargetValue: slotSwapEntity, Constraints: []validation.Constraint{{Target: "slotSwapEntity.TargetSlot", Name: validation.Null, Rule: true, Chain: nil}, {Target: "slotSwapEntity.PreserveVnet", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppsClient", "SwapSlotSlot") + return result, validation.NewError("web.AppsClient", "SwapSlotSlot", err.Error()) } req, err := client.SwapSlotSlotPreparer(ctx, resourceGroupName, name, slotSwapEntity, slot) @@ -22976,7 +23001,7 @@ func (client AppsClient) SwapSlotWithProduction(ctx context.Context, resourceGro {TargetValue: slotSwapEntity, Constraints: []validation.Constraint{{Target: "slotSwapEntity.TargetSlot", Name: validation.Null, Rule: true, Chain: nil}, {Target: "slotSwapEntity.PreserveVnet", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppsClient", "SwapSlotWithProduction") + return result, validation.NewError("web.AppsClient", "SwapSlotWithProduction", err.Error()) } req, err := client.SwapSlotWithProductionPreparer(ctx, resourceGroupName, name, slotSwapEntity) @@ -23053,7 +23078,7 @@ func (client AppsClient) SyncFunctionTriggers(ctx context.Context, resourceGroup 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.NewErrorWithValidationError(err, "web.AppsClient", "SyncFunctionTriggers") + return result, validation.NewError("web.AppsClient", "SyncFunctionTriggers", err.Error()) } req, err := client.SyncFunctionTriggersPreparer(ctx, resourceGroupName, name) @@ -23119,15 +23144,15 @@ func (client AppsClient) SyncFunctionTriggersResponder(resp *http.Response) (res // SyncFunctionTriggersSlot syncs function trigger metadata to the scale controller // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is name -// of the deployment slot. If a slot is not specified, the API will restore a backup of the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. slot is +// name of the deployment slot. If a slot is not specified, the API will restore a backup of the production slot. func (client AppsClient) SyncFunctionTriggersSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "SyncFunctionTriggersSlot") + return result, validation.NewError("web.AppsClient", "SyncFunctionTriggersSlot", err.Error()) } req, err := client.SyncFunctionTriggersSlotPreparer(ctx, resourceGroupName, name, slot) @@ -23201,7 +23226,7 @@ func (client AppsClient) SyncRepository(ctx context.Context, resourceGroupName s 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.NewErrorWithValidationError(err, "web.AppsClient", "SyncRepository") + return result, validation.NewError("web.AppsClient", "SyncRepository", err.Error()) } req, err := client.SyncRepositoryPreparer(ctx, resourceGroupName, name) @@ -23267,15 +23292,15 @@ func (client AppsClient) SyncRepositoryResponder(resp *http.Response) (result au // SyncRepositorySlot sync web app repository. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. slot is name -// of web app slot. If not specified then will default to production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. slot is +// name of web app slot. If not specified then will default to production slot. func (client AppsClient) SyncRepositorySlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "SyncRepositorySlot") + return result, validation.NewError("web.AppsClient", "SyncRepositorySlot", err.Error()) } req, err := client.SyncRepositorySlotPreparer(ctx, resourceGroupName, name, slot) @@ -23344,18 +23369,18 @@ func (client AppsClient) SyncRepositorySlotResponder(resp *http.Response) (resul // // resourceGroupName is name of the resource group to which the resource belongs. name is unique name of the app to // create or update. To create or update a deployment slot, use the {slot} parameter. siteEnvelope is a JSON -// representation of the app properties. See example. skipDNSRegistration is if true web app hostname is not registered -// with DNS on creation. This parameter is +// representation of the app properties. See example. skipDNSRegistration is if true web app hostname is not +// registered with DNS on creation. This parameter is // only used for app creation. skipCustomDomainVerification is if true, custom (non *.azurewebsites.net) domains -// associated with web app are not verified. forceDNSRegistration is if true, web app hostname is force registered with -// DNS. TTLInSeconds is time to live in seconds for web app's default domain name. +// associated with web app are not verified. forceDNSRegistration is if true, web app hostname is force registered +// with DNS. TTLInSeconds is time to live in seconds for web app's default domain name. func (client AppsClient) Update(ctx context.Context, resourceGroupName string, name string, siteEnvelope SitePatchResource, skipDNSRegistration *bool, skipCustomDomainVerification *bool, forceDNSRegistration *bool, TTLInSeconds string) (result Site, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "Update") + return result, validation.NewError("web.AppsClient", "Update", err.Error()) } req, err := client.UpdatePreparer(ctx, resourceGroupName, name, siteEnvelope, skipDNSRegistration, skipCustomDomainVerification, forceDNSRegistration, TTLInSeconds) @@ -23436,15 +23461,15 @@ func (client AppsClient) UpdateResponder(resp *http.Response) (result Site, err // UpdateApplicationSettings replaces the application settings of an app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. appSettings -// is application settings of the app. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. +// appSettings is application settings of the app. func (client AppsClient) UpdateApplicationSettings(ctx context.Context, resourceGroupName string, name string, appSettings StringDictionary) (result StringDictionary, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "UpdateApplicationSettings") + return result, validation.NewError("web.AppsClient", "UpdateApplicationSettings", err.Error()) } req, err := client.UpdateApplicationSettingsPreparer(ctx, resourceGroupName, name, appSettings) @@ -23513,16 +23538,16 @@ func (client AppsClient) UpdateApplicationSettingsResponder(resp *http.Response) // UpdateApplicationSettingsSlot replaces the application settings of an app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. appSettings -// is application settings of the app. slot is name of the deployment slot. If a slot is not specified, the API will -// update the application settings for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. +// appSettings is application settings of the app. slot is name of the deployment slot. If a slot is not specified, +// the API will update the application settings for the production slot. func (client AppsClient) UpdateApplicationSettingsSlot(ctx context.Context, resourceGroupName string, name string, appSettings StringDictionary, slot string) (result StringDictionary, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "UpdateApplicationSettingsSlot") + return result, validation.NewError("web.AppsClient", "UpdateApplicationSettingsSlot", err.Error()) } req, err := client.UpdateApplicationSettingsSlotPreparer(ctx, resourceGroupName, name, appSettings, slot) @@ -23600,7 +23625,7 @@ func (client AppsClient) UpdateAuthSettings(ctx context.Context, resourceGroupNa 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.NewErrorWithValidationError(err, "web.AppsClient", "UpdateAuthSettings") + return result, validation.NewError("web.AppsClient", "UpdateAuthSettings", err.Error()) } req, err := client.UpdateAuthSettingsPreparer(ctx, resourceGroupName, name, siteAuthSettings) @@ -23670,15 +23695,15 @@ func (client AppsClient) UpdateAuthSettingsResponder(resp *http.Response) (resul // UpdateAuthSettingsSlot updates the Authentication / Authorization settings associated with web app. // // resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. -// siteAuthSettings is auth settings associated with web app. slot is name of web app slot. If not specified then will -// default to production slot. +// siteAuthSettings is auth settings associated with web app. slot is name of web app slot. If not specified then +// will default to production slot. func (client AppsClient) UpdateAuthSettingsSlot(ctx context.Context, resourceGroupName string, name string, siteAuthSettings SiteAuthSettings, slot string) (result SiteAuthSettings, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "UpdateAuthSettingsSlot") + return result, validation.NewError("web.AppsClient", "UpdateAuthSettingsSlot", err.Error()) } req, err := client.UpdateAuthSettingsSlotPreparer(ctx, resourceGroupName, name, siteAuthSettings, slot) @@ -23748,8 +23773,8 @@ func (client AppsClient) UpdateAuthSettingsSlotResponder(resp *http.Response) (r // UpdateBackupConfiguration updates the backup configuration of an app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. request is -// edited backup configuration. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. request +// is edited backup configuration. func (client AppsClient) UpdateBackupConfiguration(ctx context.Context, resourceGroupName string, name string, request BackupRequest) (result BackupRequest, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -23766,7 +23791,7 @@ func (client AppsClient) UpdateBackupConfiguration(ctx context.Context, resource {Target: "request.BackupRequestProperties.BackupSchedule.RetentionPeriodInDays", Name: validation.Null, Rule: true, Chain: nil}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppsClient", "UpdateBackupConfiguration") + return result, validation.NewError("web.AppsClient", "UpdateBackupConfiguration", err.Error()) } req, err := client.UpdateBackupConfigurationPreparer(ctx, resourceGroupName, name, request) @@ -23835,9 +23860,9 @@ func (client AppsClient) UpdateBackupConfigurationResponder(resp *http.Response) // UpdateBackupConfigurationSlot updates the backup configuration of an app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. request is -// edited backup configuration. slot is name of the deployment slot. If a slot is not specified, the API will update -// the backup configuration for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. request +// is edited backup configuration. slot is name of the deployment slot. If a slot is not specified, the API will +// update the backup configuration for the production slot. func (client AppsClient) UpdateBackupConfigurationSlot(ctx context.Context, resourceGroupName string, name string, request BackupRequest, slot string) (result BackupRequest, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -23854,7 +23879,7 @@ func (client AppsClient) UpdateBackupConfigurationSlot(ctx context.Context, reso {Target: "request.BackupRequestProperties.BackupSchedule.RetentionPeriodInDays", Name: validation.Null, Rule: true, Chain: nil}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppsClient", "UpdateBackupConfigurationSlot") + return result, validation.NewError("web.AppsClient", "UpdateBackupConfigurationSlot", err.Error()) } req, err := client.UpdateBackupConfigurationSlotPreparer(ctx, resourceGroupName, name, request, slot) @@ -23924,15 +23949,15 @@ func (client AppsClient) UpdateBackupConfigurationSlotResponder(resp *http.Respo // UpdateConfiguration updates the configuration of an app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. siteConfig -// is JSON representation of a SiteConfig object. See example. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. +// siteConfig is JSON representation of a SiteConfig object. See example. func (client AppsClient) UpdateConfiguration(ctx context.Context, resourceGroupName string, name string, siteConfig SiteConfigResource) (result SiteConfigResource, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "UpdateConfiguration") + return result, validation.NewError("web.AppsClient", "UpdateConfiguration", err.Error()) } req, err := client.UpdateConfigurationPreparer(ctx, resourceGroupName, name, siteConfig) @@ -24001,16 +24026,16 @@ func (client AppsClient) UpdateConfigurationResponder(resp *http.Response) (resu // UpdateConfigurationSlot updates the configuration of an app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. siteConfig -// is JSON representation of a SiteConfig object. See example. slot is name of the deployment slot. If a slot is not -// specified, the API will update configuration for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. +// siteConfig is JSON representation of a SiteConfig object. See example. slot is name of the deployment slot. If a +// slot is not specified, the API will update configuration for the production slot. func (client AppsClient) UpdateConfigurationSlot(ctx context.Context, resourceGroupName string, name string, siteConfig SiteConfigResource, slot string) (result SiteConfigResource, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "UpdateConfigurationSlot") + return result, validation.NewError("web.AppsClient", "UpdateConfigurationSlot", err.Error()) } req, err := client.UpdateConfigurationSlotPreparer(ctx, resourceGroupName, name, siteConfig, slot) @@ -24088,7 +24113,7 @@ func (client AppsClient) UpdateConnectionStrings(ctx context.Context, resourceGr 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.NewErrorWithValidationError(err, "web.AppsClient", "UpdateConnectionStrings") + return result, validation.NewError("web.AppsClient", "UpdateConnectionStrings", err.Error()) } req, err := client.UpdateConnectionStringsPreparer(ctx, resourceGroupName, name, connectionStrings) @@ -24158,15 +24183,16 @@ func (client AppsClient) UpdateConnectionStringsResponder(resp *http.Response) ( // UpdateConnectionStringsSlot replaces the connection strings of an app. // // resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. -// connectionStrings is connection strings of the app or deployment slot. See example. slot is name of the deployment -// slot. If a slot is not specified, the API will update the connection settings for the production slot. +// connectionStrings is connection strings of the app or deployment slot. See example. slot is name of the +// deployment slot. If a slot is not specified, the API will update the connection settings for the production +// slot. func (client AppsClient) UpdateConnectionStringsSlot(ctx context.Context, resourceGroupName string, name string, connectionStrings ConnectionStringDictionary, slot string) (result ConnectionStringDictionary, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "UpdateConnectionStringsSlot") + return result, validation.NewError("web.AppsClient", "UpdateConnectionStringsSlot", err.Error()) } req, err := client.UpdateConnectionStringsSlotPreparer(ctx, resourceGroupName, name, connectionStrings, slot) @@ -24237,8 +24263,8 @@ func (client AppsClient) UpdateConnectionStringsSlotResponder(resp *http.Respons // UpdateDiagnosticLogsConfig updates the logging configuration of an app. // // resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. -// siteLogsConfig is a SiteLogsConfig JSON object that contains the logging configuration to change in the "properties" -// property. +// siteLogsConfig is a SiteLogsConfig JSON object that contains the logging configuration to change in the +// "properties" property. func (client AppsClient) UpdateDiagnosticLogsConfig(ctx context.Context, resourceGroupName string, name string, siteLogsConfig SiteLogsConfig) (result SiteLogsConfig, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -24260,7 +24286,7 @@ func (client AppsClient) UpdateDiagnosticLogsConfig(ctx context.Context, resourc }}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppsClient", "UpdateDiagnosticLogsConfig") + return result, validation.NewError("web.AppsClient", "UpdateDiagnosticLogsConfig", err.Error()) } req, err := client.UpdateDiagnosticLogsConfigPreparer(ctx, resourceGroupName, name, siteLogsConfig) @@ -24330,9 +24356,9 @@ func (client AppsClient) UpdateDiagnosticLogsConfigResponder(resp *http.Response // UpdateDiagnosticLogsConfigSlot updates the logging configuration of an app. // // resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. -// siteLogsConfig is a SiteLogsConfig JSON object that contains the logging configuration to change in the "properties" -// property. slot is name of the deployment slot. If a slot is not specified, the API will update the logging -// configuration for the production slot. +// siteLogsConfig is a SiteLogsConfig JSON object that contains the logging configuration to change in the +// "properties" property. slot is name of the deployment slot. If a slot is not specified, the API will update the +// logging configuration for the production slot. func (client AppsClient) UpdateDiagnosticLogsConfigSlot(ctx context.Context, resourceGroupName string, name string, siteLogsConfig SiteLogsConfig, slot string) (result SiteLogsConfig, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -24354,7 +24380,7 @@ func (client AppsClient) UpdateDiagnosticLogsConfigSlot(ctx context.Context, res }}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppsClient", "UpdateDiagnosticLogsConfigSlot") + return result, validation.NewError("web.AppsClient", "UpdateDiagnosticLogsConfigSlot", err.Error()) } req, err := client.UpdateDiagnosticLogsConfigSlotPreparer(ctx, resourceGroupName, name, siteLogsConfig, slot) @@ -24434,7 +24460,7 @@ func (client AppsClient) UpdateDomainOwnershipIdentifier(ctx context.Context, re 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.NewErrorWithValidationError(err, "web.AppsClient", "UpdateDomainOwnershipIdentifier") + return result, validation.NewError("web.AppsClient", "UpdateDomainOwnershipIdentifier", err.Error()) } req, err := client.UpdateDomainOwnershipIdentifierPreparer(ctx, resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier) @@ -24507,15 +24533,15 @@ func (client AppsClient) UpdateDomainOwnershipIdentifierResponder(resp *http.Res // // resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. // domainOwnershipIdentifierName is name of domain ownership identifier. domainOwnershipIdentifier is a JSON -// representation of the domain ownership properties. slot is name of the deployment slot. If a slot is not specified, -// the API will delete the binding for the production slot. +// representation of the domain ownership properties. slot is name of the deployment slot. If a slot is not +// specified, the API will delete the binding for the production slot. func (client AppsClient) UpdateDomainOwnershipIdentifierSlot(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, domainOwnershipIdentifier Identifier, slot string) (result Identifier, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "UpdateDomainOwnershipIdentifierSlot") + return result, validation.NewError("web.AppsClient", "UpdateDomainOwnershipIdentifierSlot", err.Error()) } req, err := client.UpdateDomainOwnershipIdentifierSlotPreparer(ctx, resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, slot) @@ -24587,15 +24613,15 @@ func (client AppsClient) UpdateDomainOwnershipIdentifierSlotResponder(resp *http // UpdateHybridConnection creates a new Hybrid Connection using a Service Bus relay. // // resourceGroupName is name of the resource group to which the resource belongs. name is the name of the web app. -// namespaceName is the namespace for this hybrid connection. relayName is the relay name for this hybrid connection. -// connectionEnvelope is the details of the hybrid connection. +// namespaceName is the namespace for this hybrid connection. relayName is the relay name for this hybrid +// connection. connectionEnvelope is the details of the hybrid connection. func (client AppsClient) UpdateHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, connectionEnvelope HybridConnection) (result HybridConnection, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "UpdateHybridConnection") + return result, validation.NewError("web.AppsClient", "UpdateHybridConnection", err.Error()) } req, err := client.UpdateHybridConnectionPreparer(ctx, resourceGroupName, name, namespaceName, relayName, connectionEnvelope) @@ -24667,15 +24693,16 @@ func (client AppsClient) UpdateHybridConnectionResponder(resp *http.Response) (r // UpdateHybridConnectionSlot creates a new Hybrid Connection using a Service Bus relay. // // resourceGroupName is name of the resource group to which the resource belongs. name is the name of the web app. -// namespaceName is the namespace for this hybrid connection. relayName is the relay name for this hybrid connection. -// connectionEnvelope is the details of the hybrid connection. slot is the name of the slot for the web app. +// namespaceName is the namespace for this hybrid connection. relayName is the relay name for this hybrid +// connection. connectionEnvelope is the details of the hybrid connection. slot is the name of the slot for the web +// app. func (client AppsClient) UpdateHybridConnectionSlot(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, connectionEnvelope HybridConnection, slot string) (result HybridConnection, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "UpdateHybridConnectionSlot") + return result, validation.NewError("web.AppsClient", "UpdateHybridConnectionSlot", err.Error()) } req, err := client.UpdateHybridConnectionSlotPreparer(ctx, resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot) @@ -24747,15 +24774,15 @@ func (client AppsClient) UpdateHybridConnectionSlotResponder(resp *http.Response // UpdateMetadata replaces the metadata of an app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. metadata is -// edited metadata of the app or deployment slot. See example. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. metadata +// is edited metadata of the app or deployment slot. See example. func (client AppsClient) UpdateMetadata(ctx context.Context, resourceGroupName string, name string, metadata StringDictionary) (result StringDictionary, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "UpdateMetadata") + return result, validation.NewError("web.AppsClient", "UpdateMetadata", err.Error()) } req, err := client.UpdateMetadataPreparer(ctx, resourceGroupName, name, metadata) @@ -24824,16 +24851,16 @@ func (client AppsClient) UpdateMetadataResponder(resp *http.Response) (result St // UpdateMetadataSlot replaces the metadata of an app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. metadata is -// edited metadata of the app or deployment slot. See example. slot is name of the deployment slot. If a slot is not -// specified, the API will update the metadata for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. metadata +// is edited metadata of the app or deployment slot. See example. slot is name of the deployment slot. If a slot is +// not specified, the API will update the metadata for the production slot. func (client AppsClient) UpdateMetadataSlot(ctx context.Context, resourceGroupName string, name string, metadata StringDictionary, slot string) (result StringDictionary, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "UpdateMetadataSlot") + return result, validation.NewError("web.AppsClient", "UpdateMetadataSlot", err.Error()) } req, err := client.UpdateMetadataSlotPreparer(ctx, resourceGroupName, name, metadata, slot) @@ -24904,16 +24931,16 @@ func (client AppsClient) UpdateMetadataSlotResponder(resp *http.Response) (resul // UpdateRelayServiceConnection creates a new hybrid connection configuration (PUT), or updates an existing one // (PATCH). // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. entityName -// is name of the hybrid connection configuration. connectionEnvelope is details of the hybrid connection -// configuration. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. +// entityName is name of the hybrid connection configuration. connectionEnvelope is details of the hybrid +// connection configuration. func (client AppsClient) UpdateRelayServiceConnection(ctx context.Context, resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity) (result RelayServiceConnectionEntity, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "UpdateRelayServiceConnection") + return result, validation.NewError("web.AppsClient", "UpdateRelayServiceConnection", err.Error()) } req, err := client.UpdateRelayServiceConnectionPreparer(ctx, resourceGroupName, name, entityName, connectionEnvelope) @@ -24984,17 +25011,17 @@ func (client AppsClient) UpdateRelayServiceConnectionResponder(resp *http.Respon // UpdateRelayServiceConnectionSlot creates a new hybrid connection configuration (PUT), or updates an existing one // (PATCH). // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. entityName -// is name of the hybrid connection configuration. connectionEnvelope is details of the hybrid connection -// configuration. slot is name of the deployment slot. If a slot is not specified, the API will create or update a -// hybrid connection for the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. +// entityName is name of the hybrid connection configuration. connectionEnvelope is details of the hybrid +// connection configuration. slot is name of the deployment slot. If a slot is not specified, the API will create +// or update a hybrid connection for the production slot. func (client AppsClient) UpdateRelayServiceConnectionSlot(ctx context.Context, resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity, slot string) (result RelayServiceConnectionEntity, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "UpdateRelayServiceConnectionSlot") + return result, validation.NewError("web.AppsClient", "UpdateRelayServiceConnectionSlot", err.Error()) } req, err := client.UpdateRelayServiceConnectionSlotPreparer(ctx, resourceGroupName, name, entityName, connectionEnvelope, slot) @@ -25065,8 +25092,8 @@ func (client AppsClient) UpdateRelayServiceConnectionSlotResponder(resp *http.Re // UpdateSitePushSettings updates the Push settings associated with web app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. pushSettings -// is push settings associated with web app. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. +// pushSettings is push settings associated with web app. func (client AppsClient) UpdateSitePushSettings(ctx context.Context, resourceGroupName string, name string, pushSettings PushSettings) (result PushSettings, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -25076,7 +25103,7 @@ func (client AppsClient) UpdateSitePushSettings(ctx context.Context, resourceGro {TargetValue: pushSettings, Constraints: []validation.Constraint{{Target: "pushSettings.PushSettingsProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "pushSettings.PushSettingsProperties.IsPushEnabled", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppsClient", "UpdateSitePushSettings") + return result, validation.NewError("web.AppsClient", "UpdateSitePushSettings", err.Error()) } req, err := client.UpdateSitePushSettingsPreparer(ctx, resourceGroupName, name, pushSettings) @@ -25145,9 +25172,9 @@ func (client AppsClient) UpdateSitePushSettingsResponder(resp *http.Response) (r // UpdateSitePushSettingsSlot updates the Push settings associated with web app. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. pushSettings -// is push settings associated with web app. slot is name of web app slot. If not specified then will default to -// production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of web app. +// pushSettings is push settings associated with web app. slot is name of web app slot. If not specified then will +// default to production slot. func (client AppsClient) UpdateSitePushSettingsSlot(ctx context.Context, resourceGroupName string, name string, pushSettings PushSettings, slot string) (result PushSettings, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -25157,7 +25184,7 @@ func (client AppsClient) UpdateSitePushSettingsSlot(ctx context.Context, resourc {TargetValue: pushSettings, Constraints: []validation.Constraint{{Target: "pushSettings.PushSettingsProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "pushSettings.PushSettingsProperties.IsPushEnabled", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppsClient", "UpdateSitePushSettingsSlot") + return result, validation.NewError("web.AppsClient", "UpdateSitePushSettingsSlot", err.Error()) } req, err := client.UpdateSitePushSettingsSlotPreparer(ctx, resourceGroupName, name, pushSettings, slot) @@ -25230,18 +25257,18 @@ func (client AppsClient) UpdateSitePushSettingsSlotResponder(resp *http.Response // resourceGroupName is name of the resource group to which the resource belongs. name is unique name of the app to // create or update. To create or update a deployment slot, use the {slot} parameter. siteEnvelope is a JSON // representation of the app properties. See example. slot is name of the deployment slot to create or update. By -// default, this API attempts to create or modify the production slot. skipDNSRegistration is if true web app hostname -// is not registered with DNS on creation. This parameter is +// default, this API attempts to create or modify the production slot. skipDNSRegistration is if true web app +// hostname is not registered with DNS on creation. This parameter is // only used for app creation. skipCustomDomainVerification is if true, custom (non *.azurewebsites.net) domains -// associated with web app are not verified. forceDNSRegistration is if true, web app hostname is force registered with -// DNS. TTLInSeconds is time to live in seconds for web app's default domain name. +// associated with web app are not verified. forceDNSRegistration is if true, web app hostname is force registered +// with DNS. TTLInSeconds is time to live in seconds for web app's default domain name. func (client AppsClient) UpdateSlot(ctx context.Context, resourceGroupName string, name string, siteEnvelope SitePatchResource, slot string, skipDNSRegistration *bool, skipCustomDomainVerification *bool, forceDNSRegistration *bool, TTLInSeconds string) (result Site, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "UpdateSlot") + return result, validation.NewError("web.AppsClient", "UpdateSlot", err.Error()) } req, err := client.UpdateSlotPreparer(ctx, resourceGroupName, name, siteEnvelope, slot, skipDNSRegistration, skipCustomDomainVerification, forceDNSRegistration, TTLInSeconds) @@ -25332,7 +25359,7 @@ func (client AppsClient) UpdateSlotConfigurationNames(ctx context.Context, resou 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.NewErrorWithValidationError(err, "web.AppsClient", "UpdateSlotConfigurationNames") + return result, validation.NewError("web.AppsClient", "UpdateSlotConfigurationNames", err.Error()) } req, err := client.UpdateSlotConfigurationNamesPreparer(ctx, resourceGroupName, name, slotConfigNames) @@ -25409,7 +25436,7 @@ func (client AppsClient) UpdateSourceControl(ctx context.Context, resourceGroupN 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.NewErrorWithValidationError(err, "web.AppsClient", "UpdateSourceControl") + return result, validation.NewError("web.AppsClient", "UpdateSourceControl", err.Error()) } req, err := client.UpdateSourceControlPreparer(ctx, resourceGroupName, name, siteSourceControl) @@ -25479,15 +25506,16 @@ func (client AppsClient) UpdateSourceControlResponder(resp *http.Response) (resu // UpdateSourceControlSlot updates the source control configuration of an app. // // resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. -// siteSourceControl is JSON representation of a SiteSourceControl object. See example. slot is name of the deployment -// slot. If a slot is not specified, the API will update the source control configuration for the production slot. +// siteSourceControl is JSON representation of a SiteSourceControl object. See example. slot is name of the +// deployment slot. If a slot is not specified, the API will update the source control configuration for the +// production slot. func (client AppsClient) UpdateSourceControlSlot(ctx context.Context, resourceGroupName string, name string, siteSourceControl SiteSourceControl, slot string) (result SiteSourceControl, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "UpdateSourceControlSlot") + return result, validation.NewError("web.AppsClient", "UpdateSourceControlSlot", err.Error()) } req, err := client.UpdateSourceControlSlotPreparer(ctx, resourceGroupName, name, siteSourceControl, slot) @@ -25558,8 +25586,8 @@ func (client AppsClient) UpdateSourceControlSlotResponder(resp *http.Response) ( // UpdateVnetConnection adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties // (PATCH). // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. vnetName is -// name of an existing Virtual Network. connectionEnvelope is properties of the Virtual Network connection. See +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. vnetName +// is name of an existing Virtual Network. connectionEnvelope is properties of the Virtual Network connection. See // example. func (client AppsClient) UpdateVnetConnection(ctx context.Context, resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfo) (result VnetInfo, err error) { if err := validation.Validate([]validation.Validation{ @@ -25567,7 +25595,7 @@ func (client AppsClient) UpdateVnetConnection(ctx context.Context, resourceGroup 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.NewErrorWithValidationError(err, "web.AppsClient", "UpdateVnetConnection") + return result, validation.NewError("web.AppsClient", "UpdateVnetConnection", err.Error()) } req, err := client.UpdateVnetConnectionPreparer(ctx, resourceGroupName, name, vnetName, connectionEnvelope) @@ -25637,16 +25665,16 @@ func (client AppsClient) UpdateVnetConnectionResponder(resp *http.Response) (res // UpdateVnetConnectionGateway adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. vnetName is -// name of the Virtual Network. gatewayName is name of the gateway. Currently, the only supported string is "primary". -// connectionEnvelope is the properties to update this gateway with. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. vnetName +// is name of the Virtual Network. gatewayName is name of the gateway. Currently, the only supported string is +// "primary". connectionEnvelope is the properties to update this gateway with. func (client AppsClient) UpdateVnetConnectionGateway(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway) (result VnetGateway, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "UpdateVnetConnectionGateway") + return result, validation.NewError("web.AppsClient", "UpdateVnetConnectionGateway", err.Error()) } req, err := client.UpdateVnetConnectionGatewayPreparer(ctx, resourceGroupName, name, vnetName, gatewayName, connectionEnvelope) @@ -25717,17 +25745,18 @@ func (client AppsClient) UpdateVnetConnectionGatewayResponder(resp *http.Respons // UpdateVnetConnectionGatewaySlot adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. vnetName is -// name of the Virtual Network. gatewayName is name of the gateway. Currently, the only supported string is "primary". -// connectionEnvelope is the properties to update this gateway with. slot is name of the deployment slot. If a slot is -// not specified, the API will add or update a gateway for the production slot's Virtual Network. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. vnetName +// is name of the Virtual Network. gatewayName is name of the gateway. Currently, the only supported string is +// "primary". connectionEnvelope is the properties to update this gateway with. slot is name of the deployment +// slot. If a slot is not specified, the API will add or update a gateway for the production slot's Virtual +// Network. func (client AppsClient) UpdateVnetConnectionGatewaySlot(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway, slot string) (result VnetGateway, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "UpdateVnetConnectionGatewaySlot") + return result, validation.NewError("web.AppsClient", "UpdateVnetConnectionGatewaySlot", err.Error()) } req, err := client.UpdateVnetConnectionGatewaySlotPreparer(ctx, resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, slot) @@ -25800,17 +25829,17 @@ func (client AppsClient) UpdateVnetConnectionGatewaySlotResponder(resp *http.Res // UpdateVnetConnectionSlot adds a Virtual Network connection to an app or slot (PUT) or updates the connection // properties (PATCH). // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. vnetName is -// name of an existing Virtual Network. connectionEnvelope is properties of the Virtual Network connection. See -// example. slot is name of the deployment slot. If a slot is not specified, the API will add or update connections for -// the production slot. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the app. vnetName +// is name of an existing Virtual Network. connectionEnvelope is properties of the Virtual Network connection. See +// example. slot is name of the deployment slot. If a slot is not specified, the API will add or update connections +// for the production slot. func (client AppsClient) UpdateVnetConnectionSlot(ctx context.Context, resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfo, slot string) (result VnetInfo, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppsClient", "UpdateVnetConnectionSlot") + return result, validation.NewError("web.AppsClient", "UpdateVnetConnectionSlot", err.Error()) } req, err := client.UpdateVnetConnectionSlotPreparer(ctx, resourceGroupName, name, vnetName, connectionEnvelope, slot) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/appservicecertificateorders.go b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/appservicecertificateorders.go index d6085a961b5e..4be57dc10802 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/appservicecertificateorders.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/appservicecertificateorders.go @@ -42,8 +42,8 @@ func NewAppServiceCertificateOrdersClientWithBaseURI(baseURI string, subscriptio // CreateOrUpdate create or update a certificate purchase order. // -// resourceGroupName is name of the resource group to which the resource belongs. certificateOrderName is name of the -// certificate order. certificateDistinguishedName is distinguished name to to use for the certificate order. +// resourceGroupName is name of the resource group to which the resource belongs. certificateOrderName is name of +// the certificate order. certificateDistinguishedName is distinguished name to to use for the certificate order. func (client AppServiceCertificateOrdersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, certificateOrderName string, certificateDistinguishedName AppServiceCertificateOrder) (result AppServiceCertificateOrdersCreateOrUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -57,7 +57,7 @@ func (client AppServiceCertificateOrdersClient) CreateOrUpdate(ctx context.Conte {Target: "certificateDistinguishedName.AppServiceCertificateOrderProperties.ValidityInYears", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppServiceCertificateOrdersClient", "CreateOrUpdate") + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, certificateOrderName, certificateDistinguishedName) @@ -128,15 +128,16 @@ func (client AppServiceCertificateOrdersClient) CreateOrUpdateResponder(resp *ht // CreateOrUpdateCertificate creates or updates a certificate and associates with key vault secret. // -// resourceGroupName is name of the resource group to which the resource belongs. certificateOrderName is name of the -// certificate order. name is name of the certificate. keyVaultCertificate is key vault certificate resource Id. +// resourceGroupName is name of the resource group to which the resource belongs. certificateOrderName is name of +// the certificate order. name is name of the certificate. keyVaultCertificate is key vault certificate resource +// Id. func (client AppServiceCertificateOrdersClient) CreateOrUpdateCertificate(ctx context.Context, resourceGroupName string, certificateOrderName string, name string, keyVaultCertificate AppServiceCertificateResource) (result AppServiceCertificateOrdersCreateOrUpdateCertificateFuture, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServiceCertificateOrdersClient", "CreateOrUpdateCertificate") + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "CreateOrUpdateCertificate", err.Error()) } req, err := client.CreateOrUpdateCertificatePreparer(ctx, resourceGroupName, certificateOrderName, name, keyVaultCertificate) @@ -208,15 +209,15 @@ func (client AppServiceCertificateOrdersClient) CreateOrUpdateCertificateRespond // Delete delete an existing certificate order. // -// resourceGroupName is name of the resource group to which the resource belongs. certificateOrderName is name of the -// certificate order. +// resourceGroupName is name of the resource group to which the resource belongs. certificateOrderName is name of +// the certificate order. func (client AppServiceCertificateOrdersClient) Delete(ctx context.Context, resourceGroupName string, certificateOrderName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServiceCertificateOrdersClient", "Delete") + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, certificateOrderName) @@ -282,15 +283,15 @@ func (client AppServiceCertificateOrdersClient) DeleteResponder(resp *http.Respo // DeleteCertificate delete the certificate associated with a certificate order. // -// resourceGroupName is name of the resource group to which the resource belongs. certificateOrderName is name of the -// certificate order. name is name of the certificate. +// resourceGroupName is name of the resource group to which the resource belongs. certificateOrderName is name of +// the certificate order. name is name of the certificate. func (client AppServiceCertificateOrdersClient) DeleteCertificate(ctx context.Context, resourceGroupName string, certificateOrderName string, name string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServiceCertificateOrdersClient", "DeleteCertificate") + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "DeleteCertificate", err.Error()) } req, err := client.DeleteCertificatePreparer(ctx, resourceGroupName, certificateOrderName, name) @@ -357,15 +358,15 @@ func (client AppServiceCertificateOrdersClient) DeleteCertificateResponder(resp // Get get a certificate order. // -// resourceGroupName is name of the resource group to which the resource belongs. certificateOrderName is name of the -// certificate order.. +// resourceGroupName is name of the resource group to which the resource belongs. certificateOrderName is name of +// the certificate order.. func (client AppServiceCertificateOrdersClient) Get(ctx context.Context, resourceGroupName string, certificateOrderName string) (result AppServiceCertificateOrder, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServiceCertificateOrdersClient", "Get") + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, certificateOrderName) @@ -432,15 +433,15 @@ func (client AppServiceCertificateOrdersClient) GetResponder(resp *http.Response // GetCertificate get the certificate associated with a certificate order. // -// resourceGroupName is name of the resource group to which the resource belongs. certificateOrderName is name of the -// certificate order. name is name of the certificate. +// resourceGroupName is name of the resource group to which the resource belongs. certificateOrderName is name of +// the certificate order. name is name of the certificate. func (client AppServiceCertificateOrdersClient) GetCertificate(ctx context.Context, resourceGroupName string, certificateOrderName string, name string) (result AppServiceCertificateResource, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServiceCertificateOrdersClient", "GetCertificate") + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "GetCertificate", err.Error()) } req, err := client.GetCertificatePreparer(ctx, resourceGroupName, certificateOrderName, name) @@ -605,7 +606,7 @@ func (client AppServiceCertificateOrdersClient) ListByResourceGroup(ctx context. 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.NewErrorWithValidationError(err, "web.AppServiceCertificateOrdersClient", "ListByResourceGroup") + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "ListByResourceGroup", err.Error()) } result.fn = client.listByResourceGroupNextResults @@ -699,15 +700,15 @@ func (client AppServiceCertificateOrdersClient) ListByResourceGroupComplete(ctx // ListCertificates list all certificates associated with a certificate order. // -// resourceGroupName is name of the resource group to which the resource belongs. certificateOrderName is name of the -// certificate order. +// resourceGroupName is name of the resource group to which the resource belongs. certificateOrderName is name of +// the certificate order. func (client AppServiceCertificateOrdersClient) ListCertificates(ctx context.Context, resourceGroupName string, certificateOrderName string) (result AppServiceCertificateCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServiceCertificateOrdersClient", "ListCertificates") + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "ListCertificates", err.Error()) } result.fn = client.listCertificatesNextResults @@ -802,15 +803,15 @@ func (client AppServiceCertificateOrdersClient) ListCertificatesComplete(ctx con // Reissue reissue an existing certificate order. // -// resourceGroupName is name of the resource group to which the resource belongs. certificateOrderName is name of the -// certificate order. reissueCertificateOrderRequest is parameters for the reissue. +// resourceGroupName is name of the resource group to which the resource belongs. certificateOrderName is name of +// the certificate order. reissueCertificateOrderRequest is parameters for the reissue. func (client AppServiceCertificateOrdersClient) Reissue(ctx context.Context, resourceGroupName string, certificateOrderName string, reissueCertificateOrderRequest ReissueCertificateOrderRequest) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServiceCertificateOrdersClient", "Reissue") + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "Reissue", err.Error()) } req, err := client.ReissuePreparer(ctx, resourceGroupName, certificateOrderName, reissueCertificateOrderRequest) @@ -878,15 +879,15 @@ func (client AppServiceCertificateOrdersClient) ReissueResponder(resp *http.Resp // Renew renew an existing certificate order. // -// resourceGroupName is name of the resource group to which the resource belongs. certificateOrderName is name of the -// certificate order. renewCertificateOrderRequest is renew parameters +// resourceGroupName is name of the resource group to which the resource belongs. certificateOrderName is name of +// the certificate order. renewCertificateOrderRequest is renew parameters func (client AppServiceCertificateOrdersClient) Renew(ctx context.Context, resourceGroupName string, certificateOrderName string, renewCertificateOrderRequest RenewCertificateOrderRequest) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServiceCertificateOrdersClient", "Renew") + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "Renew", err.Error()) } req, err := client.RenewPreparer(ctx, resourceGroupName, certificateOrderName, renewCertificateOrderRequest) @@ -954,15 +955,15 @@ func (client AppServiceCertificateOrdersClient) RenewResponder(resp *http.Respon // ResendEmail resend certificate email. // -// resourceGroupName is name of the resource group to which the resource belongs. certificateOrderName is name of the -// certificate order. +// resourceGroupName is name of the resource group to which the resource belongs. certificateOrderName is name of +// the certificate order. func (client AppServiceCertificateOrdersClient) ResendEmail(ctx context.Context, resourceGroupName string, certificateOrderName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServiceCertificateOrdersClient", "ResendEmail") + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "ResendEmail", err.Error()) } req, err := client.ResendEmailPreparer(ctx, resourceGroupName, certificateOrderName) @@ -1028,15 +1029,15 @@ func (client AppServiceCertificateOrdersClient) ResendEmailResponder(resp *http. // ResendRequestEmails verify domain ownership for this certificate order. // -// resourceGroupName is name of the resource group to which the resource belongs. certificateOrderName is name of the -// certificate order. nameIdentifier is email address +// resourceGroupName is name of the resource group to which the resource belongs. certificateOrderName is name of +// the certificate order. nameIdentifier is email address func (client AppServiceCertificateOrdersClient) ResendRequestEmails(ctx context.Context, resourceGroupName string, certificateOrderName string, nameIdentifier NameIdentifier) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServiceCertificateOrdersClient", "ResendRequestEmails") + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "ResendRequestEmails", err.Error()) } req, err := client.ResendRequestEmailsPreparer(ctx, resourceGroupName, certificateOrderName, nameIdentifier) @@ -1112,7 +1113,7 @@ func (client AppServiceCertificateOrdersClient) RetrieveCertificateActions(ctx c 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.NewErrorWithValidationError(err, "web.AppServiceCertificateOrdersClient", "RetrieveCertificateActions") + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "RetrieveCertificateActions", err.Error()) } req, err := client.RetrieveCertificateActionsPreparer(ctx, resourceGroupName, name) @@ -1187,7 +1188,7 @@ func (client AppServiceCertificateOrdersClient) RetrieveCertificateEmailHistory( 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.NewErrorWithValidationError(err, "web.AppServiceCertificateOrdersClient", "RetrieveCertificateEmailHistory") + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "RetrieveCertificateEmailHistory", err.Error()) } req, err := client.RetrieveCertificateEmailHistoryPreparer(ctx, resourceGroupName, name) @@ -1254,15 +1255,15 @@ func (client AppServiceCertificateOrdersClient) RetrieveCertificateEmailHistoryR // RetrieveSiteSeal verify domain ownership for this certificate order. // -// resourceGroupName is name of the resource group to which the resource belongs. certificateOrderName is name of the -// certificate order. siteSealRequest is site seal request. +// resourceGroupName is name of the resource group to which the resource belongs. certificateOrderName is name of +// the certificate order. siteSealRequest is site seal request. func (client AppServiceCertificateOrdersClient) RetrieveSiteSeal(ctx context.Context, resourceGroupName string, certificateOrderName string, siteSealRequest SiteSealRequest) (result SiteSeal, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServiceCertificateOrdersClient", "RetrieveSiteSeal") + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "RetrieveSiteSeal", err.Error()) } req, err := client.RetrieveSiteSealPreparer(ctx, resourceGroupName, certificateOrderName, siteSealRequest) @@ -1331,15 +1332,15 @@ func (client AppServiceCertificateOrdersClient) RetrieveSiteSealResponder(resp * // Update create or update a certificate purchase order. // -// resourceGroupName is name of the resource group to which the resource belongs. certificateOrderName is name of the -// certificate order. certificateDistinguishedName is distinguished name to to use for the certificate order. +// resourceGroupName is name of the resource group to which the resource belongs. certificateOrderName is name of +// the certificate order. certificateDistinguishedName is distinguished name to to use for the certificate order. func (client AppServiceCertificateOrdersClient) Update(ctx context.Context, resourceGroupName string, certificateOrderName string, certificateDistinguishedName AppServiceCertificateOrderPatchResource) (result AppServiceCertificateOrder, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServiceCertificateOrdersClient", "Update") + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "Update", err.Error()) } req, err := client.UpdatePreparer(ctx, resourceGroupName, certificateOrderName, certificateDistinguishedName) @@ -1408,15 +1409,16 @@ func (client AppServiceCertificateOrdersClient) UpdateResponder(resp *http.Respo // UpdateCertificate creates or updates a certificate and associates with key vault secret. // -// resourceGroupName is name of the resource group to which the resource belongs. certificateOrderName is name of the -// certificate order. name is name of the certificate. keyVaultCertificate is key vault certificate resource Id. +// resourceGroupName is name of the resource group to which the resource belongs. certificateOrderName is name of +// the certificate order. name is name of the certificate. keyVaultCertificate is key vault certificate resource +// Id. func (client AppServiceCertificateOrdersClient) UpdateCertificate(ctx context.Context, resourceGroupName string, certificateOrderName string, name string, keyVaultCertificate AppServiceCertificatePatchResource) (result AppServiceCertificateResource, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServiceCertificateOrdersClient", "UpdateCertificate") + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "UpdateCertificate", err.Error()) } req, err := client.UpdateCertificatePreparer(ctx, resourceGroupName, certificateOrderName, name, keyVaultCertificate) @@ -1496,7 +1498,7 @@ func (client AppServiceCertificateOrdersClient) ValidatePurchaseInformation(ctx {Target: "appServiceCertificateOrder.AppServiceCertificateOrderProperties.ValidityInYears", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppServiceCertificateOrdersClient", "ValidatePurchaseInformation") + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "ValidatePurchaseInformation", err.Error()) } req, err := client.ValidatePurchaseInformationPreparer(ctx, appServiceCertificateOrder) @@ -1562,15 +1564,15 @@ func (client AppServiceCertificateOrdersClient) ValidatePurchaseInformationRespo // VerifyDomainOwnership verify domain ownership for this certificate order. // -// resourceGroupName is name of the resource group to which the resource belongs. certificateOrderName is name of the -// certificate order. +// resourceGroupName is name of the resource group to which the resource belongs. certificateOrderName is name of +// the certificate order. func (client AppServiceCertificateOrdersClient) VerifyDomainOwnership(ctx context.Context, resourceGroupName string, certificateOrderName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServiceCertificateOrdersClient", "VerifyDomainOwnership") + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "VerifyDomainOwnership", err.Error()) } req, err := client.VerifyDomainOwnershipPreparer(ctx, resourceGroupName, certificateOrderName) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/appserviceenvironments.go b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/appserviceenvironments.go index 269250709cee..fc50c43e83e7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/appserviceenvironments.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/appserviceenvironments.go @@ -57,7 +57,7 @@ func (client AppServiceEnvironmentsClient) CreateOrUpdate(ctx context.Context, r {Target: "hostingEnvironmentEnvelope.AppServiceEnvironment.VirtualNetwork", Name: validation.Null, Rule: true, Chain: nil}, {Target: "hostingEnvironmentEnvelope.AppServiceEnvironment.WorkerPools", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "CreateOrUpdate") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, name, hostingEnvironmentEnvelope) @@ -136,7 +136,7 @@ func (client AppServiceEnvironmentsClient) CreateOrUpdateMultiRolePool(ctx conte 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "CreateOrUpdateMultiRolePool") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "CreateOrUpdateMultiRolePool", err.Error()) } req, err := client.CreateOrUpdateMultiRolePoolPreparer(ctx, resourceGroupName, name, multiRolePoolEnvelope) @@ -215,7 +215,7 @@ func (client AppServiceEnvironmentsClient) CreateOrUpdateWorkerPool(ctx context. 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "CreateOrUpdateWorkerPool") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "CreateOrUpdateWorkerPool", err.Error()) } req, err := client.CreateOrUpdateWorkerPoolPreparer(ctx, resourceGroupName, name, workerPoolName, workerPoolEnvelope) @@ -296,7 +296,7 @@ func (client AppServiceEnvironmentsClient) Delete(ctx context.Context, resourceG 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "Delete") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, name, forceDelete) @@ -375,7 +375,7 @@ func (client AppServiceEnvironmentsClient) Get(ctx context.Context, resourceGrou 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "Get") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, name) @@ -450,7 +450,7 @@ func (client AppServiceEnvironmentsClient) GetDiagnosticsItem(ctx context.Contex 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "GetDiagnosticsItem") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "GetDiagnosticsItem", err.Error()) } req, err := client.GetDiagnosticsItemPreparer(ctx, resourceGroupName, name, diagnosticsName) @@ -526,7 +526,7 @@ func (client AppServiceEnvironmentsClient) GetMultiRolePool(ctx context.Context, 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "GetMultiRolePool") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "GetMultiRolePool", err.Error()) } req, err := client.GetMultiRolePoolPreparer(ctx, resourceGroupName, name) @@ -601,7 +601,7 @@ func (client AppServiceEnvironmentsClient) GetWorkerPool(ctx context.Context, re 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "GetWorkerPool") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "GetWorkerPool", err.Error()) } req, err := client.GetWorkerPoolPreparer(ctx, resourceGroupName, name, workerPoolName) @@ -767,7 +767,7 @@ func (client AppServiceEnvironmentsClient) ListAppServicePlans(ctx context.Conte 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "ListAppServicePlans") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListAppServicePlans", err.Error()) } result.fn = client.listAppServicePlansNextResults @@ -869,7 +869,7 @@ func (client AppServiceEnvironmentsClient) ListByResourceGroup(ctx context.Conte 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "ListByResourceGroup") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListByResourceGroup", err.Error()) } result.fn = client.listByResourceGroupNextResults @@ -971,7 +971,7 @@ func (client AppServiceEnvironmentsClient) ListCapacities(ctx context.Context, r 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "ListCapacities") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListCapacities", err.Error()) } result.fn = client.listCapacitiesNextResults @@ -1074,7 +1074,7 @@ func (client AppServiceEnvironmentsClient) ListDiagnostics(ctx context.Context, 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "ListDiagnostics") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListDiagnostics", err.Error()) } req, err := client.ListDiagnosticsPreparer(ctx, resourceGroupName, name) @@ -1149,7 +1149,7 @@ func (client AppServiceEnvironmentsClient) ListMetricDefinitions(ctx context.Con 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "ListMetricDefinitions") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListMetricDefinitions", err.Error()) } req, err := client.ListMetricDefinitionsPreparer(ctx, resourceGroupName, name) @@ -1217,17 +1217,17 @@ func (client AppServiceEnvironmentsClient) ListMetricDefinitionsResponder(resp * // ListMetrics get global metrics of an App Service Environment. // // resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service -// Environment. details is specify true to include instance details. The default is false. -// filter is return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: -// $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq -// '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. +// Environment. details is specify true to include instance details. The default is +// false. filter is return only usages/metrics specified in the filter. Filter conforms to odata +// syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq +// '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. func (client AppServiceEnvironmentsClient) ListMetrics(ctx context.Context, resourceGroupName string, name string, details *bool, filter string) (result ResourceMetricCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "ListMetrics") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListMetrics", err.Error()) } result.fn = client.listMetricsNextResults @@ -1336,7 +1336,7 @@ func (client AppServiceEnvironmentsClient) ListMultiRoleMetricDefinitions(ctx co 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "ListMultiRoleMetricDefinitions") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListMultiRoleMetricDefinitions", err.Error()) } result.fn = client.listMultiRoleMetricDefinitionsNextResults @@ -1432,10 +1432,10 @@ func (client AppServiceEnvironmentsClient) ListMultiRoleMetricDefinitionsComplet // ListMultiRoleMetrics get metrics for a multi-role pool of an App Service Environment. // // resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service -// Environment. startTime is beginning time of the metrics query. endTime is end time of the metrics query. timeGrain -// is time granularity of the metrics query. details is specify true to include instance details. The -// default is false. filter is return only usages/metrics specified in the filter. Filter conforms to -// odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq +// Environment. startTime is beginning time of the metrics query. endTime is end time of the metrics query. +// timeGrain is time granularity of the metrics query. details is specify true to include instance +// details. The default is false. filter is return only usages/metrics specified in the filter. Filter +// conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq // '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. func (client AppServiceEnvironmentsClient) ListMultiRoleMetrics(ctx context.Context, resourceGroupName string, name string, startTime string, endTime string, timeGrain string, details *bool, filter string) (result ResourceMetricCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ @@ -1443,7 +1443,7 @@ func (client AppServiceEnvironmentsClient) ListMultiRoleMetrics(ctx context.Cont 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "ListMultiRoleMetrics") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListMultiRoleMetrics", err.Error()) } result.fn = client.listMultiRoleMetricsNextResults @@ -1562,7 +1562,7 @@ func (client AppServiceEnvironmentsClient) ListMultiRolePoolInstanceMetricDefini 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePoolInstanceMetricDefinitions") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListMultiRolePoolInstanceMetricDefinitions", err.Error()) } result.fn = client.listMultiRolePoolInstanceMetricDefinitionsNextResults @@ -1668,7 +1668,7 @@ func (client AppServiceEnvironmentsClient) ListMultiRolePoolInstanceMetrics(ctx 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePoolInstanceMetrics") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListMultiRolePoolInstanceMetrics", err.Error()) } result.fn = client.listMultiRolePoolInstanceMetricsNextResults @@ -1775,7 +1775,7 @@ func (client AppServiceEnvironmentsClient) ListMultiRolePools(ctx context.Contex 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePools") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListMultiRolePools", err.Error()) } result.fn = client.listMultiRolePoolsNextResults @@ -1878,7 +1878,7 @@ func (client AppServiceEnvironmentsClient) ListMultiRolePoolSkus(ctx context.Con 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePoolSkus") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListMultiRolePoolSkus", err.Error()) } result.fn = client.listMultiRolePoolSkusNextResults @@ -1981,7 +1981,7 @@ func (client AppServiceEnvironmentsClient) ListMultiRoleUsages(ctx context.Conte 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "ListMultiRoleUsages") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListMultiRoleUsages", err.Error()) } result.fn = client.listMultiRoleUsagesNextResults @@ -2084,7 +2084,7 @@ func (client AppServiceEnvironmentsClient) ListOperations(ctx context.Context, r 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "ListOperations") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListOperations", err.Error()) } req, err := client.ListOperationsPreparer(ctx, resourceGroupName, name) @@ -2152,16 +2152,16 @@ func (client AppServiceEnvironmentsClient) ListOperationsResponder(resp *http.Re // ListUsages get global usage metrics of an App Service Environment. // // resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service -// Environment. filter is return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: -// $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq -// '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. +// Environment. filter is return only usages/metrics specified in the filter. Filter conforms to odata syntax. +// Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' +// and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. func (client AppServiceEnvironmentsClient) ListUsages(ctx context.Context, resourceGroupName string, name string, filter string) (result CsmUsageQuotaCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "ListUsages") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListUsages", err.Error()) } result.fn = client.listUsagesNextResults @@ -2267,7 +2267,7 @@ func (client AppServiceEnvironmentsClient) ListVips(ctx context.Context, resourc 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "ListVips") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListVips", err.Error()) } req, err := client.ListVipsPreparer(ctx, resourceGroupName, name) @@ -2342,7 +2342,7 @@ func (client AppServiceEnvironmentsClient) ListWebApps(ctx context.Context, reso 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "ListWebApps") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListWebApps", err.Error()) } result.fn = client.listWebAppsNextResults @@ -2448,7 +2448,7 @@ func (client AppServiceEnvironmentsClient) ListWebWorkerMetricDefinitions(ctx co 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "ListWebWorkerMetricDefinitions") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListWebWorkerMetricDefinitions", err.Error()) } result.fn = client.listWebWorkerMetricDefinitionsNextResults @@ -2545,9 +2545,9 @@ func (client AppServiceEnvironmentsClient) ListWebWorkerMetricDefinitionsComplet // ListWebWorkerMetrics get metrics for a worker pool of a AppServiceEnvironment (App Service Environment). // // resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service -// Environment. workerPoolName is name of worker pool details is specify true to include instance details. -// The default is false. filter is return only usages/metrics specified in the filter. Filter conforms to -// odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq +// Environment. workerPoolName is name of worker pool details is specify true to include instance +// details. The default is false. filter is return only usages/metrics specified in the filter. Filter +// conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq // '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. func (client AppServiceEnvironmentsClient) ListWebWorkerMetrics(ctx context.Context, resourceGroupName string, name string, workerPoolName string, details *bool, filter string) (result ResourceMetricCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ @@ -2555,7 +2555,7 @@ func (client AppServiceEnvironmentsClient) ListWebWorkerMetrics(ctx context.Cont 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "ListWebWorkerMetrics") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListWebWorkerMetrics", err.Error()) } result.fn = client.listWebWorkerMetricsNextResults @@ -2665,7 +2665,7 @@ func (client AppServiceEnvironmentsClient) ListWebWorkerUsages(ctx context.Conte 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "ListWebWorkerUsages") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListWebWorkerUsages", err.Error()) } result.fn = client.listWebWorkerUsagesNextResults @@ -2770,7 +2770,7 @@ func (client AppServiceEnvironmentsClient) ListWorkerPoolInstanceMetricDefinitio 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "ListWorkerPoolInstanceMetricDefinitions") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListWorkerPoolInstanceMetricDefinitions", err.Error()) } result.fn = client.listWorkerPoolInstanceMetricDefinitionsNextResults @@ -2868,18 +2868,18 @@ func (client AppServiceEnvironmentsClient) ListWorkerPoolInstanceMetricDefinitio // ListWorkerPoolInstanceMetrics get metrics for a specific instance of a worker pool of an App Service Environment. // // resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service -// Environment. workerPoolName is name of the worker pool. instance is name of the instance in the worker pool. details -// is specify true to include instance details. The default is false. filter is return only -// usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' -// or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and -// timeGrain eq duration'[Hour|Minute|Day]'. +// Environment. workerPoolName is name of the worker pool. instance is name of the instance in the worker pool. +// details is specify true to include instance details. The default is false. filter is +// return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: +// $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime +// eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. func (client AppServiceEnvironmentsClient) ListWorkerPoolInstanceMetrics(ctx context.Context, resourceGroupName string, name string, workerPoolName string, instance string, details *bool, filter string) (result ResourceMetricCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "ListWorkerPoolInstanceMetrics") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListWorkerPoolInstanceMetrics", err.Error()) } result.fn = client.listWorkerPoolInstanceMetricsNextResults @@ -2990,7 +2990,7 @@ func (client AppServiceEnvironmentsClient) ListWorkerPools(ctx context.Context, 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "ListWorkerPools") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListWorkerPools", err.Error()) } result.fn = client.listWorkerPoolsNextResults @@ -3093,7 +3093,7 @@ func (client AppServiceEnvironmentsClient) ListWorkerPoolSkus(ctx context.Contex 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "ListWorkerPoolSkus") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListWorkerPoolSkus", err.Error()) } result.fn = client.listWorkerPoolSkusNextResults @@ -3197,7 +3197,7 @@ func (client AppServiceEnvironmentsClient) Reboot(ctx context.Context, resourceG 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "Reboot") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "Reboot", err.Error()) } req, err := client.RebootPreparer(ctx, resourceGroupName, name) @@ -3271,7 +3271,7 @@ func (client AppServiceEnvironmentsClient) Resume(ctx context.Context, resourceG 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "Resume") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "Resume", err.Error()) } req, err := client.ResumePreparer(ctx, resourceGroupName, name) @@ -3381,7 +3381,7 @@ func (client AppServiceEnvironmentsClient) Suspend(ctx context.Context, resource 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "Suspend") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "Suspend", err.Error()) } req, err := client.SuspendPreparer(ctx, resourceGroupName, name) @@ -3491,7 +3491,7 @@ func (client AppServiceEnvironmentsClient) Update(ctx context.Context, resourceG 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "Update") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "Update", err.Error()) } req, err := client.UpdatePreparer(ctx, resourceGroupName, name, hostingEnvironmentEnvelope) @@ -3568,7 +3568,7 @@ func (client AppServiceEnvironmentsClient) UpdateMultiRolePool(ctx context.Conte 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "UpdateMultiRolePool") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "UpdateMultiRolePool", err.Error()) } req, err := client.UpdateMultiRolePoolPreparer(ctx, resourceGroupName, name, multiRolePoolEnvelope) @@ -3645,7 +3645,7 @@ func (client AppServiceEnvironmentsClient) UpdateWorkerPool(ctx context.Context, 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.NewErrorWithValidationError(err, "web.AppServiceEnvironmentsClient", "UpdateWorkerPool") + return result, validation.NewError("web.AppServiceEnvironmentsClient", "UpdateWorkerPool", err.Error()) } req, err := client.UpdateWorkerPoolPreparer(ctx, resourceGroupName, name, workerPoolName, workerPoolEnvelope) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/appserviceplans.go b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/appserviceplans.go index 89fed6053f2e..50901f898d78 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/appserviceplans.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/appserviceplans.go @@ -42,8 +42,8 @@ func NewAppServicePlansClientWithBaseURI(baseURI string, subscriptionID string) // CreateOrUpdate creates or updates an App Service Plan. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service plan. -// appServicePlan is details of the App Service plan. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service +// plan. appServicePlan is details of the App Service plan. func (client AppServicePlansClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, name string, appServicePlan AppServicePlan) (result AppServicePlansCreateOrUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -53,7 +53,7 @@ func (client AppServicePlansClient) CreateOrUpdate(ctx context.Context, resource {TargetValue: appServicePlan, Constraints: []validation.Constraint{{Target: "appServicePlan.AppServicePlanProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "appServicePlan.AppServicePlanProperties.Name", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppServicePlansClient", "CreateOrUpdate") + return result, validation.NewError("web.AppServicePlansClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, name, appServicePlan) @@ -124,16 +124,16 @@ func (client AppServicePlansClient) CreateOrUpdateResponder(resp *http.Response) // CreateOrUpdateVnetRoute create or update a Virtual Network route in an App Service plan. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service plan. -// vnetName is name of the Virtual Network. routeName is name of the Virtual Network route. route is definition of the -// Virtual Network route. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service +// plan. vnetName is name of the Virtual Network. routeName is name of the Virtual Network route. route is +// definition of the Virtual Network route. func (client AppServicePlansClient) CreateOrUpdateVnetRoute(ctx context.Context, resourceGroupName string, name string, vnetName string, routeName string, route VnetRoute) (result VnetRoute, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServicePlansClient", "CreateOrUpdateVnetRoute") + return result, validation.NewError("web.AppServicePlansClient", "CreateOrUpdateVnetRoute", err.Error()) } req, err := client.CreateOrUpdateVnetRoutePreparer(ctx, resourceGroupName, name, vnetName, routeName, route) @@ -204,14 +204,15 @@ func (client AppServicePlansClient) CreateOrUpdateVnetRouteResponder(resp *http. // Delete delete an App Service plan. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service plan. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service +// plan. func (client AppServicePlansClient) Delete(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServicePlansClient", "Delete") + return result, validation.NewError("web.AppServicePlansClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, name) @@ -277,15 +278,15 @@ func (client AppServicePlansClient) DeleteResponder(resp *http.Response) (result // DeleteHybridConnection delete a Hybrid Connection in use in an App Service plan. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service plan. -// namespaceName is name of the Service Bus namespace. relayName is name of the Service Bus relay. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service +// plan. namespaceName is name of the Service Bus namespace. relayName is name of the Service Bus relay. func (client AppServicePlansClient) DeleteHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServicePlansClient", "DeleteHybridConnection") + return result, validation.NewError("web.AppServicePlansClient", "DeleteHybridConnection", err.Error()) } req, err := client.DeleteHybridConnectionPreparer(ctx, resourceGroupName, name, namespaceName, relayName) @@ -353,15 +354,15 @@ func (client AppServicePlansClient) DeleteHybridConnectionResponder(resp *http.R // DeleteVnetRoute delete a Virtual Network route in an App Service plan. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service plan. -// vnetName is name of the Virtual Network. routeName is name of the Virtual Network route. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service +// plan. vnetName is name of the Virtual Network. routeName is name of the Virtual Network route. func (client AppServicePlansClient) DeleteVnetRoute(ctx context.Context, resourceGroupName string, name string, vnetName string, routeName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServicePlansClient", "DeleteVnetRoute") + return result, validation.NewError("web.AppServicePlansClient", "DeleteVnetRoute", err.Error()) } req, err := client.DeleteVnetRoutePreparer(ctx, resourceGroupName, name, vnetName, routeName) @@ -429,14 +430,15 @@ func (client AppServicePlansClient) DeleteVnetRouteResponder(resp *http.Response // Get get an App Service plan. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service plan. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service +// plan. func (client AppServicePlansClient) Get(ctx context.Context, resourceGroupName string, name string) (result AppServicePlan, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServicePlansClient", "Get") + return result, validation.NewError("web.AppServicePlansClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, name) @@ -503,15 +505,15 @@ func (client AppServicePlansClient) GetResponder(resp *http.Response) (result Ap // GetHybridConnection retrieve a Hybrid Connection in use in an App Service plan. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service plan. -// namespaceName is name of the Service Bus namespace. relayName is name of the Service Bus relay. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service +// plan. namespaceName is name of the Service Bus namespace. relayName is name of the Service Bus relay. func (client AppServicePlansClient) GetHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (result HybridConnection, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServicePlansClient", "GetHybridConnection") + return result, validation.NewError("web.AppServicePlansClient", "GetHybridConnection", err.Error()) } req, err := client.GetHybridConnectionPreparer(ctx, resourceGroupName, name, namespaceName, relayName) @@ -580,14 +582,15 @@ func (client AppServicePlansClient) GetHybridConnectionResponder(resp *http.Resp // GetHybridConnectionPlanLimit get the maximum number of Hybrid Connections allowed in an App Service plan. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service plan. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service +// plan. func (client AppServicePlansClient) GetHybridConnectionPlanLimit(ctx context.Context, resourceGroupName string, name string) (result HybridConnectionLimits, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServicePlansClient", "GetHybridConnectionPlanLimit") + return result, validation.NewError("web.AppServicePlansClient", "GetHybridConnectionPlanLimit", err.Error()) } req, err := client.GetHybridConnectionPlanLimitPreparer(ctx, resourceGroupName, name) @@ -654,15 +657,15 @@ func (client AppServicePlansClient) GetHybridConnectionPlanLimitResponder(resp * // GetRouteForVnet get a Virtual Network route in an App Service plan. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service plan. -// vnetName is name of the Virtual Network. routeName is name of the Virtual Network route. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service +// plan. vnetName is name of the Virtual Network. routeName is name of the Virtual Network route. func (client AppServicePlansClient) GetRouteForVnet(ctx context.Context, resourceGroupName string, name string, vnetName string, routeName string) (result ListVnetRoute, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServicePlansClient", "GetRouteForVnet") + return result, validation.NewError("web.AppServicePlansClient", "GetRouteForVnet", err.Error()) } req, err := client.GetRouteForVnetPreparer(ctx, resourceGroupName, name, vnetName, routeName) @@ -738,7 +741,7 @@ func (client AppServicePlansClient) GetServerFarmSkus(ctx context.Context, resou 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.NewErrorWithValidationError(err, "web.AppServicePlansClient", "GetServerFarmSkus") + return result, validation.NewError("web.AppServicePlansClient", "GetServerFarmSkus", err.Error()) } req, err := client.GetServerFarmSkusPreparer(ctx, resourceGroupName, name) @@ -805,15 +808,15 @@ func (client AppServicePlansClient) GetServerFarmSkusResponder(resp *http.Respon // GetVnetFromServerFarm get a Virtual Network associated with an App Service plan. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service plan. -// vnetName is name of the Virtual Network. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service +// plan. vnetName is name of the Virtual Network. func (client AppServicePlansClient) GetVnetFromServerFarm(ctx context.Context, resourceGroupName string, name string, vnetName string) (result VnetInfo, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServicePlansClient", "GetVnetFromServerFarm") + return result, validation.NewError("web.AppServicePlansClient", "GetVnetFromServerFarm", err.Error()) } req, err := client.GetVnetFromServerFarmPreparer(ctx, resourceGroupName, name, vnetName) @@ -881,8 +884,8 @@ func (client AppServicePlansClient) GetVnetFromServerFarmResponder(resp *http.Re // GetVnetGateway get a Virtual Network gateway. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service plan. -// vnetName is name of the Virtual Network. gatewayName is name of the gateway. Only the 'primary' gateway is +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service +// plan. vnetName is name of the Virtual Network. gatewayName is name of the gateway. Only the 'primary' gateway is // supported. func (client AppServicePlansClient) GetVnetGateway(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string) (result VnetGateway, err error) { if err := validation.Validate([]validation.Validation{ @@ -890,7 +893,7 @@ func (client AppServicePlansClient) GetVnetGateway(ctx context.Context, resource 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.NewErrorWithValidationError(err, "web.AppServicePlansClient", "GetVnetGateway") + return result, validation.NewError("web.AppServicePlansClient", "GetVnetGateway", err.Error()) } req, err := client.GetVnetGatewayPreparer(ctx, resourceGroupName, name, vnetName, gatewayName) @@ -959,8 +962,8 @@ func (client AppServicePlansClient) GetVnetGatewayResponder(resp *http.Response) // List get all App Service plans for a subcription. // -// detailed is specify true to return all App Service plan properties. The default is false, -// which returns a subset of the properties. +// detailed is specify true to return all App Service plan properties. The default is +// false, which returns a subset of the properties. // Retrieval of all properties may increase the API latency. func (client AppServicePlansClient) List(ctx context.Context, detailed *bool) (result AppServicePlanCollectionPage, err error) { result.fn = client.listNextResults @@ -1063,7 +1066,7 @@ func (client AppServicePlansClient) ListByResourceGroup(ctx context.Context, res 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.NewErrorWithValidationError(err, "web.AppServicePlansClient", "ListByResourceGroup") + return result, validation.NewError("web.AppServicePlansClient", "ListByResourceGroup", err.Error()) } result.fn = client.listByResourceGroupNextResults @@ -1157,14 +1160,15 @@ func (client AppServicePlansClient) ListByResourceGroupComplete(ctx context.Cont // ListCapabilities list all capabilities of an App Service plan. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service plan. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service +// plan. func (client AppServicePlansClient) ListCapabilities(ctx context.Context, resourceGroupName string, name string) (result ListCapability, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServicePlansClient", "ListCapabilities") + return result, validation.NewError("web.AppServicePlansClient", "ListCapabilities", err.Error()) } req, err := client.ListCapabilitiesPreparer(ctx, resourceGroupName, name) @@ -1231,15 +1235,15 @@ func (client AppServicePlansClient) ListCapabilitiesResponder(resp *http.Respons // ListHybridConnectionKeys get the send key name and value of a Hybrid Connection. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service plan. -// namespaceName is the name of the Service Bus namespace. relayName is the name of the Service Bus relay. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service +// plan. namespaceName is the name of the Service Bus namespace. relayName is the name of the Service Bus relay. func (client AppServicePlansClient) ListHybridConnectionKeys(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (result HybridConnectionKey, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServicePlansClient", "ListHybridConnectionKeys") + return result, validation.NewError("web.AppServicePlansClient", "ListHybridConnectionKeys", err.Error()) } req, err := client.ListHybridConnectionKeysPreparer(ctx, resourceGroupName, name, namespaceName, relayName) @@ -1308,14 +1312,15 @@ func (client AppServicePlansClient) ListHybridConnectionKeysResponder(resp *http // ListHybridConnections retrieve all Hybrid Connections in use in an App Service plan. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service plan. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service +// plan. func (client AppServicePlansClient) ListHybridConnections(ctx context.Context, resourceGroupName string, name string) (result HybridConnectionCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServicePlansClient", "ListHybridConnections") + return result, validation.NewError("web.AppServicePlansClient", "ListHybridConnections", err.Error()) } result.fn = client.listHybridConnectionsNextResults @@ -1410,14 +1415,15 @@ func (client AppServicePlansClient) ListHybridConnectionsComplete(ctx context.Co // ListMetricDefintions get metrics that can be queried for an App Service plan, and their definitions. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service plan. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service +// plan. func (client AppServicePlansClient) ListMetricDefintions(ctx context.Context, resourceGroupName string, name string) (result ResourceMetricDefinitionCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServicePlansClient", "ListMetricDefintions") + return result, validation.NewError("web.AppServicePlansClient", "ListMetricDefintions", err.Error()) } result.fn = client.listMetricDefintionsNextResults @@ -1512,18 +1518,18 @@ func (client AppServicePlansClient) ListMetricDefintionsComplete(ctx context.Con // ListMetrics get metrics for an App Serice plan. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service plan. -// details is specify true to include instance details. The default is false. filter is -// return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq -// 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' -// and timeGrain eq duration'[Hour|Minute|Day]'. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service +// plan. details is specify true to include instance details. The default is false. +// filter is return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: +// $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime +// eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. func (client AppServicePlansClient) ListMetrics(ctx context.Context, resourceGroupName string, name string, details *bool, filter string) (result ResourceMetricCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServicePlansClient", "ListMetrics") + return result, validation.NewError("web.AppServicePlansClient", "ListMetrics", err.Error()) } result.fn = client.listMetricsNextResults @@ -1624,15 +1630,15 @@ func (client AppServicePlansClient) ListMetricsComplete(ctx context.Context, res // ListRoutesForVnet get all routes that are associated with a Virtual Network in an App Service plan. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service plan. -// vnetName is name of the Virtual Network. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service +// plan. vnetName is name of the Virtual Network. func (client AppServicePlansClient) ListRoutesForVnet(ctx context.Context, resourceGroupName string, name string, vnetName string) (result ListVnetRoute, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServicePlansClient", "ListRoutesForVnet") + return result, validation.NewError("web.AppServicePlansClient", "ListRoutesForVnet", err.Error()) } req, err := client.ListRoutesForVnetPreparer(ctx, resourceGroupName, name, vnetName) @@ -1709,7 +1715,7 @@ func (client AppServicePlansClient) ListUsages(ctx context.Context, resourceGrou 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.NewErrorWithValidationError(err, "web.AppServicePlansClient", "ListUsages") + return result, validation.NewError("web.AppServicePlansClient", "ListUsages", err.Error()) } result.fn = client.listUsagesNextResults @@ -1807,14 +1813,15 @@ func (client AppServicePlansClient) ListUsagesComplete(ctx context.Context, reso // ListVnets get all Virtual Networks associated with an App Service plan. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service plan. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service +// plan. func (client AppServicePlansClient) ListVnets(ctx context.Context, resourceGroupName string, name string) (result ListVnetInfo, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServicePlansClient", "ListVnets") + return result, validation.NewError("web.AppServicePlansClient", "ListVnets", err.Error()) } req, err := client.ListVnetsPreparer(ctx, resourceGroupName, name) @@ -1881,18 +1888,18 @@ func (client AppServicePlansClient) ListVnetsResponder(resp *http.Response) (res // ListWebApps get all apps associated with an App Service plan. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service plan. -// skipToken is skip to a web app in the list of webapps associated with app service plan. If specified, the resulting -// list will contain web apps starting from (including) the skipToken. Otherwise, the resulting list contains web apps -// from the start of the list filter is supported filter: $filter=state eq running. Returns only web apps that are -// currently running top is list page size. If specified, results are paged. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service +// plan. skipToken is skip to a web app in the list of webapps associated with app service plan. If specified, the +// resulting list will contain web apps starting from (including) the skipToken. Otherwise, the resulting list +// contains web apps from the start of the list filter is supported filter: $filter=state eq running. Returns only +// web apps that are currently running top is list page size. If specified, results are paged. func (client AppServicePlansClient) ListWebApps(ctx context.Context, resourceGroupName string, name string, skipToken string, filter string, top string) (result AppCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServicePlansClient", "ListWebApps") + return result, validation.NewError("web.AppServicePlansClient", "ListWebApps", err.Error()) } result.fn = client.listWebAppsNextResults @@ -1996,15 +2003,16 @@ func (client AppServicePlansClient) ListWebAppsComplete(ctx context.Context, res // ListWebAppsByHybridConnection get all apps that use a Hybrid Connection in an App Service Plan. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service plan. -// namespaceName is name of the Hybrid Connection namespace. relayName is name of the Hybrid Connection relay. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service +// plan. namespaceName is name of the Hybrid Connection namespace. relayName is name of the Hybrid Connection +// relay. func (client AppServicePlansClient) ListWebAppsByHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (result ResourceCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServicePlansClient", "ListWebAppsByHybridConnection") + return result, validation.NewError("web.AppServicePlansClient", "ListWebAppsByHybridConnection", err.Error()) } result.fn = client.listWebAppsByHybridConnectionNextResults @@ -2101,15 +2109,15 @@ func (client AppServicePlansClient) ListWebAppsByHybridConnectionComplete(ctx co // RebootWorker reboot a worker machine in an App Service plan. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service plan. -// workerName is name of worker machine, which typically starts with RD. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service +// plan. workerName is name of worker machine, which typically starts with RD. func (client AppServicePlansClient) RebootWorker(ctx context.Context, resourceGroupName string, name string, workerName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServicePlansClient", "RebootWorker") + return result, validation.NewError("web.AppServicePlansClient", "RebootWorker", err.Error()) } req, err := client.RebootWorkerPreparer(ctx, resourceGroupName, name, workerName) @@ -2176,16 +2184,17 @@ func (client AppServicePlansClient) RebootWorkerResponder(resp *http.Response) ( // RestartWebApps restart all apps in an App Service plan. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service plan. -// softRestart is specify true to performa a soft restart, applies the configuration settings and restarts -// the apps if necessary. The default is false, which always restarts and reprovisions the apps +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service +// plan. softRestart is specify true to performa a soft restart, applies the configuration settings +// and restarts the apps if necessary. The default is false, which always restarts and reprovisions +// the apps func (client AppServicePlansClient) RestartWebApps(ctx context.Context, resourceGroupName string, name string, softRestart *bool) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServicePlansClient", "RestartWebApps") + return result, validation.NewError("web.AppServicePlansClient", "RestartWebApps", err.Error()) } req, err := client.RestartWebAppsPreparer(ctx, resourceGroupName, name, softRestart) @@ -2254,15 +2263,15 @@ func (client AppServicePlansClient) RestartWebAppsResponder(resp *http.Response) // Update creates or updates an App Service Plan. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service plan. -// appServicePlan is details of the App Service plan. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service +// plan. appServicePlan is details of the App Service plan. func (client AppServicePlansClient) Update(ctx context.Context, resourceGroupName string, name string, appServicePlan AppServicePlanPatchResource) (result AppServicePlan, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServicePlansClient", "Update") + return result, validation.NewError("web.AppServicePlansClient", "Update", err.Error()) } req, err := client.UpdatePreparer(ctx, resourceGroupName, name, appServicePlan) @@ -2331,8 +2340,8 @@ func (client AppServicePlansClient) UpdateResponder(resp *http.Response) (result // UpdateVnetGateway update a Virtual Network gateway. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service plan. -// vnetName is name of the Virtual Network. gatewayName is name of the gateway. Only the 'primary' gateway is +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service +// plan. vnetName is name of the Virtual Network. gatewayName is name of the gateway. Only the 'primary' gateway is // supported. connectionEnvelope is definition of the gateway. func (client AppServicePlansClient) UpdateVnetGateway(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway) (result VnetGateway, err error) { if err := validation.Validate([]validation.Validation{ @@ -2343,7 +2352,7 @@ func (client AppServicePlansClient) UpdateVnetGateway(ctx context.Context, resou {TargetValue: connectionEnvelope, Constraints: []validation.Constraint{{Target: "connectionEnvelope.VnetGatewayProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "connectionEnvelope.VnetGatewayProperties.VpnPackageURI", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.AppServicePlansClient", "UpdateVnetGateway") + return result, validation.NewError("web.AppServicePlansClient", "UpdateVnetGateway", err.Error()) } req, err := client.UpdateVnetGatewayPreparer(ctx, resourceGroupName, name, vnetName, gatewayName, connectionEnvelope) @@ -2414,16 +2423,16 @@ func (client AppServicePlansClient) UpdateVnetGatewayResponder(resp *http.Respon // UpdateVnetRoute create or update a Virtual Network route in an App Service plan. // -// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service plan. -// vnetName is name of the Virtual Network. routeName is name of the Virtual Network route. route is definition of the -// Virtual Network route. +// resourceGroupName is name of the resource group to which the resource belongs. name is name of the App Service +// plan. vnetName is name of the Virtual Network. routeName is name of the Virtual Network route. route is +// definition of the Virtual Network route. func (client AppServicePlansClient) UpdateVnetRoute(ctx context.Context, resourceGroupName string, name string, vnetName string, routeName string, route VnetRoute) (result VnetRoute, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.AppServicePlansClient", "UpdateVnetRoute") + return result, validation.NewError("web.AppServicePlansClient", "UpdateVnetRoute", err.Error()) } req, err := client.UpdateVnetRoutePreparer(ctx, resourceGroupName, name, vnetName, routeName, route) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/certificates.go b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/certificates.go index af45e8cae7b8..5c6bfaf0d301 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/certificates.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/certificates.go @@ -53,7 +53,7 @@ func (client CertificatesClient) CreateOrUpdate(ctx context.Context, resourceGro {TargetValue: certificateEnvelope, Constraints: []validation.Constraint{{Target: "certificateEnvelope.CertificateProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "certificateEnvelope.CertificateProperties.Password", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.CertificatesClient", "CreateOrUpdate") + return result, validation.NewError("web.CertificatesClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, name, certificateEnvelope) @@ -129,7 +129,7 @@ func (client CertificatesClient) Delete(ctx context.Context, resourceGroupName s 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.NewErrorWithValidationError(err, "web.CertificatesClient", "Delete") + return result, validation.NewError("web.CertificatesClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, name) @@ -202,7 +202,7 @@ func (client CertificatesClient) Get(ctx context.Context, resourceGroupName stri 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.NewErrorWithValidationError(err, "web.CertificatesClient", "Get") + return result, validation.NewError("web.CertificatesClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, name) @@ -366,7 +366,7 @@ func (client CertificatesClient) ListByResourceGroup(ctx context.Context, resour 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.NewErrorWithValidationError(err, "web.CertificatesClient", "ListByResourceGroup") + return result, validation.NewError("web.CertificatesClient", "ListByResourceGroup", err.Error()) } result.fn = client.listByResourceGroupNextResults @@ -468,7 +468,7 @@ func (client CertificatesClient) Update(ctx context.Context, resourceGroupName s 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.NewErrorWithValidationError(err, "web.CertificatesClient", "Update") + return result, validation.NewError("web.CertificatesClient", "Update", err.Error()) } req, err := client.UpdatePreparer(ctx, resourceGroupName, name, certificateEnvelope) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/client.go index aa916f32486c..2fae3b66ee29 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/client.go @@ -61,7 +61,7 @@ func (client BaseClient) CheckNameAvailability(ctx context.Context, request Reso if err := validation.Validate([]validation.Validation{ {TargetValue: request, Constraints: []validation.Constraint{{Target: "request.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.BaseClient", "CheckNameAvailability") + return result, validation.NewError("web.BaseClient", "CheckNameAvailability", err.Error()) } req, err := client.CheckNameAvailabilityPreparer(ctx, request) @@ -499,6 +499,100 @@ func (client BaseClient) ListPremierAddOnOffersComplete(ctx context.Context) (re return } +// ListSiteIdentifiersAssignedToHostName list all apps that are assigned to a hostname. +// +// nameIdentifier is hostname information. +func (client BaseClient) ListSiteIdentifiersAssignedToHostName(ctx context.Context, nameIdentifier NameIdentifier) (result IdentifierCollectionPage, err error) { + result.fn = client.listSiteIdentifiersAssignedToHostNameNextResults + req, err := client.ListSiteIdentifiersAssignedToHostNamePreparer(ctx, nameIdentifier) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "ListSiteIdentifiersAssignedToHostName", nil, "Failure preparing request") + return + } + + resp, err := client.ListSiteIdentifiersAssignedToHostNameSender(req) + if err != nil { + result.ic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.BaseClient", "ListSiteIdentifiersAssignedToHostName", resp, "Failure sending request") + return + } + + result.ic, err = client.ListSiteIdentifiersAssignedToHostNameResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "ListSiteIdentifiersAssignedToHostName", resp, "Failure responding to request") + } + + return +} + +// ListSiteIdentifiersAssignedToHostNamePreparer prepares the ListSiteIdentifiersAssignedToHostName request. +func (client BaseClient) ListSiteIdentifiersAssignedToHostNamePreparer(ctx context.Context, nameIdentifier NameIdentifier) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2016-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/listSitesAssignedToHostName", pathParameters), + autorest.WithJSON(nameIdentifier), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSiteIdentifiersAssignedToHostNameSender sends the ListSiteIdentifiersAssignedToHostName request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ListSiteIdentifiersAssignedToHostNameSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListSiteIdentifiersAssignedToHostNameResponder handles the response to the ListSiteIdentifiersAssignedToHostName request. The method always +// closes the http.Response Body. +func (client BaseClient) ListSiteIdentifiersAssignedToHostNameResponder(resp *http.Response) (result IdentifierCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSiteIdentifiersAssignedToHostNameNextResults retrieves the next set of results, if any. +func (client BaseClient) listSiteIdentifiersAssignedToHostNameNextResults(lastResults IdentifierCollection) (result IdentifierCollection, err error) { + req, err := lastResults.identifierCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "web.BaseClient", "listSiteIdentifiersAssignedToHostNameNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSiteIdentifiersAssignedToHostNameSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.BaseClient", "listSiteIdentifiersAssignedToHostNameNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSiteIdentifiersAssignedToHostNameResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "listSiteIdentifiersAssignedToHostNameNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSiteIdentifiersAssignedToHostNameComplete enumerates all values, automatically crossing page boundaries as required. +func (client BaseClient) ListSiteIdentifiersAssignedToHostNameComplete(ctx context.Context, nameIdentifier NameIdentifier) (result IdentifierCollectionIterator, err error) { + result.page, err = client.ListSiteIdentifiersAssignedToHostName(ctx, nameIdentifier) + return +} + // ListSkus list all SKUs. func (client BaseClient) ListSkus(ctx context.Context) (result SkuInfos, err error) { req, err := client.ListSkusPreparer(ctx) @@ -649,8 +743,8 @@ func (client BaseClient) ListSourceControlsComplete(ctx context.Context) (result // Move move resources between resource groups. // -// resourceGroupName is name of the resource group to which the resource belongs. moveResourceEnvelope is object that -// represents the resource to move. +// resourceGroupName is name of the resource group to which the resource belongs. moveResourceEnvelope is object +// that represents the resource to move. func (client BaseClient) Move(ctx context.Context, resourceGroupName string, moveResourceEnvelope CsmMoveResourceEnvelope) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -663,7 +757,7 @@ func (client BaseClient) Move(ctx context.Context, resourceGroupName string, mov {Target: "moveResourceEnvelope.TargetResourceGroup", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "moveResourceEnvelope.TargetResourceGroup", Name: validation.Pattern, Rule: ` ^[-\w\._\(\)]+[^\.]$`, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.BaseClient", "Move") + return result, validation.NewError("web.BaseClient", "Move", err.Error()) } req, err := client.MovePreparer(ctx, resourceGroupName, moveResourceEnvelope) @@ -736,7 +830,7 @@ func (client BaseClient) UpdatePublishingUser(ctx context.Context, userDetails U {TargetValue: userDetails, Constraints: []validation.Constraint{{Target: "userDetails.UserProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "userDetails.UserProperties.PublishingUserName", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.BaseClient", "UpdatePublishingUser") + return result, validation.NewError("web.BaseClient", "UpdatePublishingUser", err.Error()) } req, err := client.UpdatePublishingUserPreparer(ctx, userDetails) @@ -865,8 +959,8 @@ func (client BaseClient) UpdateSourceControlResponder(resp *http.Response) (resu // Validate validate if a resource can be created. // -// resourceGroupName is name of the resource group to which the resource belongs. validateRequest is request with the -// resources to validate. +// resourceGroupName is name of the resource group to which the resource belongs. validateRequest is request with +// the resources to validate. func (client BaseClient) Validate(ctx context.Context, resourceGroupName string, validateRequest ValidateRequest) (result ValidateResponse, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -880,7 +974,7 @@ func (client BaseClient) Validate(ctx context.Context, resourceGroupName string, Chain: []validation.Constraint{{Target: "validateRequest.ValidateProperties.Capacity", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "validateRequest.ValidateProperties.Capacity", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.BaseClient", "Validate") + return result, validation.NewError("web.BaseClient", "Validate", err.Error()) } req, err := client.ValidatePreparer(ctx, resourceGroupName, validateRequest) @@ -948,8 +1042,8 @@ func (client BaseClient) ValidateResponder(resp *http.Response) (result Validate // ValidateMove validate whether a resource can be moved. // -// resourceGroupName is name of the resource group to which the resource belongs. moveResourceEnvelope is object that -// represents the resource to move. +// resourceGroupName is name of the resource group to which the resource belongs. moveResourceEnvelope is object +// that represents the resource to move. func (client BaseClient) ValidateMove(ctx context.Context, resourceGroupName string, moveResourceEnvelope CsmMoveResourceEnvelope) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -962,7 +1056,7 @@ func (client BaseClient) ValidateMove(ctx context.Context, resourceGroupName str {Target: "moveResourceEnvelope.TargetResourceGroup", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "moveResourceEnvelope.TargetResourceGroup", Name: validation.Pattern, Rule: ` ^[-\w\._\(\)]+[^\.]$`, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.BaseClient", "ValidateMove") + return result, validation.NewError("web.BaseClient", "ValidateMove", err.Error()) } req, err := client.ValidateMovePreparer(ctx, resourceGroupName, moveResourceEnvelope) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/diagnostics.go b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/diagnostics.go index d6d626a02e57..a51eb02051b6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/diagnostics.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/diagnostics.go @@ -44,8 +44,8 @@ func NewDiagnosticsClientWithBaseURI(baseURI string, subscriptionID string) Diag // ExecuteSiteAnalysis execute Analysis // // resourceGroupName is name of the resource group to which the resource belongs. siteName is site Name -// diagnosticCategory is category Name analysisName is analysis Resource Name startTime is start Time endTime is end -// Time timeGrain is time Grain +// diagnosticCategory is category Name analysisName is analysis Resource Name startTime is start Time endTime is +// end Time timeGrain is time Grain func (client DiagnosticsClient) ExecuteSiteAnalysis(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, analysisName string, startTime *date.Time, endTime *date.Time, timeGrain string) (result DiagnosticAnalysis, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -54,7 +54,7 @@ func (client DiagnosticsClient) ExecuteSiteAnalysis(ctx context.Context, resourc {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, {TargetValue: timeGrain, Constraints: []validation.Constraint{{Target: "timeGrain", Name: validation.Pattern, Rule: `PT[1-9][0-9]+[SMH]`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.DiagnosticsClient", "ExecuteSiteAnalysis") + return result, validation.NewError("web.DiagnosticsClient", "ExecuteSiteAnalysis", err.Error()) } req, err := client.ExecuteSiteAnalysisPreparer(ctx, resourceGroupName, siteName, diagnosticCategory, analysisName, startTime, endTime, timeGrain) @@ -133,8 +133,8 @@ func (client DiagnosticsClient) ExecuteSiteAnalysisResponder(resp *http.Response // ExecuteSiteAnalysisSlot execute Analysis // // resourceGroupName is name of the resource group to which the resource belongs. siteName is site Name -// diagnosticCategory is category Name analysisName is analysis Resource Name slot is slot Name startTime is start Time -// endTime is end Time timeGrain is time Grain +// diagnosticCategory is category Name analysisName is analysis Resource Name slot is slot Name startTime is start +// Time endTime is end Time timeGrain is time Grain func (client DiagnosticsClient) ExecuteSiteAnalysisSlot(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, analysisName string, slot string, startTime *date.Time, endTime *date.Time, timeGrain string) (result DiagnosticAnalysis, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -143,7 +143,7 @@ func (client DiagnosticsClient) ExecuteSiteAnalysisSlot(ctx context.Context, res {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, {TargetValue: timeGrain, Constraints: []validation.Constraint{{Target: "timeGrain", Name: validation.Pattern, Rule: `PT[1-9][0-9]+[SMH]`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.DiagnosticsClient", "ExecuteSiteAnalysisSlot") + return result, validation.NewError("web.DiagnosticsClient", "ExecuteSiteAnalysisSlot", err.Error()) } req, err := client.ExecuteSiteAnalysisSlotPreparer(ctx, resourceGroupName, siteName, diagnosticCategory, analysisName, slot, startTime, endTime, timeGrain) @@ -222,9 +222,9 @@ func (client DiagnosticsClient) ExecuteSiteAnalysisSlotResponder(resp *http.Resp // ExecuteSiteDetector execute Detector // -// resourceGroupName is name of the resource group to which the resource belongs. siteName is site Name detectorName is -// detector Resource Name diagnosticCategory is category Name startTime is start Time endTime is end Time timeGrain is -// time Grain +// resourceGroupName is name of the resource group to which the resource belongs. siteName is site Name +// detectorName is detector Resource Name diagnosticCategory is category Name startTime is start Time endTime is +// end Time timeGrain is time Grain func (client DiagnosticsClient) ExecuteSiteDetector(ctx context.Context, resourceGroupName string, siteName string, detectorName string, diagnosticCategory string, startTime *date.Time, endTime *date.Time, timeGrain string) (result DiagnosticDetectorResponse, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -233,7 +233,7 @@ func (client DiagnosticsClient) ExecuteSiteDetector(ctx context.Context, resourc {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, {TargetValue: timeGrain, Constraints: []validation.Constraint{{Target: "timeGrain", Name: validation.Pattern, Rule: `PT[1-9][0-9]+[SMH]`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.DiagnosticsClient", "ExecuteSiteDetector") + return result, validation.NewError("web.DiagnosticsClient", "ExecuteSiteDetector", err.Error()) } req, err := client.ExecuteSiteDetectorPreparer(ctx, resourceGroupName, siteName, detectorName, diagnosticCategory, startTime, endTime, timeGrain) @@ -311,9 +311,9 @@ func (client DiagnosticsClient) ExecuteSiteDetectorResponder(resp *http.Response // ExecuteSiteDetectorSlot execute Detector // -// resourceGroupName is name of the resource group to which the resource belongs. siteName is site Name detectorName is -// detector Resource Name diagnosticCategory is category Name slot is slot Name startTime is start Time endTime is end -// Time timeGrain is time Grain +// resourceGroupName is name of the resource group to which the resource belongs. siteName is site Name +// detectorName is detector Resource Name diagnosticCategory is category Name slot is slot Name startTime is start +// Time endTime is end Time timeGrain is time Grain func (client DiagnosticsClient) ExecuteSiteDetectorSlot(ctx context.Context, resourceGroupName string, siteName string, detectorName string, diagnosticCategory string, slot string, startTime *date.Time, endTime *date.Time, timeGrain string) (result DiagnosticDetectorResponse, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -322,7 +322,7 @@ func (client DiagnosticsClient) ExecuteSiteDetectorSlot(ctx context.Context, res {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, {TargetValue: timeGrain, Constraints: []validation.Constraint{{Target: "timeGrain", Name: validation.Pattern, Rule: `PT[1-9][0-9]+[SMH]`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.DiagnosticsClient", "ExecuteSiteDetectorSlot") + return result, validation.NewError("web.DiagnosticsClient", "ExecuteSiteDetectorSlot", err.Error()) } req, err := client.ExecuteSiteDetectorSlotPreparer(ctx, resourceGroupName, siteName, detectorName, diagnosticCategory, slot, startTime, endTime, timeGrain) @@ -409,7 +409,7 @@ func (client DiagnosticsClient) GetSiteAnalysis(ctx context.Context, resourceGro 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.NewErrorWithValidationError(err, "web.DiagnosticsClient", "GetSiteAnalysis") + return result, validation.NewError("web.DiagnosticsClient", "GetSiteAnalysis", err.Error()) } req, err := client.GetSiteAnalysisPreparer(ctx, resourceGroupName, siteName, diagnosticCategory, analysisName) @@ -486,7 +486,7 @@ func (client DiagnosticsClient) GetSiteAnalysisSlot(ctx context.Context, resourc 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.NewErrorWithValidationError(err, "web.DiagnosticsClient", "GetSiteAnalysisSlot") + return result, validation.NewError("web.DiagnosticsClient", "GetSiteAnalysisSlot", err.Error()) } req, err := client.GetSiteAnalysisSlotPreparer(ctx, resourceGroupName, siteName, diagnosticCategory, analysisName, slot) @@ -564,7 +564,7 @@ func (client DiagnosticsClient) GetSiteDetector(ctx context.Context, resourceGro 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.NewErrorWithValidationError(err, "web.DiagnosticsClient", "GetSiteDetector") + return result, validation.NewError("web.DiagnosticsClient", "GetSiteDetector", err.Error()) } result.fn = client.getSiteDetectorNextResults @@ -669,7 +669,7 @@ func (client DiagnosticsClient) GetSiteDetectorSlot(ctx context.Context, resourc 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.NewErrorWithValidationError(err, "web.DiagnosticsClient", "GetSiteDetectorSlot") + return result, validation.NewError("web.DiagnosticsClient", "GetSiteDetectorSlot", err.Error()) } result.fn = client.getSiteDetectorSlotNextResults @@ -775,7 +775,7 @@ func (client DiagnosticsClient) GetSiteDiagnosticCategory(ctx context.Context, r 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.NewErrorWithValidationError(err, "web.DiagnosticsClient", "GetSiteDiagnosticCategory") + return result, validation.NewError("web.DiagnosticsClient", "GetSiteDiagnosticCategory", err.Error()) } req, err := client.GetSiteDiagnosticCategoryPreparer(ctx, resourceGroupName, siteName, diagnosticCategory) @@ -851,7 +851,7 @@ func (client DiagnosticsClient) GetSiteDiagnosticCategorySlot(ctx context.Contex 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.NewErrorWithValidationError(err, "web.DiagnosticsClient", "GetSiteDiagnosticCategorySlot") + return result, validation.NewError("web.DiagnosticsClient", "GetSiteDiagnosticCategorySlot", err.Error()) } req, err := client.GetSiteDiagnosticCategorySlotPreparer(ctx, resourceGroupName, siteName, diagnosticCategory, slot) @@ -928,7 +928,7 @@ func (client DiagnosticsClient) ListSiteAnalyses(ctx context.Context, resourceGr 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.NewErrorWithValidationError(err, "web.DiagnosticsClient", "ListSiteAnalyses") + return result, validation.NewError("web.DiagnosticsClient", "ListSiteAnalyses", err.Error()) } result.fn = client.listSiteAnalysesNextResults @@ -1032,7 +1032,7 @@ func (client DiagnosticsClient) ListSiteAnalysesSlot(ctx context.Context, resour 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.NewErrorWithValidationError(err, "web.DiagnosticsClient", "ListSiteAnalysesSlot") + return result, validation.NewError("web.DiagnosticsClient", "ListSiteAnalysesSlot", err.Error()) } result.fn = client.listSiteAnalysesSlotNextResults @@ -1137,7 +1137,7 @@ func (client DiagnosticsClient) ListSiteDetectors(ctx context.Context, resourceG 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.NewErrorWithValidationError(err, "web.DiagnosticsClient", "ListSiteDetectors") + return result, validation.NewError("web.DiagnosticsClient", "ListSiteDetectors", err.Error()) } result.fn = client.listSiteDetectorsNextResults @@ -1241,7 +1241,7 @@ func (client DiagnosticsClient) ListSiteDetectorsSlot(ctx context.Context, resou 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.NewErrorWithValidationError(err, "web.DiagnosticsClient", "ListSiteDetectorsSlot") + return result, validation.NewError("web.DiagnosticsClient", "ListSiteDetectorsSlot", err.Error()) } result.fn = client.listSiteDetectorsSlotNextResults @@ -1345,7 +1345,7 @@ func (client DiagnosticsClient) ListSiteDiagnosticCategories(ctx context.Context 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.NewErrorWithValidationError(err, "web.DiagnosticsClient", "ListSiteDiagnosticCategories") + return result, validation.NewError("web.DiagnosticsClient", "ListSiteDiagnosticCategories", err.Error()) } result.fn = client.listSiteDiagnosticCategoriesNextResults @@ -1440,15 +1440,15 @@ func (client DiagnosticsClient) ListSiteDiagnosticCategoriesComplete(ctx context // ListSiteDiagnosticCategoriesSlot get Diagnostics Categories // -// resourceGroupName is name of the resource group to which the resource belongs. siteName is site Name slot is slot -// Name +// resourceGroupName is name of the resource group to which the resource belongs. siteName is site Name slot is +// slot Name func (client DiagnosticsClient) ListSiteDiagnosticCategoriesSlot(ctx context.Context, resourceGroupName string, siteName string, slot string) (result DiagnosticCategoryCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.DiagnosticsClient", "ListSiteDiagnosticCategoriesSlot") + return result, validation.NewError("web.DiagnosticsClient", "ListSiteDiagnosticCategoriesSlot", err.Error()) } result.fn = client.listSiteDiagnosticCategoriesSlotNextResults diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/domains.go b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/domains.go index bc8d2af66e27..bb25aa52d5e7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/domains.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/domains.go @@ -174,7 +174,7 @@ func (client DomainsClient) CreateOrUpdate(ctx context.Context, resourceGroupNam }}, {Target: "domain.DomainProperties.Consent", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.DomainsClient", "CreateOrUpdate") + return result, validation.NewError("web.DomainsClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, domainName, domain) @@ -246,15 +246,16 @@ func (client DomainsClient) CreateOrUpdateResponder(resp *http.Response) (result // CreateOrUpdateOwnershipIdentifier creates an ownership identifier for a domain or updates identifier details for an // existing identifer // -// resourceGroupName is name of the resource group to which the resource belongs. domainName is name of domain. name is -// name of identifier. domainOwnershipIdentifier is a JSON representation of the domain ownership properties. +// resourceGroupName is name of the resource group to which the resource belongs. domainName is name of domain. +// name is name of identifier. domainOwnershipIdentifier is a JSON representation of the domain ownership +// properties. func (client DomainsClient) CreateOrUpdateOwnershipIdentifier(ctx context.Context, resourceGroupName string, domainName string, name string, domainOwnershipIdentifier DomainOwnershipIdentifier) (result DomainOwnershipIdentifier, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.DomainsClient", "CreateOrUpdateOwnershipIdentifier") + return result, validation.NewError("web.DomainsClient", "CreateOrUpdateOwnershipIdentifier", err.Error()) } req, err := client.CreateOrUpdateOwnershipIdentifierPreparer(ctx, resourceGroupName, domainName, name, domainOwnershipIdentifier) @@ -333,7 +334,7 @@ func (client DomainsClient) Delete(ctx context.Context, resourceGroupName string 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.NewErrorWithValidationError(err, "web.DomainsClient", "Delete") + return result, validation.NewError("web.DomainsClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, domainName, forceHardDeleteDomain) @@ -402,15 +403,15 @@ func (client DomainsClient) DeleteResponder(resp *http.Response) (result autores // DeleteOwnershipIdentifier delete ownership identifier for domain // -// resourceGroupName is name of the resource group to which the resource belongs. domainName is name of domain. name is -// name of identifier. +// resourceGroupName is name of the resource group to which the resource belongs. domainName is name of domain. +// name is name of identifier. func (client DomainsClient) DeleteOwnershipIdentifier(ctx context.Context, resourceGroupName string, domainName string, name string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.DomainsClient", "DeleteOwnershipIdentifier") + return result, validation.NewError("web.DomainsClient", "DeleteOwnershipIdentifier", err.Error()) } req, err := client.DeleteOwnershipIdentifierPreparer(ctx, resourceGroupName, domainName, name) @@ -484,7 +485,7 @@ func (client DomainsClient) Get(ctx context.Context, resourceGroupName string, d 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.NewErrorWithValidationError(err, "web.DomainsClient", "Get") + return result, validation.NewError("web.DomainsClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, domainName) @@ -613,15 +614,15 @@ func (client DomainsClient) GetControlCenterSsoRequestResponder(resp *http.Respo // GetOwnershipIdentifier get ownership identifier for domain // -// resourceGroupName is name of the resource group to which the resource belongs. domainName is name of domain. name is -// name of identifier. +// resourceGroupName is name of the resource group to which the resource belongs. domainName is name of domain. +// name is name of identifier. func (client DomainsClient) GetOwnershipIdentifier(ctx context.Context, resourceGroupName string, domainName string, name string) (result DomainOwnershipIdentifier, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.DomainsClient", "GetOwnershipIdentifier") + return result, validation.NewError("web.DomainsClient", "GetOwnershipIdentifier", err.Error()) } req, err := client.GetOwnershipIdentifierPreparer(ctx, resourceGroupName, domainName, name) @@ -786,7 +787,7 @@ func (client DomainsClient) ListByResourceGroup(ctx context.Context, resourceGro 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.NewErrorWithValidationError(err, "web.DomainsClient", "ListByResourceGroup") + return result, validation.NewError("web.DomainsClient", "ListByResourceGroup", err.Error()) } result.fn = client.listByResourceGroupNextResults @@ -887,7 +888,7 @@ func (client DomainsClient) ListOwnershipIdentifiers(ctx context.Context, resour 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.NewErrorWithValidationError(err, "web.DomainsClient", "ListOwnershipIdentifiers") + return result, validation.NewError("web.DomainsClient", "ListOwnershipIdentifiers", err.Error()) } result.fn = client.listOwnershipIdentifiersNextResults @@ -1074,6 +1075,79 @@ func (client DomainsClient) ListRecommendationsComplete(ctx context.Context, par return } +// Renew renew a domain. +// +// resourceGroupName is name of the resource group to which the resource belongs. domainName is name of the domain. +func (client DomainsClient) Renew(ctx context.Context, resourceGroupName string, domainName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {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("web.DomainsClient", "Renew", err.Error()) + } + + req, err := client.RenewPreparer(ctx, resourceGroupName, domainName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "Renew", nil, "Failure preparing request") + return + } + + resp, err := client.RenewSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.DomainsClient", "Renew", resp, "Failure sending request") + return + } + + result, err = client.RenewResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "Renew", resp, "Failure responding to request") + } + + return +} + +// RenewPreparer prepares the Renew request. +func (client DomainsClient) RenewPreparer(ctx context.Context, resourceGroupName string, domainName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "domainName": autorest.Encode("path", domainName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-04-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.DomainRegistration/domains/{domainName}/renew", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RenewSender sends the Renew request. The method will close the +// http.Response Body if it receives an error. +func (client DomainsClient) RenewSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// RenewResponder handles the response to the Renew request. The method always +// closes the http.Response Body. +func (client DomainsClient) RenewResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + // Update creates or updates a domain. // // resourceGroupName is name of the resource group to which the resource belongs. domainName is name of the domain. @@ -1086,7 +1160,7 @@ func (client DomainsClient) Update(ctx context.Context, resourceGroupName string {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, {TargetValue: domainName, Constraints: []validation.Constraint{{Target: "domainName", Name: validation.Pattern, Rule: `[a-zA-Z0-9][a-zA-Z0-9\.-]+`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "web.DomainsClient", "Update") + return result, validation.NewError("web.DomainsClient", "Update", err.Error()) } req, err := client.UpdatePreparer(ctx, resourceGroupName, domainName, domain) @@ -1156,15 +1230,16 @@ func (client DomainsClient) UpdateResponder(resp *http.Response) (result Domain, // UpdateOwnershipIdentifier creates an ownership identifier for a domain or updates identifier details for an existing // identifer // -// resourceGroupName is name of the resource group to which the resource belongs. domainName is name of domain. name is -// name of identifier. domainOwnershipIdentifier is a JSON representation of the domain ownership properties. +// resourceGroupName is name of the resource group to which the resource belongs. domainName is name of domain. +// name is name of identifier. domainOwnershipIdentifier is a JSON representation of the domain ownership +// properties. func (client DomainsClient) UpdateOwnershipIdentifier(ctx context.Context, resourceGroupName string, domainName string, name string, domainOwnershipIdentifier DomainOwnershipIdentifier) (result DomainOwnershipIdentifier, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.DomainsClient", "UpdateOwnershipIdentifier") + return result, validation.NewError("web.DomainsClient", "UpdateOwnershipIdentifier", err.Error()) } req, err := client.UpdateOwnershipIdentifierPreparer(ctx, resourceGroupName, domainName, name, domainOwnershipIdentifier) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/models.go index d4d95fa76426..89839c0ef20c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/models.go @@ -826,6 +826,18 @@ const ( StatusOptionsReady StatusOptions = "Ready" ) +// SupportedTLSVersions enumerates the values for supported tls versions. +type SupportedTLSVersions string + +const ( + // OneFullStopOne ... + OneFullStopOne SupportedTLSVersions = "1.1" + // OneFullStopTwo ... + OneFullStopTwo SupportedTLSVersions = "1.2" + // OneFullStopZero ... + OneFullStopZero SupportedTLSVersions = "1.0" +) + // TriggeredWebJobStatus enumerates the values for triggered web job status. type TriggeredWebJobStatus string @@ -945,6 +957,8 @@ type AnalysisData struct { // AnalysisDefinition definition of Analysis type AnalysisDefinition struct { + // AnalysisDefinitionProperties - AnalysisDefinition resource specific properties + *AnalysisDefinitionProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -953,8 +967,6 @@ type AnalysisDefinition struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // AnalysisDefinitionProperties - AnalysisDefinition resource specific properties - *AnalysisDefinitionProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for AnalysisDefinition struct. @@ -964,56 +976,54 @@ func (ad *AnalysisDefinition) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties AnalysisDefinitionProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - ad.AnalysisDefinitionProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - ad.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - ad.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - ad.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var analysisDefinitionProperties AnalysisDefinitionProperties + err = json.Unmarshal(*v, &analysisDefinitionProperties) + if err != nil { + return err + } + ad.AnalysisDefinitionProperties = &analysisDefinitionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ad.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ad.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ad.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ad.Type = &typeVar + } } - ad.Type = &typeVar } return nil @@ -1257,22 +1267,39 @@ func (future AppsCreateFunctionFuture) Result(client AppsClient) (fe FunctionEnv var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateFunctionFuture", "Result", future.Response(), "Polling failure") return } if !done { - return fe, autorest.NewError("web.AppsCreateFunctionFuture", "Result", "asynchronous operation has not completed") + return fe, azure.NewAsyncOpIncompleteError("web.AppsCreateFunctionFuture") } if future.PollingMethod() == azure.PollingLocation { fe, err = client.CreateFunctionResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateFunctionFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateFunctionFuture", "Result", resp, "Failure sending request") return } fe, err = client.CreateFunctionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateFunctionFuture", "Result", resp, "Failure responding to request") + } return } @@ -1289,27 +1316,44 @@ func (future AppsCreateInstanceFunctionSlotFuture) Result(client AppsClient) (fe var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateInstanceFunctionSlotFuture", "Result", future.Response(), "Polling failure") return } if !done { - return fe, autorest.NewError("web.AppsCreateInstanceFunctionSlotFuture", "Result", "asynchronous operation has not completed") + return fe, azure.NewAsyncOpIncompleteError("web.AppsCreateInstanceFunctionSlotFuture") } if future.PollingMethod() == azure.PollingLocation { fe, err = client.CreateInstanceFunctionSlotResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateInstanceFunctionSlotFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateInstanceFunctionSlotFuture", "Result", resp, "Failure sending request") return } fe, err = client.CreateInstanceFunctionSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateInstanceFunctionSlotFuture", "Result", resp, "Failure responding to request") + } return } -// AppsCreateInstanceMSDeployOperationFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// AppsCreateInstanceMSDeployOperationFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type AppsCreateInstanceMSDeployOperationFuture struct { azure.Future req *http.Request @@ -1321,22 +1365,39 @@ func (future AppsCreateInstanceMSDeployOperationFuture) Result(client AppsClient var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateInstanceMSDeployOperationFuture", "Result", future.Response(), "Polling failure") return } if !done { - return mds, autorest.NewError("web.AppsCreateInstanceMSDeployOperationFuture", "Result", "asynchronous operation has not completed") + return mds, azure.NewAsyncOpIncompleteError("web.AppsCreateInstanceMSDeployOperationFuture") } if future.PollingMethod() == azure.PollingLocation { mds, err = client.CreateInstanceMSDeployOperationResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateInstanceMSDeployOperationFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateInstanceMSDeployOperationFuture", "Result", resp, "Failure sending request") return } mds, err = client.CreateInstanceMSDeployOperationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateInstanceMSDeployOperationFuture", "Result", resp, "Failure responding to request") + } return } @@ -1353,22 +1414,39 @@ func (future AppsCreateInstanceMSDeployOperationSlotFuture) Result(client AppsCl var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateInstanceMSDeployOperationSlotFuture", "Result", future.Response(), "Polling failure") return } if !done { - return mds, autorest.NewError("web.AppsCreateInstanceMSDeployOperationSlotFuture", "Result", "asynchronous operation has not completed") + return mds, azure.NewAsyncOpIncompleteError("web.AppsCreateInstanceMSDeployOperationSlotFuture") } if future.PollingMethod() == azure.PollingLocation { mds, err = client.CreateInstanceMSDeployOperationSlotResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateInstanceMSDeployOperationSlotFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateInstanceMSDeployOperationSlotFuture", "Result", resp, "Failure sending request") return } mds, err = client.CreateInstanceMSDeployOperationSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateInstanceMSDeployOperationSlotFuture", "Result", resp, "Failure responding to request") + } return } @@ -1385,22 +1463,39 @@ func (future AppsCreateMSDeployOperationFuture) Result(client AppsClient) (mds M var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateMSDeployOperationFuture", "Result", future.Response(), "Polling failure") return } if !done { - return mds, autorest.NewError("web.AppsCreateMSDeployOperationFuture", "Result", "asynchronous operation has not completed") + return mds, azure.NewAsyncOpIncompleteError("web.AppsCreateMSDeployOperationFuture") } if future.PollingMethod() == azure.PollingLocation { mds, err = client.CreateMSDeployOperationResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateMSDeployOperationFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateMSDeployOperationFuture", "Result", resp, "Failure sending request") return } mds, err = client.CreateMSDeployOperationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateMSDeployOperationFuture", "Result", resp, "Failure responding to request") + } return } @@ -1417,22 +1512,39 @@ func (future AppsCreateMSDeployOperationSlotFuture) Result(client AppsClient) (m var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateMSDeployOperationSlotFuture", "Result", future.Response(), "Polling failure") return } if !done { - return mds, autorest.NewError("web.AppsCreateMSDeployOperationSlotFuture", "Result", "asynchronous operation has not completed") + return mds, azure.NewAsyncOpIncompleteError("web.AppsCreateMSDeployOperationSlotFuture") } if future.PollingMethod() == azure.PollingLocation { mds, err = client.CreateMSDeployOperationSlotResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateMSDeployOperationSlotFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateMSDeployOperationSlotFuture", "Result", resp, "Failure sending request") return } mds, err = client.CreateMSDeployOperationSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateMSDeployOperationSlotFuture", "Result", resp, "Failure responding to request") + } return } @@ -1448,26 +1560,44 @@ func (future AppsCreateOrUpdateFuture) Result(client AppsClient) (s Site, err er var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return s, autorest.NewError("web.AppsCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return s, azure.NewAsyncOpIncompleteError("web.AppsCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { s, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } s, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } -// AppsCreateOrUpdateSlotFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// AppsCreateOrUpdateSlotFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type AppsCreateOrUpdateSlotFuture struct { azure.Future req *http.Request @@ -1479,22 +1609,39 @@ func (future AppsCreateOrUpdateSlotFuture) Result(client AppsClient) (s Site, er var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateOrUpdateSlotFuture", "Result", future.Response(), "Polling failure") return } if !done { - return s, autorest.NewError("web.AppsCreateOrUpdateSlotFuture", "Result", "asynchronous operation has not completed") + return s, azure.NewAsyncOpIncompleteError("web.AppsCreateOrUpdateSlotFuture") } if future.PollingMethod() == azure.PollingLocation { s, err = client.CreateOrUpdateSlotResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateOrUpdateSlotFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateOrUpdateSlotFuture", "Result", resp, "Failure sending request") return } s, err = client.CreateOrUpdateSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateOrUpdateSlotFuture", "Result", resp, "Failure responding to request") + } return } @@ -1511,27 +1658,44 @@ func (future AppsCreateOrUpdateSourceControlFuture) Result(client AppsClient) (s var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateOrUpdateSourceControlFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ssc, autorest.NewError("web.AppsCreateOrUpdateSourceControlFuture", "Result", "asynchronous operation has not completed") + return ssc, azure.NewAsyncOpIncompleteError("web.AppsCreateOrUpdateSourceControlFuture") } if future.PollingMethod() == azure.PollingLocation { ssc, err = client.CreateOrUpdateSourceControlResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateOrUpdateSourceControlFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateOrUpdateSourceControlFuture", "Result", resp, "Failure sending request") return } ssc, err = client.CreateOrUpdateSourceControlResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateOrUpdateSourceControlFuture", "Result", resp, "Failure responding to request") + } return } -// AppsCreateOrUpdateSourceControlSlotFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// AppsCreateOrUpdateSourceControlSlotFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type AppsCreateOrUpdateSourceControlSlotFuture struct { azure.Future req *http.Request @@ -1543,22 +1707,39 @@ func (future AppsCreateOrUpdateSourceControlSlotFuture) Result(client AppsClient var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateOrUpdateSourceControlSlotFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ssc, autorest.NewError("web.AppsCreateOrUpdateSourceControlSlotFuture", "Result", "asynchronous operation has not completed") + return ssc, azure.NewAsyncOpIncompleteError("web.AppsCreateOrUpdateSourceControlSlotFuture") } if future.PollingMethod() == azure.PollingLocation { ssc, err = client.CreateOrUpdateSourceControlSlotResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateOrUpdateSourceControlSlotFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateOrUpdateSourceControlSlotFuture", "Result", resp, "Failure sending request") return } ssc, err = client.CreateOrUpdateSourceControlSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateOrUpdateSourceControlSlotFuture", "Result", resp, "Failure responding to request") + } return } @@ -1678,6 +1859,8 @@ func (page AppServiceCertificateCollectionPage) Values() []AppServiceCertificate // AppServiceCertificateOrder SSL certificate purchase order. type AppServiceCertificateOrder struct { autorest.Response `json:"-"` + // AppServiceCertificateOrderProperties - AppServiceCertificateOrder resource specific properties + *AppServiceCertificateOrderProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -1689,88 +1872,109 @@ type AppServiceCertificateOrder struct { // Type - Resource type. Type *string `json:"type,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // AppServiceCertificateOrderProperties - AppServiceCertificateOrder resource specific properties - *AppServiceCertificateOrderProperties `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for AppServiceCertificateOrder struct. -func (asco *AppServiceCertificateOrder) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for AppServiceCertificateOrder. +func (asco AppServiceCertificateOrder) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asco.AppServiceCertificateOrderProperties != nil { + objectMap["properties"] = asco.AppServiceCertificateOrderProperties } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties AppServiceCertificateOrderProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - asco.AppServiceCertificateOrderProperties = &properties + if asco.ID != nil { + objectMap["id"] = asco.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - asco.ID = &ID + if asco.Name != nil { + objectMap["name"] = asco.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - asco.Name = &name + if asco.Kind != nil { + objectMap["kind"] = asco.Kind } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - asco.Kind = &kind + if asco.Location != nil { + objectMap["location"] = asco.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - asco.Location = &location + if asco.Type != nil { + objectMap["type"] = asco.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - asco.Type = &typeVar + if asco.Tags != nil { + objectMap["tags"] = asco.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for AppServiceCertificateOrder struct. +func (asco *AppServiceCertificateOrder) 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 "properties": + if v != nil { + var appServiceCertificateOrderProperties AppServiceCertificateOrderProperties + err = json.Unmarshal(*v, &appServiceCertificateOrderProperties) + if err != nil { + return err + } + asco.AppServiceCertificateOrderProperties = &appServiceCertificateOrderProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + asco.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + asco.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + asco.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + asco.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + asco.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + asco.Tags = tags + } } - asco.Tags = &tags } return nil @@ -1881,6 +2085,8 @@ func (page AppServiceCertificateOrderCollectionPage) Values() []AppServiceCertif // AppServiceCertificateOrderPatchResource ARM resource for a certificate order that is purchased through Azure. type AppServiceCertificateOrderPatchResource struct { + // AppServiceCertificateOrderPatchResourceProperties - AppServiceCertificateOrderPatchResource resource specific properties + *AppServiceCertificateOrderPatchResourceProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -1889,8 +2095,6 @@ type AppServiceCertificateOrderPatchResource struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // AppServiceCertificateOrderPatchResourceProperties - AppServiceCertificateOrderPatchResource resource specific properties - *AppServiceCertificateOrderPatchResourceProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for AppServiceCertificateOrderPatchResource struct. @@ -1900,56 +2104,54 @@ func (ascopr *AppServiceCertificateOrderPatchResource) UnmarshalJSON(body []byte if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties AppServiceCertificateOrderPatchResourceProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - ascopr.AppServiceCertificateOrderPatchResourceProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - ascopr.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - ascopr.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - ascopr.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var appServiceCertificateOrderPatchResourceProperties AppServiceCertificateOrderPatchResourceProperties + err = json.Unmarshal(*v, &appServiceCertificateOrderPatchResourceProperties) + if err != nil { + return err + } + ascopr.AppServiceCertificateOrderPatchResourceProperties = &appServiceCertificateOrderPatchResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ascopr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ascopr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ascopr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ascopr.Type = &typeVar + } } - ascopr.Type = &typeVar } return nil @@ -1959,7 +2161,7 @@ func (ascopr *AppServiceCertificateOrderPatchResource) UnmarshalJSON(body []byte // properties type AppServiceCertificateOrderPatchResourceProperties struct { // Certificates - State of the Key Vault secret. - Certificates *map[string]*AppServiceCertificate `json:"certificates,omitempty"` + Certificates map[string]*AppServiceCertificate `json:"certificates"` // DistinguishedName - Certificate distinguished name. DistinguishedName *string `json:"distinguishedName,omitempty"` // DomainVerificationToken - Domain verification token. @@ -1998,10 +2200,67 @@ type AppServiceCertificateOrderPatchResourceProperties struct { NextAutoRenewalTimeStamp *date.Time `json:"nextAutoRenewalTimeStamp,omitempty"` } +// MarshalJSON is the custom marshaler for AppServiceCertificateOrderPatchResourceProperties. +func (ascopr AppServiceCertificateOrderPatchResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ascopr.Certificates != nil { + objectMap["certificates"] = ascopr.Certificates + } + if ascopr.DistinguishedName != nil { + objectMap["distinguishedName"] = ascopr.DistinguishedName + } + if ascopr.DomainVerificationToken != nil { + objectMap["domainVerificationToken"] = ascopr.DomainVerificationToken + } + if ascopr.ValidityInYears != nil { + objectMap["validityInYears"] = ascopr.ValidityInYears + } + if ascopr.KeySize != nil { + objectMap["keySize"] = ascopr.KeySize + } + objectMap["productType"] = ascopr.ProductType + if ascopr.AutoRenew != nil { + objectMap["autoRenew"] = ascopr.AutoRenew + } + objectMap["provisioningState"] = ascopr.ProvisioningState + objectMap["status"] = ascopr.Status + if ascopr.SignedCertificate != nil { + objectMap["signedCertificate"] = ascopr.SignedCertificate + } + if ascopr.Csr != nil { + objectMap["csr"] = ascopr.Csr + } + if ascopr.Intermediate != nil { + objectMap["intermediate"] = ascopr.Intermediate + } + if ascopr.Root != nil { + objectMap["root"] = ascopr.Root + } + if ascopr.SerialNumber != nil { + objectMap["serialNumber"] = ascopr.SerialNumber + } + if ascopr.LastCertificateIssuanceTime != nil { + objectMap["lastCertificateIssuanceTime"] = ascopr.LastCertificateIssuanceTime + } + if ascopr.ExpirationTime != nil { + objectMap["expirationTime"] = ascopr.ExpirationTime + } + if ascopr.IsPrivateKeyExternal != nil { + objectMap["isPrivateKeyExternal"] = ascopr.IsPrivateKeyExternal + } + if ascopr.AppServiceCertificateNotRenewableReasons != nil { + objectMap["appServiceCertificateNotRenewableReasons"] = ascopr.AppServiceCertificateNotRenewableReasons + } + if ascopr.NextAutoRenewalTimeStamp != nil { + objectMap["nextAutoRenewalTimeStamp"] = ascopr.NextAutoRenewalTimeStamp + } + return json.Marshal(objectMap) +} + // AppServiceCertificateOrderProperties appServiceCertificateOrder resource specific properties type AppServiceCertificateOrderProperties struct { // Certificates - State of the Key Vault secret. - Certificates *map[string]*AppServiceCertificate `json:"certificates,omitempty"` + Certificates map[string]*AppServiceCertificate `json:"certificates"` // DistinguishedName - Certificate distinguished name. DistinguishedName *string `json:"distinguishedName,omitempty"` // DomainVerificationToken - Domain verification token. @@ -2040,8 +2299,65 @@ type AppServiceCertificateOrderProperties struct { NextAutoRenewalTimeStamp *date.Time `json:"nextAutoRenewalTimeStamp,omitempty"` } -// AppServiceCertificateOrdersCreateOrUpdateCertificateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. +// MarshalJSON is the custom marshaler for AppServiceCertificateOrderProperties. +func (asco AppServiceCertificateOrderProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asco.Certificates != nil { + objectMap["certificates"] = asco.Certificates + } + if asco.DistinguishedName != nil { + objectMap["distinguishedName"] = asco.DistinguishedName + } + if asco.DomainVerificationToken != nil { + objectMap["domainVerificationToken"] = asco.DomainVerificationToken + } + if asco.ValidityInYears != nil { + objectMap["validityInYears"] = asco.ValidityInYears + } + if asco.KeySize != nil { + objectMap["keySize"] = asco.KeySize + } + objectMap["productType"] = asco.ProductType + if asco.AutoRenew != nil { + objectMap["autoRenew"] = asco.AutoRenew + } + objectMap["provisioningState"] = asco.ProvisioningState + objectMap["status"] = asco.Status + if asco.SignedCertificate != nil { + objectMap["signedCertificate"] = asco.SignedCertificate + } + if asco.Csr != nil { + objectMap["csr"] = asco.Csr + } + if asco.Intermediate != nil { + objectMap["intermediate"] = asco.Intermediate + } + if asco.Root != nil { + objectMap["root"] = asco.Root + } + if asco.SerialNumber != nil { + objectMap["serialNumber"] = asco.SerialNumber + } + if asco.LastCertificateIssuanceTime != nil { + objectMap["lastCertificateIssuanceTime"] = asco.LastCertificateIssuanceTime + } + if asco.ExpirationTime != nil { + objectMap["expirationTime"] = asco.ExpirationTime + } + if asco.IsPrivateKeyExternal != nil { + objectMap["isPrivateKeyExternal"] = asco.IsPrivateKeyExternal + } + if asco.AppServiceCertificateNotRenewableReasons != nil { + objectMap["appServiceCertificateNotRenewableReasons"] = asco.AppServiceCertificateNotRenewableReasons + } + if asco.NextAutoRenewalTimeStamp != nil { + objectMap["nextAutoRenewalTimeStamp"] = asco.NextAutoRenewalTimeStamp + } + return json.Marshal(objectMap) +} + +// AppServiceCertificateOrdersCreateOrUpdateCertificateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. type AppServiceCertificateOrdersCreateOrUpdateCertificateFuture struct { azure.Future req *http.Request @@ -2053,22 +2369,39 @@ func (future AppServiceCertificateOrdersCreateOrUpdateCertificateFuture) Result( var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersCreateOrUpdateCertificateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ascr, autorest.NewError("web.AppServiceCertificateOrdersCreateOrUpdateCertificateFuture", "Result", "asynchronous operation has not completed") + return ascr, azure.NewAsyncOpIncompleteError("web.AppServiceCertificateOrdersCreateOrUpdateCertificateFuture") } if future.PollingMethod() == azure.PollingLocation { ascr, err = client.CreateOrUpdateCertificateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersCreateOrUpdateCertificateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersCreateOrUpdateCertificateFuture", "Result", resp, "Failure sending request") return } ascr, err = client.CreateOrUpdateCertificateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersCreateOrUpdateCertificateFuture", "Result", resp, "Failure responding to request") + } return } @@ -2085,28 +2418,47 @@ func (future AppServiceCertificateOrdersCreateOrUpdateFuture) Result(client AppS var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return asco, autorest.NewError("web.AppServiceCertificateOrdersCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return asco, azure.NewAsyncOpIncompleteError("web.AppServiceCertificateOrdersCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { asco, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } asco, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } // AppServiceCertificatePatchResource key Vault container ARM resource for a certificate that is purchased through // Azure. type AppServiceCertificatePatchResource struct { + // AppServiceCertificate - Core resource properties + *AppServiceCertificate `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -2115,8 +2467,6 @@ type AppServiceCertificatePatchResource struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // AppServiceCertificate - Core resource properties - *AppServiceCertificate `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for AppServiceCertificatePatchResource struct. @@ -2126,64 +2476,65 @@ func (ascpr *AppServiceCertificatePatchResource) UnmarshalJSON(body []byte) erro if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties AppServiceCertificate - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - ascpr.AppServiceCertificate = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - ascpr.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - ascpr.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - ascpr.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var appServiceCertificate AppServiceCertificate + err = json.Unmarshal(*v, &appServiceCertificate) + if err != nil { + return err + } + ascpr.AppServiceCertificate = &appServiceCertificate + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ascpr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ascpr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ascpr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ascpr.Type = &typeVar + } } - ascpr.Type = &typeVar } return nil } -// AppServiceCertificateResource key Vault container ARM resource for a certificate that is purchased through Azure. +// AppServiceCertificateResource key Vault container ARM resource for a certificate that is purchased through +// Azure. type AppServiceCertificateResource struct { autorest.Response `json:"-"` + // AppServiceCertificate - Core resource properties + *AppServiceCertificate `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -2195,9 +2546,34 @@ type AppServiceCertificateResource struct { // Type - Resource type. Type *string `json:"type,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // AppServiceCertificate - Core resource properties - *AppServiceCertificate `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for AppServiceCertificateResource. +func (ascr AppServiceCertificateResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ascr.AppServiceCertificate != nil { + objectMap["properties"] = ascr.AppServiceCertificate + } + if ascr.ID != nil { + objectMap["id"] = ascr.ID + } + if ascr.Name != nil { + objectMap["name"] = ascr.Name + } + if ascr.Kind != nil { + objectMap["kind"] = ascr.Kind + } + if ascr.Location != nil { + objectMap["location"] = ascr.Location + } + if ascr.Type != nil { + objectMap["type"] = ascr.Type + } + if ascr.Tags != nil { + objectMap["tags"] = ascr.Tags + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for AppServiceCertificateResource struct. @@ -2207,80 +2583,76 @@ func (ascr *AppServiceCertificateResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties AppServiceCertificate - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var appServiceCertificate AppServiceCertificate + err = json.Unmarshal(*v, &appServiceCertificate) + if err != nil { + return err + } + ascr.AppServiceCertificate = &appServiceCertificate + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ascr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ascr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ascr.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ascr.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ascr.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ascr.Tags = tags + } } - ascr.AppServiceCertificate = &properties } - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - ascr.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - ascr.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - ascr.Kind = &kind - } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - ascr.Location = &location - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - ascr.Type = &typeVar - } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - ascr.Tags = &tags - } - - return nil -} + return nil +} // AppServiceEnvironment description of an App Service Environment. type AppServiceEnvironment struct { @@ -2465,6 +2837,8 @@ func (page AppServiceEnvironmentCollectionPage) Values() []AppServiceEnvironment // AppServiceEnvironmentPatchResource ARM resource for a app service enviroment. type AppServiceEnvironmentPatchResource struct { + // AppServiceEnvironment - Core resource properties + *AppServiceEnvironment `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -2473,8 +2847,6 @@ type AppServiceEnvironmentPatchResource struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // AppServiceEnvironment - Core resource properties - *AppServiceEnvironment `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for AppServiceEnvironmentPatchResource struct. @@ -2484,56 +2856,54 @@ func (asepr *AppServiceEnvironmentPatchResource) UnmarshalJSON(body []byte) erro if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties AppServiceEnvironment - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - asepr.AppServiceEnvironment = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - asepr.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - asepr.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - asepr.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var appServiceEnvironment AppServiceEnvironment + err = json.Unmarshal(*v, &appServiceEnvironment) + if err != nil { + return err + } + asepr.AppServiceEnvironment = &appServiceEnvironment + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + asepr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + asepr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + asepr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + asepr.Type = &typeVar + } } - asepr.Type = &typeVar } return nil @@ -2542,6 +2912,8 @@ func (asepr *AppServiceEnvironmentPatchResource) UnmarshalJSON(body []byte) erro // AppServiceEnvironmentResource app Service Environment ARM resource. type AppServiceEnvironmentResource struct { autorest.Response `json:"-"` + // AppServiceEnvironment - Core resource properties + *AppServiceEnvironment `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -2553,88 +2925,109 @@ type AppServiceEnvironmentResource struct { // Type - Resource type. Type *string `json:"type,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // AppServiceEnvironment - Core resource properties - *AppServiceEnvironment `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for AppServiceEnvironmentResource struct. -func (aser *AppServiceEnvironmentResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for AppServiceEnvironmentResource. +func (aser AppServiceEnvironmentResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aser.AppServiceEnvironment != nil { + objectMap["properties"] = aser.AppServiceEnvironment } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties AppServiceEnvironment - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - aser.AppServiceEnvironment = &properties + if aser.ID != nil { + objectMap["id"] = aser.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - aser.ID = &ID + if aser.Name != nil { + objectMap["name"] = aser.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - aser.Name = &name + if aser.Kind != nil { + objectMap["kind"] = aser.Kind } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - aser.Kind = &kind + if aser.Location != nil { + objectMap["location"] = aser.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - aser.Location = &location + if aser.Type != nil { + objectMap["type"] = aser.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - aser.Type = &typeVar + if aser.Tags != nil { + objectMap["tags"] = aser.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for AppServiceEnvironmentResource struct. +func (aser *AppServiceEnvironmentResource) 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 "properties": + if v != nil { + var appServiceEnvironment AppServiceEnvironment + err = json.Unmarshal(*v, &appServiceEnvironment) + if err != nil { + return err + } + aser.AppServiceEnvironment = &appServiceEnvironment + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + aser.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + aser.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + aser.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + aser.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + aser.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + aser.Tags = tags + } } - aser.Tags = &tags } return nil @@ -2653,27 +3046,44 @@ func (future AppServiceEnvironmentsCreateOrUpdateFuture) Result(client AppServic var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return aser, autorest.NewError("web.AppServiceEnvironmentsCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return aser, azure.NewAsyncOpIncompleteError("web.AppServiceEnvironmentsCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { aser, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } aser, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } -// AppServiceEnvironmentsCreateOrUpdateMultiRolePoolFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. +// AppServiceEnvironmentsCreateOrUpdateMultiRolePoolFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. type AppServiceEnvironmentsCreateOrUpdateMultiRolePoolFuture struct { azure.Future req *http.Request @@ -2685,27 +3095,44 @@ func (future AppServiceEnvironmentsCreateOrUpdateMultiRolePoolFuture) Result(cli var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsCreateOrUpdateMultiRolePoolFuture", "Result", future.Response(), "Polling failure") return } if !done { - return wpr, autorest.NewError("web.AppServiceEnvironmentsCreateOrUpdateMultiRolePoolFuture", "Result", "asynchronous operation has not completed") + return wpr, azure.NewAsyncOpIncompleteError("web.AppServiceEnvironmentsCreateOrUpdateMultiRolePoolFuture") } if future.PollingMethod() == azure.PollingLocation { wpr, err = client.CreateOrUpdateMultiRolePoolResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsCreateOrUpdateMultiRolePoolFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsCreateOrUpdateMultiRolePoolFuture", "Result", resp, "Failure sending request") return } wpr, err = client.CreateOrUpdateMultiRolePoolResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsCreateOrUpdateMultiRolePoolFuture", "Result", resp, "Failure responding to request") + } return } -// AppServiceEnvironmentsCreateOrUpdateWorkerPoolFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// AppServiceEnvironmentsCreateOrUpdateWorkerPoolFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. type AppServiceEnvironmentsCreateOrUpdateWorkerPoolFuture struct { azure.Future req *http.Request @@ -2717,22 +3144,39 @@ func (future AppServiceEnvironmentsCreateOrUpdateWorkerPoolFuture) Result(client var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsCreateOrUpdateWorkerPoolFuture", "Result", future.Response(), "Polling failure") return } if !done { - return wpr, autorest.NewError("web.AppServiceEnvironmentsCreateOrUpdateWorkerPoolFuture", "Result", "asynchronous operation has not completed") + return wpr, azure.NewAsyncOpIncompleteError("web.AppServiceEnvironmentsCreateOrUpdateWorkerPoolFuture") } if future.PollingMethod() == azure.PollingLocation { wpr, err = client.CreateOrUpdateWorkerPoolResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsCreateOrUpdateWorkerPoolFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsCreateOrUpdateWorkerPoolFuture", "Result", resp, "Failure sending request") return } wpr, err = client.CreateOrUpdateWorkerPoolResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsCreateOrUpdateWorkerPoolFuture", "Result", resp, "Failure responding to request") + } return } @@ -2749,22 +3193,39 @@ func (future AppServiceEnvironmentsDeleteFuture) Result(client AppServiceEnviron var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("web.AppServiceEnvironmentsDeleteFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("web.AppServiceEnvironmentsDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.DeleteResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsDeleteFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsDeleteFuture", "Result", resp, "Failure sending request") return } ar, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsDeleteFuture", "Result", resp, "Failure responding to request") + } return } @@ -2781,22 +3242,39 @@ func (future AppServiceEnvironmentsResumeAllFuture) Result(client AppServiceEnvi var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsResumeAllFuture", "Result", future.Response(), "Polling failure") return } if !done { - return acp, autorest.NewError("web.AppServiceEnvironmentsResumeAllFuture", "Result", "asynchronous operation has not completed") + return acp, azure.NewAsyncOpIncompleteError("web.AppServiceEnvironmentsResumeAllFuture") } if future.PollingMethod() == azure.PollingLocation { acp, err = client.ResumeResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsResumeAllFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsResumeAllFuture", "Result", resp, "Failure sending request") return } acp, err = client.ResumeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsResumeAllFuture", "Result", resp, "Failure responding to request") + } return } @@ -2813,27 +3291,44 @@ func (future AppServiceEnvironmentsResumeFuture) Result(client AppServiceEnviron var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsResumeFuture", "Result", future.Response(), "Polling failure") return } if !done { - return acp, autorest.NewError("web.AppServiceEnvironmentsResumeFuture", "Result", "asynchronous operation has not completed") + return acp, azure.NewAsyncOpIncompleteError("web.AppServiceEnvironmentsResumeFuture") } if future.PollingMethod() == azure.PollingLocation { acp, err = client.ResumeResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsResumeFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsResumeFuture", "Result", resp, "Failure sending request") return } acp, err = client.ResumeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsResumeFuture", "Result", resp, "Failure responding to request") + } return } -// AppServiceEnvironmentsSuspendAllFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// AppServiceEnvironmentsSuspendAllFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type AppServiceEnvironmentsSuspendAllFuture struct { azure.Future req *http.Request @@ -2845,22 +3340,39 @@ func (future AppServiceEnvironmentsSuspendAllFuture) Result(client AppServiceEnv var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsSuspendAllFuture", "Result", future.Response(), "Polling failure") return } if !done { - return acp, autorest.NewError("web.AppServiceEnvironmentsSuspendAllFuture", "Result", "asynchronous operation has not completed") + return acp, azure.NewAsyncOpIncompleteError("web.AppServiceEnvironmentsSuspendAllFuture") } if future.PollingMethod() == azure.PollingLocation { acp, err = client.SuspendResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsSuspendAllFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsSuspendAllFuture", "Result", resp, "Failure sending request") return } acp, err = client.SuspendResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsSuspendAllFuture", "Result", resp, "Failure responding to request") + } return } @@ -2877,28 +3389,48 @@ func (future AppServiceEnvironmentsSuspendFuture) Result(client AppServiceEnviro var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsSuspendFuture", "Result", future.Response(), "Polling failure") return } if !done { - return acp, autorest.NewError("web.AppServiceEnvironmentsSuspendFuture", "Result", "asynchronous operation has not completed") + return acp, azure.NewAsyncOpIncompleteError("web.AppServiceEnvironmentsSuspendFuture") } if future.PollingMethod() == azure.PollingLocation { acp, err = client.SuspendResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsSuspendFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsSuspendFuture", "Result", resp, "Failure sending request") return } acp, err = client.SuspendResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsSuspendFuture", "Result", resp, "Failure responding to request") + } return } // AppServicePlan app Service plan. type AppServicePlan struct { autorest.Response `json:"-"` + // AppServicePlanProperties - AppServicePlan resource specific properties + *AppServicePlanProperties `json:"properties,omitempty"` + Sku *SkuDescription `json:"sku,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -2910,99 +3442,121 @@ type AppServicePlan struct { // Type - Resource type. Type *string `json:"type,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // AppServicePlanProperties - AppServicePlan resource specific properties - *AppServicePlanProperties `json:"properties,omitempty"` - Sku *SkuDescription `json:"sku,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for AppServicePlan struct. -func (asp *AppServicePlan) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for AppServicePlan. +func (asp AppServicePlan) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asp.AppServicePlanProperties != nil { + objectMap["properties"] = asp.AppServicePlanProperties } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties AppServicePlanProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - asp.AppServicePlanProperties = &properties + if asp.Sku != nil { + objectMap["sku"] = asp.Sku } - - v = m["sku"] - if v != nil { - var sku SkuDescription - err = json.Unmarshal(*m["sku"], &sku) - if err != nil { - return err - } - asp.Sku = &sku + if asp.ID != nil { + objectMap["id"] = asp.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - asp.ID = &ID + if asp.Name != nil { + objectMap["name"] = asp.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - asp.Name = &name + if asp.Kind != nil { + objectMap["kind"] = asp.Kind } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - asp.Kind = &kind + if asp.Location != nil { + objectMap["location"] = asp.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - asp.Location = &location + if asp.Type != nil { + objectMap["type"] = asp.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - asp.Type = &typeVar + if asp.Tags != nil { + objectMap["tags"] = asp.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for AppServicePlan struct. +func (asp *AppServicePlan) 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 "properties": + if v != nil { + var appServicePlanProperties AppServicePlanProperties + err = json.Unmarshal(*v, &appServicePlanProperties) + if err != nil { + return err + } + asp.AppServicePlanProperties = &appServicePlanProperties + } + case "sku": + if v != nil { + var sku SkuDescription + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + asp.Sku = &sku + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + asp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + asp.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + asp.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + asp.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + asp.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + asp.Tags = tags + } } - asp.Tags = &tags } return nil @@ -3112,6 +3666,8 @@ func (page AppServicePlanCollectionPage) Values() []AppServicePlan { // AppServicePlanPatchResource ARM resource for a app service plan. type AppServicePlanPatchResource struct { + // AppServicePlanPatchResourceProperties - AppServicePlanPatchResource resource specific properties + *AppServicePlanPatchResourceProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -3120,8 +3676,6 @@ type AppServicePlanPatchResource struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // AppServicePlanPatchResourceProperties - AppServicePlanPatchResource resource specific properties - *AppServicePlanPatchResourceProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for AppServicePlanPatchResource struct. @@ -3131,56 +3685,54 @@ func (asppr *AppServicePlanPatchResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties AppServicePlanPatchResourceProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - asppr.AppServicePlanPatchResourceProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - asppr.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - asppr.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - asppr.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var appServicePlanPatchResourceProperties AppServicePlanPatchResourceProperties + err = json.Unmarshal(*v, &appServicePlanPatchResourceProperties) + if err != nil { + return err + } + asppr.AppServicePlanPatchResourceProperties = &appServicePlanPatchResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + asppr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + asppr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + asppr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + asppr.Type = &typeVar + } } - asppr.Type = &typeVar } return nil @@ -3277,26 +3829,44 @@ func (future AppServicePlansCreateOrUpdateFuture) Result(client AppServicePlansC var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return asp, autorest.NewError("web.AppServicePlansCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return asp, azure.NewAsyncOpIncompleteError("web.AppServicePlansCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { asp, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } asp, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } -// AppsInstallSiteExtensionFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// AppsInstallSiteExtensionFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type AppsInstallSiteExtensionFuture struct { azure.Future req *http.Request @@ -3308,22 +3878,39 @@ func (future AppsInstallSiteExtensionFuture) Result(client AppsClient) (sei Site var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsInstallSiteExtensionFuture", "Result", future.Response(), "Polling failure") return } if !done { - return sei, autorest.NewError("web.AppsInstallSiteExtensionFuture", "Result", "asynchronous operation has not completed") + return sei, azure.NewAsyncOpIncompleteError("web.AppsInstallSiteExtensionFuture") } if future.PollingMethod() == azure.PollingLocation { sei, err = client.InstallSiteExtensionResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsInstallSiteExtensionFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsInstallSiteExtensionFuture", "Result", resp, "Failure sending request") return } sei, err = client.InstallSiteExtensionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsInstallSiteExtensionFuture", "Result", resp, "Failure responding to request") + } return } @@ -3340,22 +3927,39 @@ func (future AppsInstallSiteExtensionSlotFuture) Result(client AppsClient) (sei var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsInstallSiteExtensionSlotFuture", "Result", future.Response(), "Polling failure") return } if !done { - return sei, autorest.NewError("web.AppsInstallSiteExtensionSlotFuture", "Result", "asynchronous operation has not completed") + return sei, azure.NewAsyncOpIncompleteError("web.AppsInstallSiteExtensionSlotFuture") } if future.PollingMethod() == azure.PollingLocation { sei, err = client.InstallSiteExtensionSlotResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsInstallSiteExtensionSlotFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsInstallSiteExtensionSlotFuture", "Result", resp, "Failure sending request") return } sei, err = client.InstallSiteExtensionSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsInstallSiteExtensionSlotFuture", "Result", resp, "Failure responding to request") + } return } @@ -3372,27 +3976,44 @@ func (future AppsListPublishingCredentialsFuture) Result(client AppsClient) (u U var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsListPublishingCredentialsFuture", "Result", future.Response(), "Polling failure") return } if !done { - return u, autorest.NewError("web.AppsListPublishingCredentialsFuture", "Result", "asynchronous operation has not completed") + return u, azure.NewAsyncOpIncompleteError("web.AppsListPublishingCredentialsFuture") } if future.PollingMethod() == azure.PollingLocation { u, err = client.ListPublishingCredentialsResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsListPublishingCredentialsFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsListPublishingCredentialsFuture", "Result", resp, "Failure sending request") return } u, err = client.ListPublishingCredentialsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsListPublishingCredentialsFuture", "Result", resp, "Failure responding to request") + } return } -// AppsListPublishingCredentialsSlotFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// AppsListPublishingCredentialsSlotFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type AppsListPublishingCredentialsSlotFuture struct { azure.Future req *http.Request @@ -3404,22 +4025,39 @@ func (future AppsListPublishingCredentialsSlotFuture) Result(client AppsClient) var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsListPublishingCredentialsSlotFuture", "Result", future.Response(), "Polling failure") return } if !done { - return u, autorest.NewError("web.AppsListPublishingCredentialsSlotFuture", "Result", "asynchronous operation has not completed") + return u, azure.NewAsyncOpIncompleteError("web.AppsListPublishingCredentialsSlotFuture") } if future.PollingMethod() == azure.PollingLocation { u, err = client.ListPublishingCredentialsSlotResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsListPublishingCredentialsSlotFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsListPublishingCredentialsSlotFuture", "Result", resp, "Failure sending request") return } u, err = client.ListPublishingCredentialsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsListPublishingCredentialsSlotFuture", "Result", resp, "Failure responding to request") + } return } @@ -3435,22 +4073,39 @@ func (future AppsMigrateMySQLFuture) Result(client AppsClient) (o Operation, err var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsMigrateMySQLFuture", "Result", future.Response(), "Polling failure") return } if !done { - return o, autorest.NewError("web.AppsMigrateMySQLFuture", "Result", "asynchronous operation has not completed") + return o, azure.NewAsyncOpIncompleteError("web.AppsMigrateMySQLFuture") } if future.PollingMethod() == azure.PollingLocation { o, err = client.MigrateMySQLResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsMigrateMySQLFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsMigrateMySQLFuture", "Result", resp, "Failure sending request") return } o, err = client.MigrateMySQLResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsMigrateMySQLFuture", "Result", resp, "Failure responding to request") + } return } @@ -3466,22 +4121,39 @@ func (future AppsMigrateStorageFuture) Result(client AppsClient) (smr StorageMig var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsMigrateStorageFuture", "Result", future.Response(), "Polling failure") return } if !done { - return smr, autorest.NewError("web.AppsMigrateStorageFuture", "Result", "asynchronous operation has not completed") + return smr, azure.NewAsyncOpIncompleteError("web.AppsMigrateStorageFuture") } if future.PollingMethod() == azure.PollingLocation { smr, err = client.MigrateStorageResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsMigrateStorageFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsMigrateStorageFuture", "Result", resp, "Failure sending request") return } smr, err = client.MigrateStorageResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsMigrateStorageFuture", "Result", resp, "Failure responding to request") + } return } @@ -3497,22 +4169,39 @@ func (future AppsRecoverFuture) Result(client AppsClient) (ar autorest.Response, var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsRecoverFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("web.AppsRecoverFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("web.AppsRecoverFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.RecoverResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsRecoverFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsRecoverFuture", "Result", resp, "Failure sending request") return } ar, err = client.RecoverResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsRecoverFuture", "Result", resp, "Failure responding to request") + } return } @@ -3528,22 +4217,39 @@ func (future AppsRecoverSlotFuture) Result(client AppsClient) (ar autorest.Respo var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsRecoverSlotFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("web.AppsRecoverSlotFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("web.AppsRecoverSlotFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.RecoverSlotResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsRecoverSlotFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsRecoverSlotFuture", "Result", resp, "Failure sending request") return } ar, err = client.RecoverSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsRecoverSlotFuture", "Result", resp, "Failure responding to request") + } return } @@ -3559,22 +4265,39 @@ func (future AppsRestoreFuture) Result(client AppsClient) (rr RestoreResponse, e var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsRestoreFuture", "Result", future.Response(), "Polling failure") return } if !done { - return rr, autorest.NewError("web.AppsRestoreFuture", "Result", "asynchronous operation has not completed") + return rr, azure.NewAsyncOpIncompleteError("web.AppsRestoreFuture") } if future.PollingMethod() == azure.PollingLocation { rr, err = client.RestoreResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsRestoreFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsRestoreFuture", "Result", resp, "Failure sending request") return } rr, err = client.RestoreResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsRestoreFuture", "Result", resp, "Failure responding to request") + } return } @@ -3590,22 +4313,39 @@ func (future AppsRestoreSlotFuture) Result(client AppsClient) (rr RestoreRespons var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsRestoreSlotFuture", "Result", future.Response(), "Polling failure") return } if !done { - return rr, autorest.NewError("web.AppsRestoreSlotFuture", "Result", "asynchronous operation has not completed") + return rr, azure.NewAsyncOpIncompleteError("web.AppsRestoreSlotFuture") } if future.PollingMethod() == azure.PollingLocation { rr, err = client.RestoreSlotResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsRestoreSlotFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsRestoreSlotFuture", "Result", resp, "Failure sending request") return } rr, err = client.RestoreSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsRestoreSlotFuture", "Result", resp, "Failure responding to request") + } return } @@ -3621,22 +4361,39 @@ func (future AppsSwapSlotSlotFuture) Result(client AppsClient) (ar autorest.Resp var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsSwapSlotSlotFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("web.AppsSwapSlotSlotFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("web.AppsSwapSlotSlotFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.SwapSlotSlotResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsSwapSlotSlotFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsSwapSlotSlotFuture", "Result", resp, "Failure sending request") return } ar, err = client.SwapSlotSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsSwapSlotSlotFuture", "Result", resp, "Failure responding to request") + } return } @@ -3653,22 +4410,39 @@ func (future AppsSwapSlotWithProductionFuture) Result(client AppsClient) (ar aut var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsSwapSlotWithProductionFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("web.AppsSwapSlotWithProductionFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("web.AppsSwapSlotWithProductionFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.SwapSlotWithProductionResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsSwapSlotWithProductionFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsSwapSlotWithProductionFuture", "Result", resp, "Failure sending request") return } ar, err = client.SwapSlotWithProductionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsSwapSlotWithProductionFuture", "Result", resp, "Failure responding to request") + } return } @@ -3747,6 +4521,8 @@ type AzureTableStorageApplicationLogsConfig struct { // BackupItem backup description. type BackupItem struct { autorest.Response `json:"-"` + // BackupItemProperties - BackupItem resource specific properties + *BackupItemProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -3755,8 +4531,6 @@ type BackupItem struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // BackupItemProperties - BackupItem resource specific properties - *BackupItemProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for BackupItem struct. @@ -3766,56 +4540,54 @@ func (bi *BackupItem) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties BackupItemProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - bi.BackupItemProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - bi.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - bi.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - bi.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var backupItemProperties BackupItemProperties + err = json.Unmarshal(*v, &backupItemProperties) + if err != nil { + return err + } + bi.BackupItemProperties = &backupItemProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + bi.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + bi.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + bi.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + bi.Type = &typeVar + } } - bi.Type = &typeVar } return nil @@ -3958,6 +4730,8 @@ type BackupItemProperties struct { // BackupRequest description of a backup which will be performed. type BackupRequest struct { autorest.Response `json:"-"` + // BackupRequestProperties - BackupRequest resource specific properties + *BackupRequestProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -3966,8 +4740,6 @@ type BackupRequest struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // BackupRequestProperties - BackupRequest resource specific properties - *BackupRequestProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for BackupRequest struct. @@ -3977,56 +4749,54 @@ func (br *BackupRequest) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties BackupRequestProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - br.BackupRequestProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - br.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - br.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - br.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var backupRequestProperties BackupRequestProperties + err = json.Unmarshal(*v, &backupRequestProperties) + if err != nil { + return err + } + br.BackupRequestProperties = &backupRequestProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + br.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + br.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + br.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + br.Type = &typeVar + } } - br.Type = &typeVar } return nil @@ -4048,8 +4818,8 @@ type BackupRequestProperties struct { Type BackupRestoreOperationType `json:"type,omitempty"` } -// BackupSchedule description of a backup schedule. Describes how often should be the backup performed and what should -// be the retention policy. +// BackupSchedule description of a backup schedule. Describes how often should be the backup performed and what +// should be the retention policy. type BackupSchedule struct { // FrequencyInterval - How often the backup should be executed (e.g. for weekly backup, this should be set to 7 and FrequencyUnit should be set to Day) FrequencyInterval *int32 `json:"frequencyInterval,omitempty"` @@ -4078,6 +4848,8 @@ type Capability struct { // Certificate SSL certificate for an app. type Certificate struct { autorest.Response `json:"-"` + // CertificateProperties - Certificate resource specific properties + *CertificateProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -4089,88 +4861,109 @@ type Certificate struct { // Type - Resource type. Type *string `json:"type,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // CertificateProperties - Certificate resource specific properties - *CertificateProperties `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for Certificate struct. -func (c *Certificate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for Certificate. +func (c Certificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.CertificateProperties != nil { + objectMap["properties"] = c.CertificateProperties } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties CertificateProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - c.CertificateProperties = &properties + if c.ID != nil { + objectMap["id"] = c.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - c.ID = &ID + if c.Name != nil { + objectMap["name"] = c.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - c.Name = &name + if c.Kind != nil { + objectMap["kind"] = c.Kind } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - c.Kind = &kind + if c.Location != nil { + objectMap["location"] = c.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - c.Location = &location + if c.Type != nil { + objectMap["type"] = c.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - c.Type = &typeVar + if c.Tags != nil { + objectMap["tags"] = c.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for Certificate struct. +func (c *Certificate) 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 "properties": + if v != nil { + var certificateProperties CertificateProperties + err = json.Unmarshal(*v, &certificateProperties) + if err != nil { + return err + } + c.CertificateProperties = &certificateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + c.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + c.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + c.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + c.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + c.Tags = tags + } } - c.Tags = &tags } return nil @@ -4302,6 +5095,8 @@ type CertificateDetails struct { // CertificateEmail SSL certificate email. type CertificateEmail struct { + // CertificateEmailProperties - CertificateEmail resource specific properties + *CertificateEmailProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -4310,8 +5105,6 @@ type CertificateEmail struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // CertificateEmailProperties - CertificateEmail resource specific properties - *CertificateEmailProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for CertificateEmail struct. @@ -4321,56 +5114,54 @@ func (ce *CertificateEmail) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties CertificateEmailProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - ce.CertificateEmailProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - ce.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - ce.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - ce.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var certificateEmailProperties CertificateEmailProperties + err = json.Unmarshal(*v, &certificateEmailProperties) + if err != nil { + return err + } + ce.CertificateEmailProperties = &certificateEmailProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ce.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ce.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ce.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ce.Type = &typeVar + } } - ce.Type = &typeVar } return nil @@ -4386,6 +5177,8 @@ type CertificateEmailProperties struct { // CertificateOrderAction certificate order action. type CertificateOrderAction struct { + // CertificateOrderActionProperties - CertificateOrderAction resource specific properties + *CertificateOrderActionProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -4394,8 +5187,6 @@ type CertificateOrderAction struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // CertificateOrderActionProperties - CertificateOrderAction resource specific properties - *CertificateOrderActionProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for CertificateOrderAction struct. @@ -4405,56 +5196,54 @@ func (coa *CertificateOrderAction) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties CertificateOrderActionProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - coa.CertificateOrderActionProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - coa.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - coa.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - coa.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var certificateOrderActionProperties CertificateOrderActionProperties + err = json.Unmarshal(*v, &certificateOrderActionProperties) + if err != nil { + return err + } + coa.CertificateOrderActionProperties = &certificateOrderActionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + coa.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + coa.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + coa.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + coa.Type = &typeVar + } } - coa.Type = &typeVar } return nil @@ -4470,6 +5259,8 @@ type CertificateOrderActionProperties struct { // CertificatePatchResource ARM resource for a certificate. type CertificatePatchResource struct { + // CertificatePatchResourceProperties - CertificatePatchResource resource specific properties + *CertificatePatchResourceProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -4478,8 +5269,6 @@ type CertificatePatchResource struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // CertificatePatchResourceProperties - CertificatePatchResource resource specific properties - *CertificatePatchResourceProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for CertificatePatchResource struct. @@ -4489,56 +5278,54 @@ func (cpr *CertificatePatchResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties CertificatePatchResourceProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - cpr.CertificatePatchResourceProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - cpr.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - cpr.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - cpr.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var certificatePatchResourceProperties CertificatePatchResourceProperties + err = json.Unmarshal(*v, &certificatePatchResourceProperties) + if err != nil { + return err + } + cpr.CertificatePatchResourceProperties = &certificatePatchResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cpr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cpr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + cpr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cpr.Type = &typeVar + } } - cpr.Type = &typeVar } return nil @@ -4651,7 +5438,7 @@ type CloningInfo struct { HostingEnvironment *string `json:"hostingEnvironment,omitempty"` // AppSettingsOverrides - Application setting overrides for cloned app. If specified, these settings override the settings cloned // from source app. Otherwise, application settings from source app are retained. - AppSettingsOverrides *map[string]*string `json:"appSettingsOverrides,omitempty"` + AppSettingsOverrides map[string]*string `json:"appSettingsOverrides"` // ConfigureLoadBalancing - true to configure load balancing for source and destination app. ConfigureLoadBalancing *bool `json:"configureLoadBalancing,omitempty"` // TrafficManagerProfileID - ARM resource ID of the Traffic Manager profile to use, if it exists. Traffic Manager resource ID is of the form @@ -4663,9 +5450,50 @@ type CloningInfo struct { IgnoreQuotas *bool `json:"ignoreQuotas,omitempty"` } +// MarshalJSON is the custom marshaler for CloningInfo. +func (ci CloningInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ci.CorrelationID != nil { + objectMap["correlationId"] = ci.CorrelationID + } + if ci.Overwrite != nil { + objectMap["overwrite"] = ci.Overwrite + } + if ci.CloneCustomHostNames != nil { + objectMap["cloneCustomHostNames"] = ci.CloneCustomHostNames + } + if ci.CloneSourceControl != nil { + objectMap["cloneSourceControl"] = ci.CloneSourceControl + } + if ci.SourceWebAppID != nil { + objectMap["sourceWebAppId"] = ci.SourceWebAppID + } + if ci.HostingEnvironment != nil { + objectMap["hostingEnvironment"] = ci.HostingEnvironment + } + if ci.AppSettingsOverrides != nil { + objectMap["appSettingsOverrides"] = ci.AppSettingsOverrides + } + if ci.ConfigureLoadBalancing != nil { + objectMap["configureLoadBalancing"] = ci.ConfigureLoadBalancing + } + if ci.TrafficManagerProfileID != nil { + objectMap["trafficManagerProfileId"] = ci.TrafficManagerProfileID + } + if ci.TrafficManagerProfileName != nil { + objectMap["trafficManagerProfileName"] = ci.TrafficManagerProfileName + } + if ci.IgnoreQuotas != nil { + objectMap["ignoreQuotas"] = ci.IgnoreQuotas + } + return json.Marshal(objectMap) +} + // ConnectionStringDictionary string dictionary resource. type ConnectionStringDictionary struct { autorest.Response `json:"-"` + // Properties - Connection strings. + Properties map[string]*ConnStringValueTypePair `json:"properties"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -4674,8 +5502,27 @@ type ConnectionStringDictionary struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // Properties - Connection strings. - Properties *map[string]*ConnStringValueTypePair `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConnectionStringDictionary. +func (csd ConnectionStringDictionary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if csd.Properties != nil { + objectMap["properties"] = csd.Properties + } + if csd.ID != nil { + objectMap["id"] = csd.ID + } + if csd.Name != nil { + objectMap["name"] = csd.Name + } + if csd.Kind != nil { + objectMap["kind"] = csd.Kind + } + if csd.Type != nil { + objectMap["type"] = csd.Type + } + return json.Marshal(objectMap) } // ConnStringInfo database connection string information. @@ -4723,6 +5570,8 @@ type Contact struct { // ContinuousWebJob continuous Web Job Information. type ContinuousWebJob struct { autorest.Response `json:"-"` + // ContinuousWebJobProperties - ContinuousWebJob resource specific properties + *ContinuousWebJobProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -4731,8 +5580,6 @@ type ContinuousWebJob struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // ContinuousWebJobProperties - ContinuousWebJob resource specific properties - *ContinuousWebJobProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ContinuousWebJob struct. @@ -4742,56 +5589,54 @@ func (cwj *ContinuousWebJob) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ContinuousWebJobProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - cwj.ContinuousWebJobProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - cwj.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - cwj.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - cwj.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var continuousWebJobProperties ContinuousWebJobProperties + err = json.Unmarshal(*v, &continuousWebJobProperties) + if err != nil { + return err + } + cwj.ContinuousWebJobProperties = &continuousWebJobProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cwj.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cwj.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + cwj.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cwj.Type = &typeVar + } } - cwj.Type = &typeVar } return nil @@ -4922,7 +5767,42 @@ type ContinuousWebJobProperties struct { // UsingSdk - Using SDK? UsingSdk *bool `json:"usingSdk,omitempty"` // Settings - Job settings. - Settings *map[string]*map[string]interface{} `json:"settings,omitempty"` + Settings map[string]interface{} `json:"settings"` +} + +// MarshalJSON is the custom marshaler for ContinuousWebJobProperties. +func (cwj ContinuousWebJobProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["status"] = cwj.Status + if cwj.DetailedStatus != nil { + objectMap["detailedStatus"] = cwj.DetailedStatus + } + if cwj.LogURL != nil { + objectMap["logUrl"] = cwj.LogURL + } + if cwj.Name != nil { + objectMap["name"] = cwj.Name + } + if cwj.RunCommand != nil { + objectMap["runCommand"] = cwj.RunCommand + } + if cwj.URL != nil { + objectMap["url"] = cwj.URL + } + if cwj.ExtraInfoURL != nil { + objectMap["extraInfoUrl"] = cwj.ExtraInfoURL + } + objectMap["jobType"] = cwj.JobType + if cwj.Error != nil { + objectMap["error"] = cwj.Error + } + if cwj.UsingSdk != nil { + objectMap["usingSdk"] = cwj.UsingSdk + } + if cwj.Settings != nil { + objectMap["settings"] = cwj.Settings + } + return json.Marshal(objectMap) } // CorsSettings cross-Origin Resource Sharing (CORS) settings for the app. @@ -4932,8 +5812,8 @@ type CorsSettings struct { AllowedOrigins *[]string `json:"allowedOrigins,omitempty"` } -// CsmMoveResourceEnvelope object with a list of the resources that need to be moved and the resource group they should -// be moved to. +// CsmMoveResourceEnvelope object with a list of the resources that need to be moved and the resource group they +// should be moved to. type CsmMoveResourceEnvelope struct { TargetResourceGroup *string `json:"targetResourceGroup,omitempty"` Resources *[]string `json:"resources,omitempty"` @@ -5198,6 +6078,8 @@ func (page CsmUsageQuotaCollectionPage) Values() []CsmUsageQuota { // CustomHostnameAnalysisResult custom domain analysis. type CustomHostnameAnalysisResult struct { autorest.Response `json:"-"` + // CustomHostnameAnalysisResultProperties - CustomHostnameAnalysisResult resource specific properties + *CustomHostnameAnalysisResultProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -5206,8 +6088,6 @@ type CustomHostnameAnalysisResult struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // CustomHostnameAnalysisResultProperties - CustomHostnameAnalysisResult resource specific properties - *CustomHostnameAnalysisResultProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for CustomHostnameAnalysisResult struct. @@ -5217,56 +6097,54 @@ func (char *CustomHostnameAnalysisResult) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties CustomHostnameAnalysisResultProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - char.CustomHostnameAnalysisResultProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var customHostnameAnalysisResultProperties CustomHostnameAnalysisResultProperties + err = json.Unmarshal(*v, &customHostnameAnalysisResultProperties) + if err != nil { + return err + } + char.CustomHostnameAnalysisResultProperties = &customHostnameAnalysisResultProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + char.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + char.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + char.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + char.Type = &typeVar + } } - char.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - char.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - char.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - char.Type = &typeVar } return nil @@ -5439,6 +6317,8 @@ func (page DeletedWebAppCollectionPage) Values() []DeletedSite { // Deployment user crendentials used for publishing activity. type Deployment struct { autorest.Response `json:"-"` + // DeploymentProperties - Deployment resource specific properties + *DeploymentProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -5447,8 +6327,6 @@ type Deployment struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // DeploymentProperties - Deployment resource specific properties - *DeploymentProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for Deployment struct. @@ -5458,56 +6336,54 @@ func (d *Deployment) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties DeploymentProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - d.DeploymentProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - d.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - d.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - d.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var deploymentProperties DeploymentProperties + err = json.Unmarshal(*v, &deploymentProperties) + if err != nil { + return err + } + d.DeploymentProperties = &deploymentProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + d.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + d.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + d.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + d.Type = &typeVar + } } - d.Type = &typeVar } return nil @@ -5673,6 +6549,8 @@ type DetectorAbnormalTimePeriod struct { // DetectorDefinition class representing detector definition type DetectorDefinition struct { + // DetectorDefinitionProperties - DetectorDefinition resource specific properties + *DetectorDefinitionProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -5681,8 +6559,6 @@ type DetectorDefinition struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // DetectorDefinitionProperties - DetectorDefinition resource specific properties - *DetectorDefinitionProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for DetectorDefinition struct. @@ -5692,56 +6568,54 @@ func (dd *DetectorDefinition) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties DetectorDefinitionProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - dd.DetectorDefinitionProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - dd.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - dd.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - dd.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var detectorDefinitionProperties DetectorDefinitionProperties + err = json.Unmarshal(*v, &detectorDefinitionProperties) + if err != nil { + return err + } + dd.DetectorDefinitionProperties = &detectorDefinitionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dd.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + dd.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dd.Type = &typeVar + } } - dd.Type = &typeVar } return nil @@ -5762,6 +6636,8 @@ type DetectorDefinitionProperties struct { // DiagnosticAnalysis class representing a diagnostic analysis done on an application type DiagnosticAnalysis struct { autorest.Response `json:"-"` + // DiagnosticAnalysisProperties - DiagnosticAnalysis resource specific properties + *DiagnosticAnalysisProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -5770,8 +6646,6 @@ type DiagnosticAnalysis struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // DiagnosticAnalysisProperties - DiagnosticAnalysis resource specific properties - *DiagnosticAnalysisProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for DiagnosticAnalysis struct. @@ -5781,56 +6655,54 @@ func (da *DiagnosticAnalysis) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties DiagnosticAnalysisProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - da.DiagnosticAnalysisProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - da.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - da.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - da.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var diagnosticAnalysisProperties DiagnosticAnalysisProperties + err = json.Unmarshal(*v, &diagnosticAnalysisProperties) + if err != nil { + return err + } + da.DiagnosticAnalysisProperties = &diagnosticAnalysisProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + da.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + da.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + da.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + da.Type = &typeVar + } } - da.Type = &typeVar } return nil @@ -5955,6 +6827,8 @@ type DiagnosticAnalysisProperties struct { // DiagnosticCategory class representing detector definition type DiagnosticCategory struct { autorest.Response `json:"-"` + // DiagnosticCategoryProperties - DiagnosticCategory resource specific properties + *DiagnosticCategoryProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -5963,8 +6837,6 @@ type DiagnosticCategory struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // DiagnosticCategoryProperties - DiagnosticCategory resource specific properties - *DiagnosticCategoryProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for DiagnosticCategory struct. @@ -5974,56 +6846,54 @@ func (dc *DiagnosticCategory) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties DiagnosticCategoryProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - dc.DiagnosticCategoryProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - dc.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - dc.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - dc.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var diagnosticCategoryProperties DiagnosticCategoryProperties + err = json.Unmarshal(*v, &diagnosticCategoryProperties) + if err != nil { + return err + } + dc.DiagnosticCategoryProperties = &diagnosticCategoryProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dc.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + dc.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dc.Type = &typeVar + } } - dc.Type = &typeVar } return nil @@ -6242,6 +7112,8 @@ func (page DiagnosticDetectorCollectionPage) Values() []DetectorDefinition { // DiagnosticDetectorResponse class representing Reponse from Diagnostic Detectors type DiagnosticDetectorResponse struct { autorest.Response `json:"-"` + // DiagnosticDetectorResponseProperties - DiagnosticDetectorResponse resource specific properties + *DiagnosticDetectorResponseProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -6250,8 +7122,6 @@ type DiagnosticDetectorResponse struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // DiagnosticDetectorResponseProperties - DiagnosticDetectorResponse resource specific properties - *DiagnosticDetectorResponseProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for DiagnosticDetectorResponse struct. @@ -6261,56 +7131,54 @@ func (ddr *DiagnosticDetectorResponse) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties DiagnosticDetectorResponseProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - ddr.DiagnosticDetectorResponseProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - ddr.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - ddr.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - ddr.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var diagnosticDetectorResponseProperties DiagnosticDetectorResponseProperties + err = json.Unmarshal(*v, &diagnosticDetectorResponseProperties) + if err != nil { + return err + } + ddr.DiagnosticDetectorResponseProperties = &diagnosticDetectorResponseProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ddr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ddr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ddr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ddr.Type = &typeVar + } } - ddr.Type = &typeVar } return nil @@ -6383,6 +7251,8 @@ type Dimension struct { // Domain information about a domain. type Domain struct { autorest.Response `json:"-"` + // DomainProperties - Domain resource specific properties + *DomainProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -6394,88 +7264,109 @@ type Domain struct { // Type - Resource type. Type *string `json:"type,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // DomainProperties - Domain resource specific properties - *DomainProperties `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for Domain struct. -func (d *Domain) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for Domain. +func (d Domain) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if d.DomainProperties != nil { + objectMap["properties"] = d.DomainProperties } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties DomainProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - d.DomainProperties = &properties + if d.ID != nil { + objectMap["id"] = d.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - d.ID = &ID + if d.Name != nil { + objectMap["name"] = d.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - d.Name = &name + if d.Kind != nil { + objectMap["kind"] = d.Kind } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - d.Kind = &kind + if d.Location != nil { + objectMap["location"] = d.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - d.Location = &location + if d.Type != nil { + objectMap["type"] = d.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - d.Type = &typeVar + if d.Tags != nil { + objectMap["tags"] = d.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for Domain struct. +func (d *Domain) 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 "properties": + if v != nil { + var domainProperties DomainProperties + err = json.Unmarshal(*v, &domainProperties) + if err != nil { + return err + } + d.DomainProperties = &domainProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + d.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + d.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + d.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + d.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + d.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + d.Tags = tags + } } - d.Tags = &tags } return nil @@ -6608,6 +7499,8 @@ type DomainControlCenterSsoRequest struct { // DomainOwnershipIdentifier domain ownership Identifier. type DomainOwnershipIdentifier struct { autorest.Response `json:"-"` + // DomainOwnershipIdentifierProperties - DomainOwnershipIdentifier resource specific properties + *DomainOwnershipIdentifierProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -6616,8 +7509,6 @@ type DomainOwnershipIdentifier struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // DomainOwnershipIdentifierProperties - DomainOwnershipIdentifier resource specific properties - *DomainOwnershipIdentifierProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for DomainOwnershipIdentifier struct. @@ -6627,56 +7518,54 @@ func (doi *DomainOwnershipIdentifier) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties DomainOwnershipIdentifierProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - doi.DomainOwnershipIdentifierProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - doi.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - doi.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - doi.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var domainOwnershipIdentifierProperties DomainOwnershipIdentifierProperties + err = json.Unmarshal(*v, &domainOwnershipIdentifierProperties) + if err != nil { + return err + } + doi.DomainOwnershipIdentifierProperties = &domainOwnershipIdentifierProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + doi.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + doi.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + doi.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + doi.Type = &typeVar + } } - doi.Type = &typeVar } return nil @@ -6793,6 +7682,8 @@ type DomainOwnershipIdentifierProperties struct { // DomainPatchResource ARM resource for a domain. type DomainPatchResource struct { + // DomainPatchResourceProperties - DomainPatchResource resource specific properties + *DomainPatchResourceProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -6801,8 +7692,6 @@ type DomainPatchResource struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // DomainPatchResourceProperties - DomainPatchResource resource specific properties - *DomainPatchResourceProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for DomainPatchResource struct. @@ -6812,56 +7701,54 @@ func (dpr *DomainPatchResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties DomainPatchResourceProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - dpr.DomainPatchResourceProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - dpr.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - dpr.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - dpr.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var domainPatchResourceProperties DomainPatchResourceProperties + err = json.Unmarshal(*v, &domainPatchResourceProperties) + if err != nil { + return err + } + dpr.DomainPatchResourceProperties = &domainPatchResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dpr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dpr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + dpr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dpr.Type = &typeVar + } } - dpr.Type = &typeVar } return nil @@ -6973,7 +7860,8 @@ type DomainRecommendationSearchParameters struct { MaxDomainRecommendations *int32 `json:"maxDomainRecommendations,omitempty"` } -// DomainsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +// DomainsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type DomainsCreateOrUpdateFuture struct { azure.Future req *http.Request @@ -6985,22 +7873,39 @@ func (future DomainsCreateOrUpdateFuture) Result(client DomainsClient) (d Domain var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return d, autorest.NewError("web.DomainsCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return d, azure.NewAsyncOpIncompleteError("web.DomainsCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { d, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.ChangeToGet(future.req) + } + resp, err = autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } d, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -7026,6 +7931,14 @@ type ErrorEntity struct { Message *string `json:"message,omitempty"` } +// ErrorResponse error Response. +type ErrorResponse struct { + // Code - Error code. + Code *string `json:"code,omitempty"` + // Message - Error message indicating why the operation failed. + Message *string `json:"message,omitempty"` +} + // Experiments routing rules in production experiments. type Experiments struct { // RampUpRules - List of ramp-up rules. @@ -7055,6 +7968,8 @@ type FileSystemHTTPLogsConfig struct { // FunctionEnvelope web Job Information. type FunctionEnvelope struct { autorest.Response `json:"-"` + // FunctionEnvelopeProperties - FunctionEnvelope resource specific properties + *FunctionEnvelopeProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -7063,8 +7978,6 @@ type FunctionEnvelope struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // FunctionEnvelopeProperties - FunctionEnvelope resource specific properties - *FunctionEnvelopeProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for FunctionEnvelope struct. @@ -7074,56 +7987,54 @@ func (fe *FunctionEnvelope) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties FunctionEnvelopeProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - fe.FunctionEnvelopeProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - fe.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - fe.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - fe.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var functionEnvelopeProperties FunctionEnvelopeProperties + err = json.Unmarshal(*v, &functionEnvelopeProperties) + if err != nil { + return err + } + fe.FunctionEnvelopeProperties = &functionEnvelopeProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + fe.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + fe.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + fe.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + fe.Type = &typeVar + } } - fe.Type = &typeVar } return nil @@ -7248,16 +8159,52 @@ type FunctionEnvelopeProperties struct { // Href - Function URI. Href *string `json:"href,omitempty"` // Config - Config information. - Config *map[string]interface{} `json:"config,omitempty"` + Config interface{} `json:"config,omitempty"` // Files - File list. - Files *map[string]*string `json:"files,omitempty"` + Files map[string]*string `json:"files"` // TestData - Test data used when testing via the Azure Portal. TestData *string `json:"testData,omitempty"` } +// MarshalJSON is the custom marshaler for FunctionEnvelopeProperties. +func (fe FunctionEnvelopeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fe.Name != nil { + objectMap["name"] = fe.Name + } + if fe.FunctionAppID != nil { + objectMap["functionAppId"] = fe.FunctionAppID + } + if fe.ScriptRootPathHref != nil { + objectMap["scriptRootPathHref"] = fe.ScriptRootPathHref + } + if fe.ScriptHref != nil { + objectMap["scriptHref"] = fe.ScriptHref + } + if fe.ConfigHref != nil { + objectMap["configHref"] = fe.ConfigHref + } + if fe.SecretsFileHref != nil { + objectMap["secretsFileHref"] = fe.SecretsFileHref + } + if fe.Href != nil { + objectMap["href"] = fe.Href + } + objectMap["config"] = fe.Config + if fe.Files != nil { + objectMap["files"] = fe.Files + } + if fe.TestData != nil { + objectMap["testData"] = fe.TestData + } + return json.Marshal(objectMap) +} + // FunctionSecrets function secrets. type FunctionSecrets struct { autorest.Response `json:"-"` + // FunctionSecretsProperties - FunctionSecrets resource specific properties + *FunctionSecretsProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -7266,8 +8213,6 @@ type FunctionSecrets struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // FunctionSecretsProperties - FunctionSecrets resource specific properties - *FunctionSecretsProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for FunctionSecrets struct. @@ -7277,56 +8222,54 @@ func (fs *FunctionSecrets) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties FunctionSecretsProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var functionSecretsProperties FunctionSecretsProperties + err = json.Unmarshal(*v, &functionSecretsProperties) + if err != nil { + return err + } + fs.FunctionSecretsProperties = &functionSecretsProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + fs.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + fs.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + fs.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + fs.Type = &typeVar + } } - fs.FunctionSecretsProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - fs.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - fs.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - fs.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - fs.Type = &typeVar } return nil @@ -7342,6 +8285,8 @@ type FunctionSecretsProperties struct { // GeoRegion geographical region. type GeoRegion struct { + // GeoRegionProperties - GeoRegion resource specific properties + *GeoRegionProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -7350,8 +8295,6 @@ type GeoRegion struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // GeoRegionProperties - GeoRegion resource specific properties - *GeoRegionProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for GeoRegion struct. @@ -7361,56 +8304,54 @@ func (gr *GeoRegion) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties GeoRegionProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - gr.GeoRegionProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - gr.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - gr.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - gr.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var geoRegionProperties GeoRegionProperties + err = json.Unmarshal(*v, &geoRegionProperties) + if err != nil { + return err + } + gr.GeoRegionProperties = &geoRegionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + gr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + gr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + gr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + gr.Type = &typeVar + } } - gr.Type = &typeVar } return nil @@ -7546,7 +8487,8 @@ type GlobalCsmSkuDescription struct { Capabilities *[]Capability `json:"capabilities,omitempty"` } -// HandlerMapping the IIS handler mappings used to define which handler processes HTTP requests with certain extension. +// HandlerMapping the IIS handler mappings used to define which handler processes HTTP requests with certain +// extension. // For example, it is used to configure php-cgi.exe process to handle all HTTP requests with *.php extension. type HandlerMapping struct { // Extension - Requests with this extension will be handled using the specified FastCGI application. @@ -7603,6 +8545,8 @@ type HostName struct { // HostNameBinding a hostname binding object. type HostNameBinding struct { autorest.Response `json:"-"` + // HostNameBindingProperties - HostNameBinding resource specific properties + *HostNameBindingProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -7611,8 +8555,6 @@ type HostNameBinding struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // HostNameBindingProperties - HostNameBinding resource specific properties - *HostNameBindingProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for HostNameBinding struct. @@ -7622,56 +8564,54 @@ func (hnb *HostNameBinding) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties HostNameBindingProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - hnb.HostNameBindingProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - hnb.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - hnb.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - hnb.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var hostNameBindingProperties HostNameBindingProperties + err = json.Unmarshal(*v, &hostNameBindingProperties) + if err != nil { + return err + } + hnb.HostNameBindingProperties = &hostNameBindingProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + hnb.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + hnb.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + hnb.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + hnb.Type = &typeVar + } } - hnb.Type = &typeVar } return nil @@ -7828,6 +8768,8 @@ type HTTPLogsConfig struct { // HybridConnection hybrid Connection contract. This is used to configure a Hybrid Connection. type HybridConnection struct { autorest.Response `json:"-"` + // HybridConnectionProperties - HybridConnection resource specific properties + *HybridConnectionProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -7836,8 +8778,6 @@ type HybridConnection struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // HybridConnectionProperties - HybridConnection resource specific properties - *HybridConnectionProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for HybridConnection struct. @@ -7847,56 +8787,54 @@ func (hc *HybridConnection) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties HybridConnectionProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - hc.HybridConnectionProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - hc.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - hc.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - hc.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var hybridConnectionProperties HybridConnectionProperties + err = json.Unmarshal(*v, &hybridConnectionProperties) + if err != nil { + return err + } + hc.HybridConnectionProperties = &hybridConnectionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + hc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + hc.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + hc.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + hc.Type = &typeVar + } } - hc.Type = &typeVar } return nil @@ -8004,9 +8942,12 @@ func (page HybridConnectionCollectionPage) Values() []HybridConnection { return *page.hcc.Value } -// HybridConnectionKey hybrid Connection key contract. This has the send key name and value for a Hybrid Connection. +// HybridConnectionKey hybrid Connection key contract. This has the send key name and value for a Hybrid +// Connection. type HybridConnectionKey struct { autorest.Response `json:"-"` + // HybridConnectionKeyProperties - HybridConnectionKey resource specific properties + *HybridConnectionKeyProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -8015,8 +8956,6 @@ type HybridConnectionKey struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // HybridConnectionKeyProperties - HybridConnectionKey resource specific properties - *HybridConnectionKeyProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for HybridConnectionKey struct. @@ -8026,56 +8965,54 @@ func (hck *HybridConnectionKey) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties HybridConnectionKeyProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - hck.HybridConnectionKeyProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - hck.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - hck.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - hck.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var hybridConnectionKeyProperties HybridConnectionKeyProperties + err = json.Unmarshal(*v, &hybridConnectionKeyProperties) + if err != nil { + return err + } + hck.HybridConnectionKeyProperties = &hybridConnectionKeyProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + hck.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + hck.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + hck.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + hck.Type = &typeVar + } } - hck.Type = &typeVar } return nil @@ -8093,6 +9030,8 @@ type HybridConnectionKeyProperties struct { // Connections. type HybridConnectionLimits struct { autorest.Response `json:"-"` + // HybridConnectionLimitsProperties - HybridConnectionLimits resource specific properties + *HybridConnectionLimitsProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -8101,8 +9040,6 @@ type HybridConnectionLimits struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // HybridConnectionLimitsProperties - HybridConnectionLimits resource specific properties - *HybridConnectionLimitsProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for HybridConnectionLimits struct. @@ -8112,56 +9049,54 @@ func (hcl *HybridConnectionLimits) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties HybridConnectionLimitsProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - hcl.HybridConnectionLimitsProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - hcl.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - hcl.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - hcl.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var hybridConnectionLimitsProperties HybridConnectionLimitsProperties + err = json.Unmarshal(*v, &hybridConnectionLimitsProperties) + if err != nil { + return err + } + hcl.HybridConnectionLimitsProperties = &hybridConnectionLimitsProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + hcl.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + hcl.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + hcl.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + hcl.Type = &typeVar + } } - hcl.Type = &typeVar } return nil @@ -8199,6 +9134,8 @@ type HybridConnectionProperties struct { // Identifier a domain specific resource identifier. type Identifier struct { autorest.Response `json:"-"` + // IdentifierProperties - Identifier resource specific properties + *IdentifierProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -8207,8 +9144,6 @@ type Identifier struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // IdentifierProperties - Identifier resource specific properties - *IdentifierProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for Identifier struct. @@ -8218,56 +9153,54 @@ func (i *Identifier) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties IdentifierProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - i.IdentifierProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - i.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - i.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - i.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var identifierProperties IdentifierProperties + err = json.Unmarshal(*v, &identifierProperties) + if err != nil { + return err + } + i.IdentifierProperties = &identifierProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + i.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + i.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + i.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + i.Type = &typeVar + } } - i.Type = &typeVar } return nil @@ -8392,6 +9325,8 @@ type IPSecurityRestriction struct { // Job web Job Information. type Job struct { autorest.Response `json:"-"` + // JobProperties - WebJob resource specific properties + *JobProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -8400,8 +9335,6 @@ type Job struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // JobProperties - WebJob resource specific properties - *JobProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for Job struct. @@ -8411,56 +9344,54 @@ func (j *Job) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties JobProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - j.JobProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - j.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - j.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - j.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var jobProperties JobProperties + err = json.Unmarshal(*v, &jobProperties) + if err != nil { + return err + } + j.JobProperties = &jobProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + j.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + j.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + j.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + j.Type = &typeVar + } } - j.Type = &typeVar } return nil @@ -8585,7 +9516,35 @@ type JobProperties struct { // UsingSdk - Using SDK? UsingSdk *bool `json:"usingSdk,omitempty"` // Settings - Job settings. - Settings *map[string]*map[string]interface{} `json:"settings,omitempty"` + Settings map[string]interface{} `json:"settings"` +} + +// MarshalJSON is the custom marshaler for JobProperties. +func (j JobProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if j.Name != nil { + objectMap["name"] = j.Name + } + if j.RunCommand != nil { + objectMap["runCommand"] = j.RunCommand + } + if j.URL != nil { + objectMap["url"] = j.URL + } + if j.ExtraInfoURL != nil { + objectMap["extraInfoUrl"] = j.ExtraInfoURL + } + objectMap["jobType"] = j.JobType + if j.Error != nil { + objectMap["error"] = j.Error + } + if j.UsingSdk != nil { + objectMap["usingSdk"] = j.UsingSdk + } + if j.Settings != nil { + objectMap["settings"] = j.Settings + } + return json.Marshal(objectMap) } // ListCapability ... @@ -8647,7 +9606,7 @@ type LocalizableString struct { // ManagedServiceIdentity managed service identity. type ManagedServiceIdentity struct { // Type - Type of managed service identity. - Type *map[string]interface{} `json:"type,omitempty"` + Type interface{} `json:"type,omitempty"` // TenantID - Tenant of managed service identity. TenantID *string `json:"tenantId,omitempty"` // PrincipalID - Principal Id of managed service identity. @@ -8671,6 +9630,8 @@ type MetricAvailability struct { // MetricDefinition metadata for a metric. type MetricDefinition struct { autorest.Response `json:"-"` + // MetricDefinitionProperties - MetricDefinition resource specific properties + *MetricDefinitionProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -8679,8 +9640,6 @@ type MetricDefinition struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // MetricDefinitionProperties - MetricDefinition resource specific properties - *MetricDefinitionProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for MetricDefinition struct. @@ -8690,56 +9649,54 @@ func (md *MetricDefinition) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties MetricDefinitionProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - md.MetricDefinitionProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - md.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - md.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - md.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var metricDefinitionProperties MetricDefinitionProperties + err = json.Unmarshal(*v, &metricDefinitionProperties) + if err != nil { + return err + } + md.MetricDefinitionProperties = &metricDefinitionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + md.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + md.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + md.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + md.Type = &typeVar + } } - md.Type = &typeVar } return nil @@ -8780,6 +9737,8 @@ type MetricSpecification struct { // MigrateMySQLRequest mySQL migration request. type MigrateMySQLRequest struct { + // MigrateMySQLRequestProperties - MigrateMySqlRequest resource specific properties + *MigrateMySQLRequestProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -8788,8 +9747,6 @@ type MigrateMySQLRequest struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // MigrateMySQLRequestProperties - MigrateMySqlRequest resource specific properties - *MigrateMySQLRequestProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for MigrateMySQLRequest struct. @@ -8799,56 +9756,54 @@ func (mmsr *MigrateMySQLRequest) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties MigrateMySQLRequestProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - mmsr.MigrateMySQLRequestProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - mmsr.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - mmsr.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - mmsr.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var migrateMySQLRequestProperties MigrateMySQLRequestProperties + err = json.Unmarshal(*v, &migrateMySQLRequestProperties) + if err != nil { + return err + } + mmsr.MigrateMySQLRequestProperties = &migrateMySQLRequestProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mmsr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mmsr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + mmsr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mmsr.Type = &typeVar + } } - mmsr.Type = &typeVar } return nil @@ -8865,6 +9820,8 @@ type MigrateMySQLRequestProperties struct { // MigrateMySQLStatus mySQL migration status. type MigrateMySQLStatus struct { autorest.Response `json:"-"` + // MigrateMySQLStatusProperties - MigrateMySqlStatus resource specific properties + *MigrateMySQLStatusProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -8873,8 +9830,6 @@ type MigrateMySQLStatus struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // MigrateMySQLStatusProperties - MigrateMySqlStatus resource specific properties - *MigrateMySQLStatusProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for MigrateMySQLStatus struct. @@ -8884,56 +9839,54 @@ func (mmss *MigrateMySQLStatus) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties MigrateMySQLStatusProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - mmss.MigrateMySQLStatusProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - mmss.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - mmss.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - mmss.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var migrateMySQLStatusProperties MigrateMySQLStatusProperties + err = json.Unmarshal(*v, &migrateMySQLStatusProperties) + if err != nil { + return err + } + mmss.MigrateMySQLStatusProperties = &migrateMySQLStatusProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mmss.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mmss.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + mmss.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mmss.Type = &typeVar + } } - mmss.Type = &typeVar } return nil @@ -8951,6 +9904,8 @@ type MigrateMySQLStatusProperties struct { // MSDeploy mSDeploy ARM PUT information type MSDeploy struct { + // MSDeployCore - Core resource properties + *MSDeployCore `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -8959,8 +9914,6 @@ type MSDeploy struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // MSDeployCore - Core resource properties - *MSDeployCore `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for MSDeploy struct. @@ -8970,60 +9923,58 @@ func (md *MSDeploy) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties MSDeployCore - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var mSDeployCore MSDeployCore + err = json.Unmarshal(*v, &mSDeployCore) + if err != nil { + return err + } + md.MSDeployCore = &mSDeployCore + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + md.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + md.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + md.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + md.Type = &typeVar + } } - md.MSDeployCore = &properties } - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - md.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - md.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - md.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - md.Type = &typeVar - } - - return nil -} + return nil +} // MSDeployCore mSDeploy ARM PUT core information type MSDeployCore struct { @@ -9036,7 +9987,7 @@ type MSDeployCore struct { // SetParametersXMLFileURI - URI of MSDeploy Parameters file. Must not be set if SetParameters is used. SetParametersXMLFileURI *string `json:"setParametersXmlFileUri,omitempty"` // SetParameters - MSDeploy Parameters. Must not be set if SetParametersXmlFileUri is used. - SetParameters *map[string]*string `json:"setParameters,omitempty"` + SetParameters map[string]*string `json:"setParameters"` // SkipAppData - Controls whether the MSDeploy operation skips the App_Data directory. // If set to true, the existing App_Data directory on the destination // will not be deleted, and any App_Data directory in the source will be ignored. @@ -9047,9 +9998,38 @@ type MSDeployCore struct { AppOffline *bool `json:"appOffline,omitempty"` } +// MarshalJSON is the custom marshaler for MSDeployCore. +func (mdc MSDeployCore) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mdc.PackageURI != nil { + objectMap["packageUri"] = mdc.PackageURI + } + if mdc.ConnectionString != nil { + objectMap["connectionString"] = mdc.ConnectionString + } + if mdc.DbType != nil { + objectMap["dbType"] = mdc.DbType + } + if mdc.SetParametersXMLFileURI != nil { + objectMap["setParametersXmlFileUri"] = mdc.SetParametersXMLFileURI + } + if mdc.SetParameters != nil { + objectMap["setParameters"] = mdc.SetParameters + } + if mdc.SkipAppData != nil { + objectMap["skipAppData"] = mdc.SkipAppData + } + if mdc.AppOffline != nil { + objectMap["appOffline"] = mdc.AppOffline + } + return json.Marshal(objectMap) +} + // MSDeployLog mSDeploy log type MSDeployLog struct { autorest.Response `json:"-"` + // MSDeployLogProperties - MSDeployLog resource specific properties + *MSDeployLogProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -9058,8 +10038,6 @@ type MSDeployLog struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // MSDeployLogProperties - MSDeployLog resource specific properties - *MSDeployLogProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for MSDeployLog struct. @@ -9069,56 +10047,54 @@ func (mdl *MSDeployLog) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties MSDeployLogProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - mdl.MSDeployLogProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - mdl.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - mdl.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - mdl.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var mSDeployLogProperties MSDeployLogProperties + err = json.Unmarshal(*v, &mSDeployLogProperties) + if err != nil { + return err + } + mdl.MSDeployLogProperties = &mSDeployLogProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mdl.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mdl.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + mdl.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mdl.Type = &typeVar + } } - mdl.Type = &typeVar } return nil @@ -9143,6 +10119,8 @@ type MSDeployLogProperties struct { // MSDeployStatus mSDeploy ARM response type MSDeployStatus struct { autorest.Response `json:"-"` + // MSDeployStatusProperties - MSDeployStatus resource specific properties + *MSDeployStatusProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -9151,8 +10129,6 @@ type MSDeployStatus struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // MSDeployStatusProperties - MSDeployStatus resource specific properties - *MSDeployStatusProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for MSDeployStatus struct. @@ -9162,56 +10138,54 @@ func (mds *MSDeployStatus) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties MSDeployStatusProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - mds.MSDeployStatusProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - mds.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - mds.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - mds.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var mSDeployStatusProperties MSDeployStatusProperties + err = json.Unmarshal(*v, &mSDeployStatusProperties) + if err != nil { + return err + } + mds.MSDeployStatusProperties = &mSDeployStatusProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mds.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + mds.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mds.Type = &typeVar + } } - mds.Type = &typeVar } return nil @@ -9362,6 +10336,8 @@ type NetworkAccessControlEntry struct { // NetworkFeatures full view of network features for an app (presently VNET integration and Hybrid Connections). type NetworkFeatures struct { autorest.Response `json:"-"` + // NetworkFeaturesProperties - NetworkFeatures resource specific properties + *NetworkFeaturesProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -9370,8 +10346,6 @@ type NetworkFeatures struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // NetworkFeaturesProperties - NetworkFeatures resource specific properties - *NetworkFeaturesProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for NetworkFeatures struct. @@ -9381,56 +10355,54 @@ func (nf *NetworkFeatures) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties NetworkFeaturesProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - nf.NetworkFeaturesProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - nf.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - nf.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - nf.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var networkFeaturesProperties NetworkFeaturesProperties + err = json.Unmarshal(*v, &networkFeaturesProperties) + if err != nil { + return err + } + nf.NetworkFeaturesProperties = &networkFeaturesProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + nf.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + nf.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + nf.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + nf.Type = &typeVar + } } - nf.Type = &typeVar } return nil @@ -9610,6 +10582,8 @@ type PerfMonSet struct { // PremierAddOn premier add-on. type PremierAddOn struct { autorest.Response `json:"-"` + // PremierAddOnProperties - PremierAddOn resource specific properties + *PremierAddOnProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -9621,88 +10595,109 @@ type PremierAddOn struct { // Type - Resource type. Type *string `json:"type,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // PremierAddOnProperties - PremierAddOn resource specific properties - *PremierAddOnProperties `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for PremierAddOn struct. -func (pao *PremierAddOn) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for PremierAddOn. +func (pao PremierAddOn) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pao.PremierAddOnProperties != nil { + objectMap["properties"] = pao.PremierAddOnProperties } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties PremierAddOnProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - pao.PremierAddOnProperties = &properties + if pao.ID != nil { + objectMap["id"] = pao.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - pao.ID = &ID + if pao.Name != nil { + objectMap["name"] = pao.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - pao.Name = &name + if pao.Kind != nil { + objectMap["kind"] = pao.Kind } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - pao.Kind = &kind + if pao.Location != nil { + objectMap["location"] = pao.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - pao.Location = &location + if pao.Type != nil { + objectMap["type"] = pao.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - pao.Type = &typeVar + if pao.Tags != nil { + objectMap["tags"] = pao.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for PremierAddOn struct. +func (pao *PremierAddOn) 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 "properties": + if v != nil { + var premierAddOnProperties PremierAddOnProperties + err = json.Unmarshal(*v, &premierAddOnProperties) + if err != nil { + return err + } + pao.PremierAddOnProperties = &premierAddOnProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pao.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pao.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + pao.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + pao.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pao.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + pao.Tags = tags + } } - pao.Tags = &tags } return nil @@ -9710,6 +10705,8 @@ func (pao *PremierAddOn) UnmarshalJSON(body []byte) error { // PremierAddOnOffer premier add-on offer. type PremierAddOnOffer struct { + // PremierAddOnOfferProperties - PremierAddOnOffer resource specific properties + *PremierAddOnOfferProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -9718,8 +10715,6 @@ type PremierAddOnOffer struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // PremierAddOnOfferProperties - PremierAddOnOffer resource specific properties - *PremierAddOnOfferProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for PremierAddOnOffer struct. @@ -9729,56 +10724,54 @@ func (paoo *PremierAddOnOffer) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties PremierAddOnOfferProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - paoo.PremierAddOnOfferProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - paoo.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - paoo.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - paoo.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var premierAddOnOfferProperties PremierAddOnOfferProperties + err = json.Unmarshal(*v, &premierAddOnOfferProperties) + if err != nil { + return err + } + paoo.PremierAddOnOfferProperties = &premierAddOnOfferProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + paoo.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + paoo.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + paoo.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + paoo.Type = &typeVar + } } - paoo.Type = &typeVar } return nil @@ -9925,16 +10918,48 @@ type PremierAddOnProperties struct { // Location - Premier add on Location. Location *string `json:"location,omitempty"` // Tags - Premier add on Tags. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` // MarketplacePublisher - Premier add on Marketplace publisher. MarketplacePublisher *string `json:"marketplacePublisher,omitempty"` // MarketplaceOffer - Premier add on Marketplace offer. MarketplaceOffer *string `json:"marketplaceOffer,omitempty"` } +// MarshalJSON is the custom marshaler for PremierAddOnProperties. +func (pao PremierAddOnProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pao.Sku != nil { + objectMap["sku"] = pao.Sku + } + if pao.Product != nil { + objectMap["product"] = pao.Product + } + if pao.Vendor != nil { + objectMap["vendor"] = pao.Vendor + } + if pao.PremierAddOnName != nil { + objectMap["name"] = pao.PremierAddOnName + } + if pao.Location != nil { + objectMap["location"] = pao.Location + } + if pao.Tags != nil { + objectMap["tags"] = pao.Tags + } + if pao.MarketplacePublisher != nil { + objectMap["marketplacePublisher"] = pao.MarketplacePublisher + } + if pao.MarketplaceOffer != nil { + objectMap["marketplaceOffer"] = pao.MarketplaceOffer + } + return json.Marshal(objectMap) +} + // ProcessInfo process Information. type ProcessInfo struct { autorest.Response `json:"-"` + // ProcessInfoProperties - ProcessInfo resource specific properties + *ProcessInfoProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -9943,8 +10968,6 @@ type ProcessInfo struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // ProcessInfoProperties - ProcessInfo resource specific properties - *ProcessInfoProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ProcessInfo struct. @@ -9954,56 +10977,54 @@ func (pi *ProcessInfo) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ProcessInfoProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - pi.ProcessInfoProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - pi.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - pi.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - pi.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var processInfoProperties ProcessInfoProperties + err = json.Unmarshal(*v, &processInfoProperties) + if err != nil { + return err + } + pi.ProcessInfoProperties = &processInfoProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pi.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pi.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + pi.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pi.Type = &typeVar + } } - pi.Type = &typeVar } return nil @@ -10178,7 +11199,7 @@ type ProcessInfoProperties struct { // TimeStamp - Time stamp. TimeStamp *date.Time `json:"timeStamp,omitempty"` // EnvironmentVariables - List of environment variables. - EnvironmentVariables *map[string]*string `json:"environmentVariables,omitempty"` + EnvironmentVariables map[string]*string `json:"environmentVariables"` // IsScmSite - Is this the SCM site? IsScmSite *bool `json:"isScmSite,omitempty"` // IsWebJob - Is this a Web Job? @@ -10187,9 +11208,125 @@ type ProcessInfoProperties struct { Description *string `json:"description,omitempty"` } +// MarshalJSON is the custom marshaler for ProcessInfoProperties. +func (pi ProcessInfoProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pi.ID != nil { + objectMap["id"] = pi.ID + } + if pi.Name != nil { + objectMap["name"] = pi.Name + } + if pi.Href != nil { + objectMap["href"] = pi.Href + } + if pi.MiniDump != nil { + objectMap["miniDump"] = pi.MiniDump + } + if pi.IsProfileRunning != nil { + objectMap["isProfileRunning"] = pi.IsProfileRunning + } + if pi.IsIisProfileRunning != nil { + objectMap["isIisProfileRunning"] = pi.IsIisProfileRunning + } + if pi.IisProfileTimeoutInSeconds != nil { + objectMap["iisProfileTimeoutInSeconds"] = pi.IisProfileTimeoutInSeconds + } + if pi.Parent != nil { + objectMap["parent"] = pi.Parent + } + if pi.Children != nil { + objectMap["children"] = pi.Children + } + if pi.Threads != nil { + objectMap["threads"] = pi.Threads + } + if pi.OpenFileHandles != nil { + objectMap["openFileHandles"] = pi.OpenFileHandles + } + if pi.Modules != nil { + objectMap["modules"] = pi.Modules + } + if pi.FileName != nil { + objectMap["fileName"] = pi.FileName + } + if pi.CommandLine != nil { + objectMap["commandLine"] = pi.CommandLine + } + if pi.UserName != nil { + objectMap["userName"] = pi.UserName + } + if pi.HandleCount != nil { + objectMap["handleCount"] = pi.HandleCount + } + if pi.ModuleCount != nil { + objectMap["moduleCount"] = pi.ModuleCount + } + if pi.ThreadCount != nil { + objectMap["threadCount"] = pi.ThreadCount + } + if pi.StartTime != nil { + objectMap["startTime"] = pi.StartTime + } + if pi.TotalProcessorTime != nil { + objectMap["totalProcessorTime"] = pi.TotalProcessorTime + } + if pi.UserProcessorTime != nil { + objectMap["userProcessorTime"] = pi.UserProcessorTime + } + if pi.PrivilegedProcessorTime != nil { + objectMap["privilegedProcessorTime"] = pi.PrivilegedProcessorTime + } + if pi.WorkingSet64 != nil { + objectMap["workingSet64"] = pi.WorkingSet64 + } + if pi.PeakWorkingSet64 != nil { + objectMap["peakWorkingSet64"] = pi.PeakWorkingSet64 + } + if pi.PrivateMemorySize64 != nil { + objectMap["privateMemorySize64"] = pi.PrivateMemorySize64 + } + if pi.VirtualMemorySize64 != nil { + objectMap["virtualMemorySize64"] = pi.VirtualMemorySize64 + } + if pi.PeakVirtualMemorySize64 != nil { + objectMap["peakVirtualMemorySize64"] = pi.PeakVirtualMemorySize64 + } + if pi.PagedSystemMemorySize64 != nil { + objectMap["pagedSystemMemorySize64"] = pi.PagedSystemMemorySize64 + } + if pi.NonpagedSystemMemorySize64 != nil { + objectMap["nonpagedSystemMemorySize64"] = pi.NonpagedSystemMemorySize64 + } + if pi.PagedMemorySize64 != nil { + objectMap["pagedMemorySize64"] = pi.PagedMemorySize64 + } + if pi.PeakPagedMemorySize64 != nil { + objectMap["peakPagedMemorySize64"] = pi.PeakPagedMemorySize64 + } + if pi.TimeStamp != nil { + objectMap["timeStamp"] = pi.TimeStamp + } + if pi.EnvironmentVariables != nil { + objectMap["environmentVariables"] = pi.EnvironmentVariables + } + if pi.IsScmSite != nil { + objectMap["isScmSite"] = pi.IsScmSite + } + if pi.IsWebJob != nil { + objectMap["isWebJob"] = pi.IsWebJob + } + if pi.Description != nil { + objectMap["description"] = pi.Description + } + return json.Marshal(objectMap) +} + // ProcessModuleInfo process Module Information. type ProcessModuleInfo struct { autorest.Response `json:"-"` + // ProcessModuleInfoProperties - ProcessModuleInfo resource specific properties + *ProcessModuleInfoProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -10198,8 +11335,6 @@ type ProcessModuleInfo struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // ProcessModuleInfoProperties - ProcessModuleInfo resource specific properties - *ProcessModuleInfoProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ProcessModuleInfo struct. @@ -10209,56 +11344,54 @@ func (pmi *ProcessModuleInfo) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ProcessModuleInfoProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - pmi.ProcessModuleInfoProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - pmi.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - pmi.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - pmi.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var processModuleInfoProperties ProcessModuleInfoProperties + err = json.Unmarshal(*v, &processModuleInfoProperties) + if err != nil { + return err + } + pmi.ProcessModuleInfoProperties = &processModuleInfoProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pmi.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pmi.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + pmi.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pmi.Type = &typeVar + } } - pmi.Type = &typeVar } return nil @@ -10395,6 +11528,8 @@ type ProcessModuleInfoProperties struct { // ProcessThreadInfo process Thread Information. type ProcessThreadInfo struct { autorest.Response `json:"-"` + // ProcessThreadInfoProperties - ProcessThreadInfo resource specific properties + *ProcessThreadInfoProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -10403,8 +11538,6 @@ type ProcessThreadInfo struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // ProcessThreadInfoProperties - ProcessThreadInfo resource specific properties - *ProcessThreadInfoProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ProcessThreadInfo struct. @@ -10414,60 +11547,58 @@ func (pti *ProcessThreadInfo) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ProcessThreadInfoProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - pti.ProcessThreadInfoProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var processThreadInfoProperties ProcessThreadInfoProperties + err = json.Unmarshal(*v, &processThreadInfoProperties) + if err != nil { + return err + } + pti.ProcessThreadInfoProperties = &processThreadInfoProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pti.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pti.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + pti.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pti.Type = &typeVar + } } - pti.ID = &ID } - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - pti.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - pti.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - pti.Type = &typeVar - } - - return nil -} + return nil +} // ProcessThreadInfoCollection collection of Kudu thread information elements. type ProcessThreadInfoCollection struct { @@ -10616,6 +11747,8 @@ type ProxyOnlyResource struct { // PublicCertificate public certificate object type PublicCertificate struct { autorest.Response `json:"-"` + // PublicCertificateProperties - PublicCertificate resource specific properties + *PublicCertificateProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -10624,8 +11757,6 @@ type PublicCertificate struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // PublicCertificateProperties - PublicCertificate resource specific properties - *PublicCertificateProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for PublicCertificate struct. @@ -10635,56 +11766,54 @@ func (pc *PublicCertificate) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties PublicCertificateProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - pc.PublicCertificateProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - pc.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - pc.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - pc.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var publicCertificateProperties PublicCertificateProperties + err = json.Unmarshal(*v, &publicCertificateProperties) + if err != nil { + return err + } + pc.PublicCertificateProperties = &publicCertificateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pc.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + pc.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pc.Type = &typeVar + } } - pc.Type = &typeVar } return nil @@ -10805,6 +11934,8 @@ type PublicCertificateProperties struct { // PushSettings push settings for the App. type PushSettings struct { autorest.Response `json:"-"` + // PushSettingsProperties - PushSettings resource specific properties + *PushSettingsProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -10813,8 +11944,6 @@ type PushSettings struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // PushSettingsProperties - PushSettings resource specific properties - *PushSettingsProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for PushSettings struct. @@ -10824,56 +11953,54 @@ func (ps *PushSettings) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties PushSettingsProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - ps.PushSettingsProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - ps.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - ps.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - ps.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var pushSettingsProperties PushSettingsProperties + err = json.Unmarshal(*v, &pushSettingsProperties) + if err != nil { + return err + } + ps.PushSettingsProperties = &pushSettingsProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ps.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ps.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ps.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ps.Type = &typeVar + } } - ps.Type = &typeVar } return nil @@ -11004,6 +12131,8 @@ type RecommendationRule struct { // ReissueCertificateOrderRequest class representing certificate reissue request. type ReissueCertificateOrderRequest struct { + // ReissueCertificateOrderRequestProperties - ReissueCertificateOrderRequest resource specific properties + *ReissueCertificateOrderRequestProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -11012,8 +12141,6 @@ type ReissueCertificateOrderRequest struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // ReissueCertificateOrderRequestProperties - ReissueCertificateOrderRequest resource specific properties - *ReissueCertificateOrderRequestProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ReissueCertificateOrderRequest struct. @@ -11023,56 +12150,54 @@ func (rcor *ReissueCertificateOrderRequest) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ReissueCertificateOrderRequestProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - rcor.ReissueCertificateOrderRequestProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - rcor.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - rcor.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - rcor.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var reissueCertificateOrderRequestProperties ReissueCertificateOrderRequestProperties + err = json.Unmarshal(*v, &reissueCertificateOrderRequestProperties) + if err != nil { + return err + } + rcor.ReissueCertificateOrderRequestProperties = &reissueCertificateOrderRequestProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rcor.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rcor.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + rcor.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rcor.Type = &typeVar + } } - rcor.Type = &typeVar } return nil @@ -11093,6 +12218,8 @@ type ReissueCertificateOrderRequestProperties struct { // RelayServiceConnectionEntity hybrid Connection for an App Service app. type RelayServiceConnectionEntity struct { autorest.Response `json:"-"` + // RelayServiceConnectionEntityProperties - RelayServiceConnectionEntity resource specific properties + *RelayServiceConnectionEntityProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -11101,8 +12228,6 @@ type RelayServiceConnectionEntity struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // RelayServiceConnectionEntityProperties - RelayServiceConnectionEntity resource specific properties - *RelayServiceConnectionEntityProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for RelayServiceConnectionEntity struct. @@ -11112,56 +12237,54 @@ func (rsce *RelayServiceConnectionEntity) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties RelayServiceConnectionEntityProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - rsce.RelayServiceConnectionEntityProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - rsce.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - rsce.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - rsce.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var relayServiceConnectionEntityProperties RelayServiceConnectionEntityProperties + err = json.Unmarshal(*v, &relayServiceConnectionEntityProperties) + if err != nil { + return err + } + rsce.RelayServiceConnectionEntityProperties = &relayServiceConnectionEntityProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rsce.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rsce.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + rsce.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rsce.Type = &typeVar + } } - rsce.Type = &typeVar } return nil @@ -11180,6 +12303,8 @@ type RelayServiceConnectionEntityProperties struct { // RenewCertificateOrderRequest class representing certificate renew request. type RenewCertificateOrderRequest struct { + // RenewCertificateOrderRequestProperties - RenewCertificateOrderRequest resource specific properties + *RenewCertificateOrderRequestProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -11188,8 +12313,6 @@ type RenewCertificateOrderRequest struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // RenewCertificateOrderRequestProperties - RenewCertificateOrderRequest resource specific properties - *RenewCertificateOrderRequestProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for RenewCertificateOrderRequest struct. @@ -11199,56 +12322,54 @@ func (rcor *RenewCertificateOrderRequest) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties RenewCertificateOrderRequestProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - rcor.RenewCertificateOrderRequestProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - rcor.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - rcor.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - rcor.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var renewCertificateOrderRequestProperties RenewCertificateOrderRequestProperties + err = json.Unmarshal(*v, &renewCertificateOrderRequestProperties) + if err != nil { + return err + } + rcor.RenewCertificateOrderRequestProperties = &renewCertificateOrderRequestProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rcor.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rcor.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + rcor.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rcor.Type = &typeVar + } } - rcor.Type = &typeVar } return nil @@ -11285,7 +12406,31 @@ type Resource struct { // Type - Resource type. Type *string `json:"type,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.ID != nil { + objectMap["id"] = r.ID + } + if r.Name != nil { + objectMap["name"] = r.Name + } + if r.Kind != nil { + objectMap["kind"] = r.Kind + } + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Type != nil { + objectMap["type"] = r.Type + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) } // ResourceCollection collection of resources. @@ -11524,6 +12669,8 @@ func (page ResourceMetricCollectionPage) Values() []ResourceMetric { // ResourceMetricDefinition metadata for the metrics. type ResourceMetricDefinition struct { + // ResourceMetricDefinitionProperties - ResourceMetricDefinition resource specific properties + *ResourceMetricDefinitionProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -11532,8 +12679,6 @@ type ResourceMetricDefinition struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // ResourceMetricDefinitionProperties - ResourceMetricDefinition resource specific properties - *ResourceMetricDefinitionProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ResourceMetricDefinition struct. @@ -11543,56 +12688,54 @@ func (rmd *ResourceMetricDefinition) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ResourceMetricDefinitionProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - rmd.ResourceMetricDefinitionProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - rmd.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - rmd.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - rmd.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var resourceMetricDefinitionProperties ResourceMetricDefinitionProperties + err = json.Unmarshal(*v, &resourceMetricDefinitionProperties) + if err != nil { + return err + } + rmd.ResourceMetricDefinitionProperties = &resourceMetricDefinitionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rmd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rmd.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + rmd.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rmd.Type = &typeVar + } } - rmd.Type = &typeVar } return nil @@ -11607,7 +12750,8 @@ type ResourceMetricDefinitionCollection struct { NextLink *string `json:"nextLink,omitempty"` } -// ResourceMetricDefinitionCollectionIterator provides access to a complete listing of ResourceMetricDefinition values. +// ResourceMetricDefinitionCollectionIterator provides access to a complete listing of ResourceMetricDefinition +// values. type ResourceMetricDefinitionCollectionIterator struct { i int page ResourceMetricDefinitionCollectionPage @@ -11715,7 +12859,34 @@ type ResourceMetricDefinitionProperties struct { // ID - Resource ID. ID *string `json:"id,omitempty"` // Properties - Resource metric definition properties. - Properties *map[string]*string `json:"properties,omitempty"` + Properties map[string]*string `json:"properties"` +} + +// MarshalJSON is the custom marshaler for ResourceMetricDefinitionProperties. +func (rmd ResourceMetricDefinitionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rmd.Name != nil { + objectMap["name"] = rmd.Name + } + if rmd.Unit != nil { + objectMap["unit"] = rmd.Unit + } + if rmd.PrimaryAggregationType != nil { + objectMap["primaryAggregationType"] = rmd.PrimaryAggregationType + } + if rmd.MetricAvailabilities != nil { + objectMap["metricAvailabilities"] = rmd.MetricAvailabilities + } + if rmd.ResourceURI != nil { + objectMap["resourceUri"] = rmd.ResourceURI + } + if rmd.ID != nil { + objectMap["id"] = rmd.ID + } + if rmd.Properties != nil { + objectMap["properties"] = rmd.Properties + } + return json.Marshal(objectMap) } // ResourceMetricName name of a metric for any resource . @@ -11782,6 +12953,8 @@ type ResponseMetaData struct { // RestoreRequest description of a restore request. type RestoreRequest struct { autorest.Response `json:"-"` + // RestoreRequestProperties - RestoreRequest resource specific properties + *RestoreRequestProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -11790,8 +12963,6 @@ type RestoreRequest struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // RestoreRequestProperties - RestoreRequest resource specific properties - *RestoreRequestProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for RestoreRequest struct. @@ -11801,56 +12972,54 @@ func (rr *RestoreRequest) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties RestoreRequestProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - rr.RestoreRequestProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - rr.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - rr.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - rr.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var restoreRequestProperties RestoreRequestProperties + err = json.Unmarshal(*v, &restoreRequestProperties) + if err != nil { + return err + } + rr.RestoreRequestProperties = &restoreRequestProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + rr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rr.Type = &typeVar + } } - rr.Type = &typeVar } return nil @@ -11886,6 +13055,8 @@ type RestoreRequestProperties struct { // RestoreResponse response for an app restore request. type RestoreResponse struct { autorest.Response `json:"-"` + // RestoreResponseProperties - RestoreResponse resource specific properties + *RestoreResponseProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -11894,8 +13065,6 @@ type RestoreResponse struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // RestoreResponseProperties - RestoreResponse resource specific properties - *RestoreResponseProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for RestoreResponse struct. @@ -11905,56 +13074,54 @@ func (rr *RestoreResponse) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties RestoreResponseProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - rr.RestoreResponseProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - rr.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - rr.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - rr.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var restoreResponseProperties RestoreResponseProperties + err = json.Unmarshal(*v, &restoreResponseProperties) + if err != nil { + return err + } + rr.RestoreResponseProperties = &restoreResponseProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + rr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rr.Type = &typeVar + } } - rr.Type = &typeVar } return nil @@ -11974,12 +13141,15 @@ type ServiceSpecification struct { // SetObject ... type SetObject struct { autorest.Response `json:"-"` - Value *map[string]interface{} `json:"value,omitempty"` + Value interface{} `json:"value,omitempty"` } // Site a web app, a mobile app backend, or an API app. type Site struct { autorest.Response `json:"-"` + // SiteProperties - Site resource specific properties + *SiteProperties `json:"properties,omitempty"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -11991,99 +13161,121 @@ type Site struct { // Type - Resource type. Type *string `json:"type,omitempty"` // Tags - Resource tags. - Tags *map[string]*string `json:"tags,omitempty"` - // SiteProperties - Site resource specific properties - *SiteProperties `json:"properties,omitempty"` - Identity *ManagedServiceIdentity `json:"identity,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for Site struct. -func (s *Site) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for Site. +func (s Site) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.SiteProperties != nil { + objectMap["properties"] = s.SiteProperties } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties SiteProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - s.SiteProperties = &properties + if s.Identity != nil { + objectMap["identity"] = s.Identity } - - v = m["identity"] - if v != nil { - var identity ManagedServiceIdentity - err = json.Unmarshal(*m["identity"], &identity) - if err != nil { - return err - } - s.Identity = &identity + if s.ID != nil { + objectMap["id"] = s.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - s.ID = &ID + if s.Name != nil { + objectMap["name"] = s.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - s.Name = &name + if s.Kind != nil { + objectMap["kind"] = s.Kind } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - s.Kind = &kind + if s.Location != nil { + objectMap["location"] = s.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - s.Location = &location + if s.Type != nil { + objectMap["type"] = s.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - s.Type = &typeVar + if s.Tags != nil { + objectMap["tags"] = s.Tags } + return json.Marshal(objectMap) +} - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err +// UnmarshalJSON is the custom unmarshaler for Site struct. +func (s *Site) 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 "properties": + if v != nil { + var siteProperties SiteProperties + err = json.Unmarshal(*v, &siteProperties) + if err != nil { + return err + } + s.SiteProperties = &siteProperties + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + s.Identity = &identity + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + s.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + s.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + s.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + s.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + s.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + s.Tags = tags + } } - s.Tags = &tags } return nil @@ -12092,6 +13284,8 @@ func (s *Site) UnmarshalJSON(body []byte) error { // SiteAuthSettings configuration settings for the Azure App Service Authentication / Authorization feature. type SiteAuthSettings struct { autorest.Response `json:"-"` + // SiteAuthSettingsProperties - SiteAuthSettings resource specific properties + *SiteAuthSettingsProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -12100,8 +13294,6 @@ type SiteAuthSettings struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // SiteAuthSettingsProperties - SiteAuthSettings resource specific properties - *SiteAuthSettingsProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for SiteAuthSettings struct. @@ -12111,60 +13303,58 @@ func (sas *SiteAuthSettings) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties SiteAuthSettingsProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var siteAuthSettingsProperties SiteAuthSettingsProperties + err = json.Unmarshal(*v, &siteAuthSettingsProperties) + if err != nil { + return err + } + sas.SiteAuthSettingsProperties = &siteAuthSettingsProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sas.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sas.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sas.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sas.Type = &typeVar + } } - sas.SiteAuthSettingsProperties = &properties } - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - sas.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - sas.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - sas.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - sas.Type = &typeVar - } - - return nil -} + return nil +} // SiteAuthSettingsProperties siteAuthSettings resource specific properties type SiteAuthSettingsProperties struct { @@ -12367,11 +13557,17 @@ type SiteConfig struct { LocalMySQLEnabled *bool `json:"localMySqlEnabled,omitempty"` // IPSecurityRestrictions - IP security restrictions. IPSecurityRestrictions *[]IPSecurityRestriction `json:"ipSecurityRestrictions,omitempty"` + // HTTP20Enabled - Http20Enabled: configures a web site to allow clients to connect over http2.0 + HTTP20Enabled *bool `json:"http20Enabled,omitempty"` + // MinTLSVersion - MinTlsVersion: configures the minimum version of TLS required for SSL requests. Possible values include: 'OneFullStopZero', 'OneFullStopOne', 'OneFullStopTwo' + MinTLSVersion SupportedTLSVersions `json:"minTlsVersion,omitempty"` } // SiteConfigResource web app configuration ARM resource. type SiteConfigResource struct { autorest.Response `json:"-"` + // SiteConfig - Core resource properties + *SiteConfig `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -12380,8 +13576,6 @@ type SiteConfigResource struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // SiteConfig - Core resource properties - *SiteConfig `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for SiteConfigResource struct. @@ -12391,56 +13585,54 @@ func (scr *SiteConfigResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties SiteConfig - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - scr.SiteConfig = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - scr.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - scr.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - scr.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var siteConfig SiteConfig + err = json.Unmarshal(*v, &siteConfig) + if err != nil { + return err + } + scr.SiteConfig = &siteConfig + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + scr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + scr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + scr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + scr.Type = &typeVar + } } - scr.Type = &typeVar } return nil @@ -12550,6 +13742,8 @@ func (page SiteConfigResourceCollectionPage) Values() []SiteConfigResource { // SiteConfigurationSnapshotInfo a snapshot of a web app configuration. type SiteConfigurationSnapshotInfo struct { + // SiteConfigurationSnapshotInfoProperties - SiteConfigurationSnapshotInfo resource specific properties + *SiteConfigurationSnapshotInfoProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -12558,8 +13752,6 @@ type SiteConfigurationSnapshotInfo struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // SiteConfigurationSnapshotInfoProperties - SiteConfigurationSnapshotInfo resource specific properties - *SiteConfigurationSnapshotInfoProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for SiteConfigurationSnapshotInfo struct. @@ -12569,56 +13761,54 @@ func (scsi *SiteConfigurationSnapshotInfo) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties SiteConfigurationSnapshotInfoProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - scsi.SiteConfigurationSnapshotInfoProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - scsi.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - scsi.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - scsi.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var siteConfigurationSnapshotInfoProperties SiteConfigurationSnapshotInfoProperties + err = json.Unmarshal(*v, &siteConfigurationSnapshotInfoProperties) + if err != nil { + return err + } + scsi.SiteConfigurationSnapshotInfoProperties = &siteConfigurationSnapshotInfoProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + scsi.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + scsi.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + scsi.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + scsi.Type = &typeVar + } } - scsi.Type = &typeVar } return nil @@ -12739,6 +13929,8 @@ type SiteConfigurationSnapshotInfoProperties struct { // SiteExtensionInfo site Extension Information. type SiteExtensionInfo struct { autorest.Response `json:"-"` + // SiteExtensionInfoProperties - SiteExtensionInfo resource specific properties + *SiteExtensionInfoProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -12747,8 +13939,6 @@ type SiteExtensionInfo struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // SiteExtensionInfoProperties - SiteExtensionInfo resource specific properties - *SiteExtensionInfoProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for SiteExtensionInfo struct. @@ -12758,56 +13948,54 @@ func (sei *SiteExtensionInfo) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties SiteExtensionInfoProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - sei.SiteExtensionInfoProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - sei.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - sei.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - sei.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var siteExtensionInfoProperties SiteExtensionInfoProperties + err = json.Unmarshal(*v, &siteExtensionInfoProperties) + if err != nil { + return err + } + sei.SiteExtensionInfoProperties = &siteExtensionInfoProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sei.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sei.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sei.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sei.Type = &typeVar + } } - sei.Type = &typeVar } return nil @@ -12961,6 +14149,8 @@ type SiteExtensionInfoProperties struct { // SiteInstance instance of an app. type SiteInstance struct { + // SiteInstanceProperties - SiteInstance resource specific properties + *SiteInstanceProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -12969,8 +14159,6 @@ type SiteInstance struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // SiteInstanceProperties - SiteInstance resource specific properties - *SiteInstanceProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for SiteInstance struct. @@ -12980,56 +14168,54 @@ func (si *SiteInstance) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties SiteInstanceProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - si.SiteInstanceProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - si.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - si.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - si.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var siteInstanceProperties SiteInstanceProperties + err = json.Unmarshal(*v, &siteInstanceProperties) + if err != nil { + return err + } + si.SiteInstanceProperties = &siteInstanceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + si.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + si.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + si.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + si.Type = &typeVar + } } - si.Type = &typeVar } return nil @@ -13054,6 +14240,8 @@ type SiteLimits struct { // SiteLogsConfig configuration of App Service site logs. type SiteLogsConfig struct { autorest.Response `json:"-"` + // SiteLogsConfigProperties - SiteLogsConfig resource specific properties + *SiteLogsConfigProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -13062,8 +14250,6 @@ type SiteLogsConfig struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // SiteLogsConfigProperties - SiteLogsConfig resource specific properties - *SiteLogsConfigProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for SiteLogsConfig struct. @@ -13073,56 +14259,54 @@ func (slc *SiteLogsConfig) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties SiteLogsConfigProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - slc.SiteLogsConfigProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - slc.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - slc.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - slc.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var siteLogsConfigProperties SiteLogsConfigProperties + err = json.Unmarshal(*v, &siteLogsConfigProperties) + if err != nil { + return err + } + slc.SiteLogsConfigProperties = &siteLogsConfigProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + slc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + slc.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + slc.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + slc.Type = &typeVar + } } - slc.Type = &typeVar } return nil @@ -13154,6 +14338,8 @@ type SiteMachineKey struct { // SitePatchResource ARM resource for a site. type SitePatchResource struct { + // SitePatchResourceProperties - SitePatchResource resource specific properties + *SitePatchResourceProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -13162,8 +14348,6 @@ type SitePatchResource struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // SitePatchResourceProperties - SitePatchResource resource specific properties - *SitePatchResourceProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for SitePatchResource struct. @@ -13173,56 +14357,54 @@ func (spr *SitePatchResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties SitePatchResourceProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - spr.SitePatchResourceProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - spr.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - spr.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - spr.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var sitePatchResourceProperties SitePatchResourceProperties + err = json.Unmarshal(*v, &sitePatchResourceProperties) + if err != nil { + return err + } + spr.SitePatchResourceProperties = &sitePatchResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + spr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + spr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + spr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + spr.Type = &typeVar + } } - spr.Type = &typeVar } return nil @@ -13303,6 +14485,8 @@ type SitePatchResourceProperties struct { // SitePhpErrorLogFlag used for getting PHP error logging flag. type SitePhpErrorLogFlag struct { autorest.Response `json:"-"` + // SitePhpErrorLogFlagProperties - SitePhpErrorLogFlag resource specific properties + *SitePhpErrorLogFlagProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -13311,8 +14495,6 @@ type SitePhpErrorLogFlag struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // SitePhpErrorLogFlagProperties - SitePhpErrorLogFlag resource specific properties - *SitePhpErrorLogFlagProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for SitePhpErrorLogFlag struct. @@ -13322,56 +14504,54 @@ func (spelf *SitePhpErrorLogFlag) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties SitePhpErrorLogFlagProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - spelf.SitePhpErrorLogFlagProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - spelf.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - spelf.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - spelf.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var sitePhpErrorLogFlagProperties SitePhpErrorLogFlagProperties + err = json.Unmarshal(*v, &sitePhpErrorLogFlagProperties) + if err != nil { + return err + } + spelf.SitePhpErrorLogFlagProperties = &sitePhpErrorLogFlagProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + spelf.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + spelf.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + spelf.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + spelf.Type = &typeVar + } } - spelf.Type = &typeVar } return nil @@ -13479,6 +14659,8 @@ type SiteSealRequest struct { // SiteSourceControl source control configuration for an app. type SiteSourceControl struct { autorest.Response `json:"-"` + // SiteSourceControlProperties - SiteSourceControl resource specific properties + *SiteSourceControlProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -13487,8 +14669,6 @@ type SiteSourceControl struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // SiteSourceControlProperties - SiteSourceControl resource specific properties - *SiteSourceControlProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for SiteSourceControl struct. @@ -13498,56 +14678,54 @@ func (ssc *SiteSourceControl) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties SiteSourceControlProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - ssc.SiteSourceControlProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - ssc.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - ssc.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - ssc.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var siteSourceControlProperties SiteSourceControlProperties + err = json.Unmarshal(*v, &siteSourceControlProperties) + if err != nil { + return err + } + ssc.SiteSourceControlProperties = &siteSourceControlProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ssc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ssc.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ssc.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ssc.Type = &typeVar + } } - ssc.Type = &typeVar } return nil @@ -13720,8 +14898,8 @@ type SkuInfos struct { Skus *[]GlobalCsmSkuDescription `json:"skus,omitempty"` } -// SlotConfigNames names for connection strings and application settings to be marked as sticky to the deployment slot -// and not moved during a swap operation. +// SlotConfigNames names for connection strings and application settings to be marked as sticky to the deployment +// slot and not moved during a swap operation. // This is valid for all deployment slots in an app. type SlotConfigNames struct { // ConnectionStringNames - List of connection string names. @@ -13733,6 +14911,8 @@ type SlotConfigNames struct { // SlotConfigNamesResource slot Config names azure resource. type SlotConfigNamesResource struct { autorest.Response `json:"-"` + // SlotConfigNames - Core resource properties + *SlotConfigNames `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -13741,8 +14921,6 @@ type SlotConfigNamesResource struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // SlotConfigNames - Core resource properties - *SlotConfigNames `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for SlotConfigNamesResource struct. @@ -13752,56 +14930,54 @@ func (scnr *SlotConfigNamesResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties SlotConfigNames - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - scnr.SlotConfigNames = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - scnr.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - scnr.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - scnr.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var slotConfigNames SlotConfigNames + err = json.Unmarshal(*v, &slotConfigNames) + if err != nil { + return err + } + scnr.SlotConfigNames = &slotConfigNames + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + scnr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + scnr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + scnr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + scnr.Type = &typeVar + } } - scnr.Type = &typeVar } return nil @@ -13809,6 +14985,8 @@ func (scnr *SlotConfigNamesResource) UnmarshalJSON(body []byte) error { // SlotDifference a setting difference between two deployment slots of an app. type SlotDifference struct { + // SlotDifferenceProperties - SlotDifference resource specific properties + *SlotDifferenceProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -13817,8 +14995,6 @@ type SlotDifference struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // SlotDifferenceProperties - SlotDifference resource specific properties - *SlotDifferenceProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for SlotDifference struct. @@ -13828,56 +15004,54 @@ func (sd *SlotDifference) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties SlotDifferenceProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - sd.SlotDifferenceProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - sd.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - sd.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - sd.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var slotDifferenceProperties SlotDifferenceProperties + err = json.Unmarshal(*v, &slotDifferenceProperties) + if err != nil { + return err + } + sd.SlotDifferenceProperties = &slotDifferenceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sd.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sd.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sd.Type = &typeVar + } } - sd.Type = &typeVar } return nil @@ -14025,6 +15199,8 @@ type SlowRequestsBasedTrigger struct { // Snapshot a snapshot of an app. type Snapshot struct { + // SnapshotProperties - Snapshot resource specific properties + *SnapshotProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -14033,8 +15209,6 @@ type Snapshot struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // SnapshotProperties - Snapshot resource specific properties - *SnapshotProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for Snapshot struct. @@ -14044,60 +15218,58 @@ func (s *Snapshot) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties SnapshotProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - s.SnapshotProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - s.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var snapshotProperties SnapshotProperties + err = json.Unmarshal(*v, &snapshotProperties) + if err != nil { + return err + } + s.SnapshotProperties = &snapshotProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + s.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + s.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + s.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + s.Type = &typeVar + } } - s.Name = &name } - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - s.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - s.Type = &typeVar - } - - return nil -} + return nil +} // SnapshotCollection collection of snapshots which can be used to revert an app to a previous time. type SnapshotCollection struct { @@ -14209,6 +15381,8 @@ type SnapshotProperties struct { // SnapshotRecoveryRequest details about app recovery operation. type SnapshotRecoveryRequest struct { + // SnapshotRecoveryRequestProperties - SnapshotRecoveryRequest resource specific properties + *SnapshotRecoveryRequestProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -14217,8 +15391,6 @@ type SnapshotRecoveryRequest struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // SnapshotRecoveryRequestProperties - SnapshotRecoveryRequest resource specific properties - *SnapshotRecoveryRequestProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for SnapshotRecoveryRequest struct. @@ -14228,56 +15400,54 @@ func (srr *SnapshotRecoveryRequest) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties SnapshotRecoveryRequestProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - srr.SnapshotRecoveryRequestProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - srr.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - srr.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - srr.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var snapshotRecoveryRequestProperties SnapshotRecoveryRequestProperties + err = json.Unmarshal(*v, &snapshotRecoveryRequestProperties) + if err != nil { + return err + } + srr.SnapshotRecoveryRequestProperties = &snapshotRecoveryRequestProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + srr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + srr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + srr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + srr.Type = &typeVar + } } - srr.Type = &typeVar } return nil @@ -14329,6 +15499,8 @@ type Solution struct { // SourceControl the source control OAuth token. type SourceControl struct { autorest.Response `json:"-"` + // SourceControlProperties - SourceControl resource specific properties + *SourceControlProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -14337,8 +15509,6 @@ type SourceControl struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // SourceControlProperties - SourceControl resource specific properties - *SourceControlProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for SourceControl struct. @@ -14348,56 +15518,54 @@ func (sc *SourceControl) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties SourceControlProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - sc.SourceControlProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - sc.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - sc.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var sourceControlProperties SourceControlProperties + err = json.Unmarshal(*v, &sourceControlProperties) + if err != nil { + return err + } + sc.SourceControlProperties = &sourceControlProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sc.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sc.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sc.Type = &typeVar + } } - sc.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - sc.Type = &typeVar } return nil @@ -14665,6 +15833,8 @@ type StatusCodesBasedTrigger struct { // StorageMigrationOptions options for app content migration. type StorageMigrationOptions struct { + // StorageMigrationOptionsProperties - StorageMigrationOptions resource specific properties + *StorageMigrationOptionsProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -14673,8 +15843,6 @@ type StorageMigrationOptions struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // StorageMigrationOptionsProperties - StorageMigrationOptions resource specific properties - *StorageMigrationOptionsProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for StorageMigrationOptions struct. @@ -14684,56 +15852,54 @@ func (smo *StorageMigrationOptions) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties StorageMigrationOptionsProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - smo.StorageMigrationOptionsProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - smo.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - smo.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var storageMigrationOptionsProperties StorageMigrationOptionsProperties + err = json.Unmarshal(*v, &storageMigrationOptionsProperties) + if err != nil { + return err + } + smo.StorageMigrationOptionsProperties = &storageMigrationOptionsProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + smo.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + smo.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + smo.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + smo.Type = &typeVar + } } - smo.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - smo.Type = &typeVar } return nil @@ -14754,6 +15920,8 @@ type StorageMigrationOptionsProperties struct { // StorageMigrationResponse response for a migration of app content request. type StorageMigrationResponse struct { autorest.Response `json:"-"` + // StorageMigrationResponseProperties - StorageMigrationResponse resource specific properties + *StorageMigrationResponseProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -14762,8 +15930,6 @@ type StorageMigrationResponse struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // StorageMigrationResponseProperties - StorageMigrationResponse resource specific properties - *StorageMigrationResponseProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for StorageMigrationResponse struct. @@ -14773,56 +15939,54 @@ func (smr *StorageMigrationResponse) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties StorageMigrationResponseProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - smr.StorageMigrationResponseProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - smr.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - smr.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - smr.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var storageMigrationResponseProperties StorageMigrationResponseProperties + err = json.Unmarshal(*v, &storageMigrationResponseProperties) + if err != nil { + return err + } + smr.StorageMigrationResponseProperties = &storageMigrationResponseProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + smr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + smr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + smr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + smr.Type = &typeVar + } } - smr.Type = &typeVar } return nil @@ -14843,6 +16007,8 @@ type String struct { // StringDictionary string dictionary resource. type StringDictionary struct { autorest.Response `json:"-"` + // Properties - Settings. + Properties map[string]*string `json:"properties"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -14851,8 +16017,27 @@ type StringDictionary struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // Properties - Settings. - Properties *map[string]*string `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for StringDictionary. +func (sd StringDictionary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sd.Properties != nil { + objectMap["properties"] = sd.Properties + } + if sd.ID != nil { + objectMap["id"] = sd.ID + } + if sd.Name != nil { + objectMap["name"] = sd.Name + } + if sd.Kind != nil { + objectMap["kind"] = sd.Kind + } + if sd.Type != nil { + objectMap["type"] = sd.Type + } + return json.Marshal(objectMap) } // TldLegalAgreement legal agreement for a top level domain. @@ -14972,6 +16157,8 @@ func (page TldLegalAgreementCollectionPage) Values() []TldLegalAgreement { // TopLevelDomain a top level domain object. type TopLevelDomain struct { autorest.Response `json:"-"` + // TopLevelDomainProperties - TopLevelDomain resource specific properties + *TopLevelDomainProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -14980,8 +16167,6 @@ type TopLevelDomain struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // TopLevelDomainProperties - TopLevelDomain resource specific properties - *TopLevelDomainProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for TopLevelDomain struct. @@ -14991,56 +16176,54 @@ func (tld *TopLevelDomain) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties TopLevelDomainProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - tld.TopLevelDomainProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - tld.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var topLevelDomainProperties TopLevelDomainProperties + err = json.Unmarshal(*v, &topLevelDomainProperties) + if err != nil { + return err + } + tld.TopLevelDomainProperties = &topLevelDomainProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + tld.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + tld.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + tld.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + tld.Type = &typeVar + } } - tld.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - tld.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - tld.Type = &typeVar } return nil @@ -15167,6 +16350,8 @@ type TopLevelDomainProperties struct { // TriggeredJobHistory triggered Web Job History. List of Triggered Web Job Run Information elements. type TriggeredJobHistory struct { autorest.Response `json:"-"` + // TriggeredJobHistoryProperties - TriggeredJobHistory resource specific properties + *TriggeredJobHistoryProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -15175,8 +16360,6 @@ type TriggeredJobHistory struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // TriggeredJobHistoryProperties - TriggeredJobHistory resource specific properties - *TriggeredJobHistoryProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for TriggeredJobHistory struct. @@ -15186,56 +16369,54 @@ func (tjh *TriggeredJobHistory) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties TriggeredJobHistoryProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var triggeredJobHistoryProperties TriggeredJobHistoryProperties + err = json.Unmarshal(*v, &triggeredJobHistoryProperties) + if err != nil { + return err + } + tjh.TriggeredJobHistoryProperties = &triggeredJobHistoryProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + tjh.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + tjh.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + tjh.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + tjh.Type = &typeVar + } } - tjh.TriggeredJobHistoryProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - tjh.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - tjh.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - tjh.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - tjh.Type = &typeVar } return nil @@ -15351,6 +16532,8 @@ type TriggeredJobHistoryProperties struct { // TriggeredJobRun triggered Web Job Run Information. type TriggeredJobRun struct { + // TriggeredJobRunProperties - TriggeredJobRun resource specific properties + *TriggeredJobRunProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -15359,8 +16542,6 @@ type TriggeredJobRun struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // TriggeredJobRunProperties - TriggeredJobRun resource specific properties - *TriggeredJobRunProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for TriggeredJobRun struct. @@ -15370,56 +16551,54 @@ func (tjr *TriggeredJobRun) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties TriggeredJobRunProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var triggeredJobRunProperties TriggeredJobRunProperties + err = json.Unmarshal(*v, &triggeredJobRunProperties) + if err != nil { + return err + } + tjr.TriggeredJobRunProperties = &triggeredJobRunProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + tjr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + tjr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + tjr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + tjr.Type = &typeVar + } } - tjr.TriggeredJobRunProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - tjr.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - tjr.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - tjr.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - tjr.Type = &typeVar } return nil @@ -15454,6 +16633,8 @@ type TriggeredJobRunProperties struct { // TriggeredWebJob triggered Web Job Information. type TriggeredWebJob struct { autorest.Response `json:"-"` + // TriggeredWebJobProperties - TriggeredWebJob resource specific properties + *TriggeredWebJobProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -15462,8 +16643,6 @@ type TriggeredWebJob struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // TriggeredWebJobProperties - TriggeredWebJob resource specific properties - *TriggeredWebJobProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for TriggeredWebJob struct. @@ -15473,56 +16652,54 @@ func (twj *TriggeredWebJob) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties TriggeredWebJobProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - twj.TriggeredWebJobProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - twj.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - twj.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var triggeredWebJobProperties TriggeredWebJobProperties + err = json.Unmarshal(*v, &triggeredWebJobProperties) + if err != nil { + return err + } + twj.TriggeredWebJobProperties = &triggeredWebJobProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + twj.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + twj.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + twj.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + twj.Type = &typeVar + } } - twj.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - twj.Type = &typeVar } return nil @@ -15653,11 +16830,50 @@ type TriggeredWebJobProperties struct { // UsingSdk - Using SDK? UsingSdk *bool `json:"usingSdk,omitempty"` // Settings - Job settings. - Settings *map[string]*map[string]interface{} `json:"settings,omitempty"` + Settings map[string]interface{} `json:"settings"` +} + +// MarshalJSON is the custom marshaler for TriggeredWebJobProperties. +func (twj TriggeredWebJobProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if twj.LatestRun != nil { + objectMap["latestRun"] = twj.LatestRun + } + if twj.HistoryURL != nil { + objectMap["historyUrl"] = twj.HistoryURL + } + if twj.SchedulerLogsURL != nil { + objectMap["schedulerLogsUrl"] = twj.SchedulerLogsURL + } + if twj.Name != nil { + objectMap["name"] = twj.Name + } + if twj.RunCommand != nil { + objectMap["runCommand"] = twj.RunCommand + } + if twj.URL != nil { + objectMap["url"] = twj.URL + } + if twj.ExtraInfoURL != nil { + objectMap["extraInfoUrl"] = twj.ExtraInfoURL + } + objectMap["jobType"] = twj.JobType + if twj.Error != nil { + objectMap["error"] = twj.Error + } + if twj.UsingSdk != nil { + objectMap["usingSdk"] = twj.UsingSdk + } + if twj.Settings != nil { + objectMap["settings"] = twj.Settings + } + return json.Marshal(objectMap) } // Usage usage of the quota resource. type Usage struct { + // UsageProperties - Usage resource specific properties + *UsageProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -15666,8 +16882,6 @@ type Usage struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // UsageProperties - Usage resource specific properties - *UsageProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for Usage struct. @@ -15677,56 +16891,54 @@ func (u *Usage) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties UsageProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - u.UsageProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - u.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - u.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - u.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var usageProperties UsageProperties + err = json.Unmarshal(*v, &usageProperties) + if err != nil { + return err + } + u.UsageProperties = &usageProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + u.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + u.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + u.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + u.Type = &typeVar + } } - u.Type = &typeVar } return nil @@ -15859,6 +17071,8 @@ type UsageProperties struct { // User user crendentials used for publishing activity. type User struct { autorest.Response `json:"-"` + // UserProperties - User resource specific properties + *UserProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -15867,8 +17081,6 @@ type User struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // UserProperties - User resource specific properties - *UserProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for User struct. @@ -15878,56 +17090,54 @@ func (u *User) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties UserProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var userProperties UserProperties + err = json.Unmarshal(*v, &userProperties) + if err != nil { + return err + } + u.UserProperties = &userProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + u.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + u.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + u.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + u.Type = &typeVar + } } - u.UserProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - u.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - u.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - u.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - u.Type = &typeVar } return nil @@ -15982,46 +17192,45 @@ func (vr *ValidateRequest) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - vr.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar ValidateResourceTypes - err = json.Unmarshal(*m["type"], &typeVar) - 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 + } + vr.Name = &name + } + case "type": + if v != nil { + var typeVar ValidateResourceTypes + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vr.Type = typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + vr.Location = &location + } + case "properties": + if v != nil { + var validateProperties ValidateProperties + err = json.Unmarshal(*v, &validateProperties) + if err != nil { + return err + } + vr.ValidateProperties = &validateProperties + } } - vr.Type = typeVar - } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - vr.Location = &location - } - - v = m["properties"] - if v != nil { - var properties ValidateProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - vr.ValidateProperties = &properties } return nil @@ -16088,10 +17297,12 @@ type VirtualNetworkProfile struct { Subnet *string `json:"subnet,omitempty"` } -// VnetGateway the Virtual Network gateway contract. This is used to give the Virtual Network gateway access to the VPN -// package. +// VnetGateway the Virtual Network gateway contract. This is used to give the Virtual Network gateway access to the +// VPN package. type VnetGateway struct { autorest.Response `json:"-"` + // VnetGatewayProperties - VnetGateway resource specific properties + *VnetGatewayProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -16100,8 +17311,6 @@ type VnetGateway struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // VnetGatewayProperties - VnetGateway resource specific properties - *VnetGatewayProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for VnetGateway struct. @@ -16111,56 +17320,54 @@ func (vg *VnetGateway) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties VnetGatewayProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - vg.VnetGatewayProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - vg.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - vg.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var vnetGatewayProperties VnetGatewayProperties + err = json.Unmarshal(*v, &vnetGatewayProperties) + if err != nil { + return err + } + vg.VnetGatewayProperties = &vnetGatewayProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vg.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vg.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + vg.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vg.Type = &typeVar + } } - vg.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - vg.Type = &typeVar } return nil @@ -16177,6 +17384,8 @@ type VnetGatewayProperties struct { // VnetInfo virtual Network information contract. type VnetInfo struct { autorest.Response `json:"-"` + // VnetInfoProperties - VnetInfo resource specific properties + *VnetInfoProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -16185,8 +17394,6 @@ type VnetInfo struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // VnetInfoProperties - VnetInfo resource specific properties - *VnetInfoProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for VnetInfo struct. @@ -16196,56 +17403,54 @@ func (vi *VnetInfo) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties VnetInfoProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - vi.VnetInfoProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - vi.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - vi.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - vi.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var vnetInfoProperties VnetInfoProperties + err = json.Unmarshal(*v, &vnetInfoProperties) + if err != nil { + return err + } + vi.VnetInfoProperties = &vnetInfoProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vi.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vi.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + vi.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vi.Type = &typeVar + } } - vi.Type = &typeVar } return nil @@ -16270,6 +17475,8 @@ type VnetInfoProperties struct { // VnetParameters the required set of inputs to validate a VNET type VnetParameters struct { + // VnetParametersProperties - VnetParameters resource specific properties + *VnetParametersProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -16278,8 +17485,6 @@ type VnetParameters struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // VnetParametersProperties - VnetParameters resource specific properties - *VnetParametersProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for VnetParameters struct. @@ -16289,56 +17494,54 @@ func (vp *VnetParameters) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties VnetParametersProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - vp.VnetParametersProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - vp.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - vp.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - vp.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var vnetParametersProperties VnetParametersProperties + err = json.Unmarshal(*v, &vnetParametersProperties) + if err != nil { + return err + } + vp.VnetParametersProperties = &vnetParametersProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vp.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + vp.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vp.Type = &typeVar + } } - vp.Type = &typeVar } return nil @@ -16357,6 +17560,8 @@ type VnetParametersProperties struct { // VnetRoute virtual Network route contract used to pass routing information for a Virtual Network. type VnetRoute struct { autorest.Response `json:"-"` + // VnetRouteProperties - VnetRoute resource specific properties + *VnetRouteProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -16365,8 +17570,6 @@ type VnetRoute struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // VnetRouteProperties - VnetRoute resource specific properties - *VnetRouteProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for VnetRoute struct. @@ -16376,56 +17579,54 @@ func (vr *VnetRoute) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties VnetRouteProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - vr.VnetRouteProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var vnetRouteProperties VnetRouteProperties + err = json.Unmarshal(*v, &vnetRouteProperties) + if err != nil { + return err + } + vr.VnetRouteProperties = &vnetRouteProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + vr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vr.Type = &typeVar + } } - vr.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - vr.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - vr.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - vr.Type = &typeVar } return nil @@ -16450,6 +17651,8 @@ type VnetRouteProperties struct { // VnetValidationFailureDetails a class that describes the reason for a validation failure. type VnetValidationFailureDetails struct { autorest.Response `json:"-"` + // VnetValidationFailureDetailsProperties - VnetValidationFailureDetails resource specific properties + *VnetValidationFailureDetailsProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -16458,8 +17661,6 @@ type VnetValidationFailureDetails struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // VnetValidationFailureDetailsProperties - VnetValidationFailureDetails resource specific properties - *VnetValidationFailureDetailsProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for VnetValidationFailureDetails struct. @@ -16469,56 +17670,54 @@ func (vvfd *VnetValidationFailureDetails) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties VnetValidationFailureDetailsProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - vvfd.VnetValidationFailureDetailsProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - vvfd.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var vnetValidationFailureDetailsProperties VnetValidationFailureDetailsProperties + err = json.Unmarshal(*v, &vnetValidationFailureDetailsProperties) + if err != nil { + return err + } + vvfd.VnetValidationFailureDetailsProperties = &vnetValidationFailureDetailsProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vvfd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vvfd.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + vvfd.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vvfd.Type = &typeVar + } } - vvfd.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - vvfd.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - vvfd.Type = &typeVar } return nil @@ -16534,6 +17733,8 @@ type VnetValidationFailureDetailsProperties struct { // VnetValidationTestFailure a class that describes a test that failed during NSG and UDR validation. type VnetValidationTestFailure struct { + // VnetValidationTestFailureProperties - VnetValidationTestFailure resource specific properties + *VnetValidationTestFailureProperties `json:"properties,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -16542,8 +17743,6 @@ type VnetValidationTestFailure struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // VnetValidationTestFailureProperties - VnetValidationTestFailure resource specific properties - *VnetValidationTestFailureProperties `json:"properties,omitempty"` } // UnmarshalJSON is the custom unmarshaler for VnetValidationTestFailure struct. @@ -16553,56 +17752,54 @@ func (vvtf *VnetValidationTestFailure) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties VnetValidationTestFailureProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - vvtf.VnetValidationTestFailureProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - vvtf.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - vvtf.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var vnetValidationTestFailureProperties VnetValidationTestFailureProperties + err = json.Unmarshal(*v, &vnetValidationTestFailureProperties) + if err != nil { + return err + } + vvtf.VnetValidationTestFailureProperties = &vnetValidationTestFailureProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vvtf.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vvtf.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + vvtf.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vvtf.Type = &typeVar + } } - vvtf.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - vvtf.Type = &typeVar } return nil @@ -16735,6 +17932,9 @@ func (page WorkerPoolCollectionPage) Values() []WorkerPoolResource { // WorkerPoolResource worker pool of an App Service Environment ARM resource. type WorkerPoolResource struct { autorest.Response `json:"-"` + // WorkerPool - Core resource properties + *WorkerPool `json:"properties,omitempty"` + Sku *SkuDescription `json:"sku,omitempty"` // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. @@ -16743,9 +17943,6 @@ type WorkerPoolResource struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // WorkerPool - Core resource properties - *WorkerPool `json:"properties,omitempty"` - Sku *SkuDescription `json:"sku,omitempty"` } // UnmarshalJSON is the custom unmarshaler for WorkerPoolResource struct. @@ -16755,66 +17952,63 @@ func (wpr *WorkerPoolResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties WorkerPool - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - wpr.WorkerPool = &properties - } - - v = m["sku"] - if v != nil { - var sku SkuDescription - err = json.Unmarshal(*m["sku"], &sku) - if err != nil { - return err - } - wpr.Sku = &sku - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - wpr.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - wpr.Name = &name - } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - wpr.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var workerPool WorkerPool + err = json.Unmarshal(*v, &workerPool) + if err != nil { + return err + } + wpr.WorkerPool = &workerPool + } + case "sku": + if v != nil { + var sku SkuDescription + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + wpr.Sku = &sku + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + wpr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + wpr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + wpr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + wpr.Type = &typeVar + } } - wpr.Type = &typeVar } return nil diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/recommendations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/recommendations.go index d017f6e45ce9..f7a29a096df6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/recommendations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/recommendations.go @@ -49,7 +49,7 @@ func (client RecommendationsClient) DisableAllForWebApp(ctx context.Context, res 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.NewErrorWithValidationError(err, "web.RecommendationsClient", "DisableAllForWebApp") + return result, validation.NewError("web.RecommendationsClient", "DisableAllForWebApp", err.Error()) } req, err := client.DisableAllForWebAppPreparer(ctx, resourceGroupName, siteName) @@ -115,8 +115,8 @@ func (client RecommendationsClient) DisableAllForWebAppResponder(resp *http.Resp // GetRuleDetailsByWebApp get a recommendation rule for an app. // -// resourceGroupName is name of the resource group to which the resource belongs. siteName is name of the app. name is -// name of the recommendation. updateSeen is specify true to update the last-seen timestamp of the +// resourceGroupName is name of the resource group to which the resource belongs. siteName is name of the app. name +// is name of the recommendation. updateSeen is specify true to update the last-seen timestamp of the // recommendation object. func (client RecommendationsClient) GetRuleDetailsByWebApp(ctx context.Context, resourceGroupName string, siteName string, name string, updateSeen *bool) (result RecommendationRule, err error) { if err := validation.Validate([]validation.Validation{ @@ -124,7 +124,7 @@ func (client RecommendationsClient) GetRuleDetailsByWebApp(ctx context.Context, 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.NewErrorWithValidationError(err, "web.RecommendationsClient", "GetRuleDetailsByWebApp") + return result, validation.NewError("web.RecommendationsClient", "GetRuleDetailsByWebApp", err.Error()) } req, err := client.GetRuleDetailsByWebAppPreparer(ctx, resourceGroupName, siteName, name, updateSeen) @@ -196,9 +196,9 @@ func (client RecommendationsClient) GetRuleDetailsByWebAppResponder(resp *http.R // List list all recommendations for a subscription. // // featured is specify true to return only the most critical recommendations. The default is -// false, which returns all recommendations. filter is filter is specified by using OData syntax. Example: -// $filter=channels eq 'Api' or channel eq 'Notification' and startTime eq '2014-01-01T00:00:00Z' and endTime eq -// '2014-12-31T23:59:59Z' and timeGrain eq duration'[PT1H|PT1M|P1D] +// false, which returns all recommendations. filter is filter is specified by using OData syntax. +// Example: $filter=channels eq 'Api' or channel eq 'Notification' and startTime eq '2014-01-01T00:00:00Z' and +// endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[PT1H|PT1M|P1D] func (client RecommendationsClient) List(ctx context.Context, featured *bool, filter string) (result ListRecommendation, err error) { req, err := client.ListPreparer(ctx, featured, filter) if err != nil { @@ -268,16 +268,17 @@ func (client RecommendationsClient) ListResponder(resp *http.Response) (result L // ListHistoryForWebApp get past recommendations for an app, optionally specified by the time range. // -// resourceGroupName is name of the resource group to which the resource belongs. siteName is name of the app. filter -// is filter is specified by using OData syntax. Example: $filter=channels eq 'Api' or channel eq 'Notification' and -// startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[PT1H|PT1M|P1D] +// resourceGroupName is name of the resource group to which the resource belongs. siteName is name of the app. +// filter is filter is specified by using OData syntax. Example: $filter=channels eq 'Api' or channel eq +// 'Notification' and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq +// duration'[PT1H|PT1M|P1D] func (client RecommendationsClient) ListHistoryForWebApp(ctx context.Context, resourceGroupName string, siteName string, filter string) (result ListRecommendation, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.RecommendationsClient", "ListHistoryForWebApp") + return result, validation.NewError("web.RecommendationsClient", "ListHistoryForWebApp", err.Error()) } req, err := client.ListHistoryForWebAppPreparer(ctx, resourceGroupName, siteName, filter) @@ -347,17 +348,17 @@ func (client RecommendationsClient) ListHistoryForWebAppResponder(resp *http.Res // ListRecommendedRulesForWebApp get all recommendations for an app. // -// resourceGroupName is name of the resource group to which the resource belongs. siteName is name of the app. featured -// is specify true to return only the most critical recommendations. The default is false, -// which returns all recommendations. filter is return only channels specified in the filter. Filter is specified by -// using OData syntax. Example: $filter=channels eq 'Api' or channel eq 'Notification' +// resourceGroupName is name of the resource group to which the resource belongs. siteName is name of the app. +// featured is specify true to return only the most critical recommendations. The default is +// false, which returns all recommendations. filter is return only channels specified in the filter. +// Filter is specified by using OData syntax. Example: $filter=channels eq 'Api' or channel eq 'Notification' func (client RecommendationsClient) ListRecommendedRulesForWebApp(ctx context.Context, resourceGroupName string, siteName string, featured *bool, filter string) (result ListRecommendation, err error) { if err := validation.Validate([]validation.Validation{ {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.NewErrorWithValidationError(err, "web.RecommendationsClient", "ListRecommendedRulesForWebApp") + return result, validation.NewError("web.RecommendationsClient", "ListRecommendedRulesForWebApp", err.Error()) } req, err := client.ListRecommendedRulesForWebAppPreparer(ctx, resourceGroupName, siteName, featured, filter) @@ -498,7 +499,7 @@ func (client RecommendationsClient) ResetAllFiltersForWebApp(ctx context.Context 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.NewErrorWithValidationError(err, "web.RecommendationsClient", "ResetAllFiltersForWebApp") + return result, validation.NewError("web.RecommendationsClient", "ResetAllFiltersForWebApp", err.Error()) } req, err := client.ResetAllFiltersForWebAppPreparer(ctx, resourceGroupName, siteName) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/version.go index 3c5c4cbd20dc..f2ef6e92459f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/version.go @@ -1,5 +1,7 @@ package web +import "github.com/Azure/azure-sdk-for-go/version" + // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,10 +21,10 @@ package web // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.5.0-beta services" + return "Azure-SDK-For-Go/" + version.Number + " web/2016-09-01" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.5.0-beta" + return version.Number } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/README.md b/vendor/github.com/Azure/azure-sdk-for-go/storage/README.md index 85a0482d6ec6..49e48cdf1efa 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/storage/README.md +++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/README.md @@ -1,73 +1,18 @@ -# Azure Storage SDK for Go +# Azure Storage SDK for Go (Preview) -The `github.com/Azure/azure-sdk-for-go/storage` package is used to perform REST operations against the [Azure Storage Service](https://docs.microsoft.com/en-us/azure/storage/). To manage your storage accounts (Azure Resource Manager / ARM), use the [github.com/Azure/azure-sdk-for-go/arm/storage](https://github.com/Azure/azure-sdk-for-go/tree/master/arm/storage) package. For your classic storage accounts (Azure Service Management / ASM), use [github.com/Azure/azure-sdk-for-go/management/storageservice](https://github.com/Azure/azure-sdk-for-go/tree/master/management/storageservice) package. +:exclamation: IMPORTANT: This package is in maintenance only and will be deprecated in the +future. Consider using the new package for blobs currently in preview at +[github.com/Azure/azure-storage-blob-go](https://github.com/Azure/azure-storage-blob-go). +New Table, Queue and File packages are also in development. -This package includes support for [Azure Storage Emulator](https://azure.microsoft.com/documentation/articles/storage-use-emulator/). +The `github.com/Azure/azure-sdk-for-go/storage` package is used to manage +[Azure Storage](https://docs.microsoft.com/en-us/azure/storage/) data plane +resources: containers, blobs, tables, and queues. -# Getting Started +To manage storage *accounts* use Azure Resource Manager (ARM) via the packages +at [github.com/Azure/azure-sdk-for-go/services/storage](https://github.com/Azure/azure-sdk-for-go/tree/master/services/storage). - 1. Go get the SDK `go get -u github.com/Azure/azure-sdk-for-go/storage` - 1. If you don't already have one, [create a Storage Account](https://docs.microsoft.com/en-us/azure/storage/storage-create-storage-account). - - Take note of your Azure Storage Account Name and Azure Storage Account Key. They'll both be necessary for using this library. - - This option is production ready, but can also be used for development. - 1. (Optional, Windows only) Download and start the [Azure Storage Emulator](https://azure.microsoft.com/documentation/articles/storage-use-emulator/). - 1. Checkout our existing [samples](https://github.com/Azure-Samples?q=Storage&language=go). +This package also supports the [Azure Storage +Emulator](https://azure.microsoft.com/documentation/articles/storage-use-emulator/) +(Windows only). -# Contributing - -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. - -When contributing, please conform to the following practices: - - Run [gofmt](https://golang.org/cmd/gofmt/) to use standard go formatting. - - Run [golint](https://github.com/golang/lint) to conform to standard naming conventions. - - Run [go vet](https://golang.org/cmd/vet/) to catch common Go mistakes. - - Use [GoASTScanner/gas](https://github.com/GoASTScanner/gas) to ensure there are no common security violations in your contribution. - - Run [go test](https://golang.org/cmd/go/#hdr-Test_packages) to catch possible bugs in the code: `go test ./storage/...`. - - This project uses HTTP recordings for testing. - - The recorder should be attached to the client before calling the functions to test and later stopped. - - If you updated an existing test, its recording might need to be updated. Run `go test ./storage/... -ow -check.f TestName` to rerecord the test. - - Important note: all HTTP requests in the recording must be unique: different bodies, headers (`User-Agent`, `Authorization` and `Date` or `x-ms-date` headers are ignored), URLs and methods. As opposed to the example above, the following test is not suitable for recording: - -``` go -func (s *StorageQueueSuite) TestQueueExists(c *chk.C) { -cli := getQueueClient(c) -rec := cli.client.appendRecorder(c) -defer rec.Stop() - -queue := cli.GetQueueReference(queueName(c)) -ok, err := queue.Exists() -c.Assert(err, chk.IsNil) -c.Assert(ok, chk.Equals, false) - -c.Assert(queue.Create(nil), chk.IsNil) -defer queue.Delete(nil) - -ok, err = queue.Exists() // This is the very same request as the one 5 lines above -// The test replayer gets confused and the test fails in the last line -c.Assert(err, chk.IsNil) -c.Assert(ok, chk.Equals, true) -} -``` - - - On the other side, this test does not repeat requests: the URLs are different. - -``` go -func (s *StorageQueueSuite) TestQueueExists(c *chk.C) { -cli := getQueueClient(c) -rec := cli.client.appendRecorder(c) -defer rec.Stop() - -queue1 := cli.GetQueueReference(queueName(c, "nonexistent")) -ok, err := queue1.Exists() -c.Assert(err, chk.IsNil) -c.Assert(ok, chk.Equals, false) - -queue2 := cli.GetQueueReference(queueName(c, "exisiting")) -c.Assert(queue2.Create(nil), chk.IsNil) -defer queue2.Delete(nil) - -ok, err = queue2.Exists() -c.Assert(err, chk.IsNil) -c.Assert(ok, chk.Equals, true) -} -``` diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/blob.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/blob.go index 5047bfbb24b8..24ee5db6fbcc 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/storage/blob.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/blob.go @@ -140,9 +140,9 @@ func (b *Blob) Exists() (bool, error) { headers := b.Container.bsc.client.getStandardHeaders() resp, err := b.Container.bsc.client.exec(http.MethodHead, uri, headers, nil, b.Container.bsc.auth) if resp != nil { - defer readAndCloseBody(resp.body) - if resp.statusCode == http.StatusOK || resp.statusCode == http.StatusNotFound { - return resp.statusCode == http.StatusOK, nil + defer readAndCloseBody(resp.Body) + if resp.StatusCode == http.StatusOK || resp.StatusCode == http.StatusNotFound { + return resp.StatusCode == http.StatusOK, nil } } return false, err @@ -208,13 +208,13 @@ func (b *Blob) Get(options *GetBlobOptions) (io.ReadCloser, error) { return nil, err } - if err := checkRespCode(resp.statusCode, []int{http.StatusOK}); err != nil { + if err := checkRespCode(resp, []int{http.StatusOK}); err != nil { return nil, err } - if err := b.writeProperties(resp.headers, true); err != nil { - return resp.body, err + if err := b.writeProperties(resp.Header, true); err != nil { + return resp.Body, err } - return resp.body, nil + return resp.Body, nil } // GetRange reads the specified range of a blob to a stream. The bytesRange @@ -228,18 +228,18 @@ func (b *Blob) GetRange(options *GetBlobRangeOptions) (io.ReadCloser, error) { return nil, err } - if err := checkRespCode(resp.statusCode, []int{http.StatusPartialContent}); err != nil { + if err := checkRespCode(resp, []int{http.StatusPartialContent}); err != nil { return nil, err } // Content-Length header should not be updated, as the service returns the range length // (which is not alwys the full blob length) - if err := b.writeProperties(resp.headers, false); err != nil { - return resp.body, err + if err := b.writeProperties(resp.Header, false); err != nil { + return resp.Body, err } - return resp.body, nil + return resp.Body, nil } -func (b *Blob) getRange(options *GetBlobRangeOptions) (*storageResponse, error) { +func (b *Blob) getRange(options *GetBlobRangeOptions) (*http.Response, error) { params := url.Values{} headers := b.Container.bsc.client.getStandardHeaders() @@ -293,13 +293,13 @@ func (b *Blob) CreateSnapshot(options *SnapshotOptions) (snapshotTimestamp *time if err != nil || resp == nil { return nil, err } - defer readAndCloseBody(resp.body) + defer readAndCloseBody(resp.Body) - if err := checkRespCode(resp.statusCode, []int{http.StatusCreated}); err != nil { + if err := checkRespCode(resp, []int{http.StatusCreated}); err != nil { return nil, err } - snapshotResponse := resp.headers.Get(http.CanonicalHeaderKey("x-ms-snapshot")) + snapshotResponse := resp.Header.Get(http.CanonicalHeaderKey("x-ms-snapshot")) if snapshotResponse != "" { snapshotTimestamp, err := time.Parse(time.RFC3339, snapshotResponse) if err != nil { @@ -340,12 +340,12 @@ func (b *Blob) GetProperties(options *GetBlobPropertiesOptions) error { if err != nil { return err } - defer readAndCloseBody(resp.body) + defer readAndCloseBody(resp.Body) - if err = checkRespCode(resp.statusCode, []int{http.StatusOK}); err != nil { + if err = checkRespCode(resp, []int{http.StatusOK}); err != nil { return err } - return b.writeProperties(resp.headers, true) + return b.writeProperties(resp.Header, true) } func (b *Blob) writeProperties(h http.Header, includeContentLen bool) error { @@ -463,8 +463,8 @@ func (b *Blob) SetProperties(options *SetBlobPropertiesOptions) error { if err != nil { return err } - readAndCloseBody(resp.body) - return checkRespCode(resp.statusCode, []int{http.StatusOK}) + defer readAndCloseBody(resp.Body) + return checkRespCode(resp, []int{http.StatusOK}) } // SetBlobMetadataOptions includes the options for a set blob metadata operation @@ -501,8 +501,8 @@ func (b *Blob) SetMetadata(options *SetBlobMetadataOptions) error { if err != nil { return err } - readAndCloseBody(resp.body) - return checkRespCode(resp.statusCode, []int{http.StatusOK}) + defer readAndCloseBody(resp.Body) + return checkRespCode(resp, []int{http.StatusOK}) } // GetBlobMetadataOptions includes the options for a get blob metadata operation @@ -538,13 +538,13 @@ func (b *Blob) GetMetadata(options *GetBlobMetadataOptions) error { if err != nil { return err } - defer readAndCloseBody(resp.body) + defer readAndCloseBody(resp.Body) - if err := checkRespCode(resp.statusCode, []int{http.StatusOK}); err != nil { + if err := checkRespCode(resp, []int{http.StatusOK}); err != nil { return err } - b.writeMetadata(resp.headers) + b.writeMetadata(resp.Header) return nil } @@ -574,8 +574,8 @@ func (b *Blob) Delete(options *DeleteBlobOptions) error { if err != nil { return err } - readAndCloseBody(resp.body) - return checkRespCode(resp.statusCode, []int{http.StatusAccepted}) + defer readAndCloseBody(resp.Body) + return checkRespCode(resp, []int{http.StatusAccepted}) } // DeleteIfExists deletes the given blob from the specified container If the @@ -585,15 +585,15 @@ func (b *Blob) Delete(options *DeleteBlobOptions) error { func (b *Blob) DeleteIfExists(options *DeleteBlobOptions) (bool, error) { resp, err := b.delete(options) if resp != nil { - defer readAndCloseBody(resp.body) - if resp.statusCode == http.StatusAccepted || resp.statusCode == http.StatusNotFound { - return resp.statusCode == http.StatusAccepted, nil + defer readAndCloseBody(resp.Body) + if resp.StatusCode == http.StatusAccepted || resp.StatusCode == http.StatusNotFound { + return resp.StatusCode == http.StatusAccepted, nil } } return false, err } -func (b *Blob) delete(options *DeleteBlobOptions) (*storageResponse, error) { +func (b *Blob) delete(options *DeleteBlobOptions) (*http.Response, error) { params := url.Values{} headers := b.Container.bsc.client.getStandardHeaders() @@ -621,9 +621,9 @@ func pathForResource(container, name string) string { return fmt.Sprintf("/%s", container) } -func (b *Blob) respondCreation(resp *storageResponse, bt BlobType) error { - readAndCloseBody(resp.body) - err := checkRespCode(resp.statusCode, []int{http.StatusCreated}) +func (b *Blob) respondCreation(resp *http.Response, bt BlobType) error { + defer readAndCloseBody(resp.Body) + err := checkRespCode(resp, []int{http.StatusCreated}) if err != nil { return err } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/blobsasuri.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/blobsasuri.go index e11af77441e2..31894dbfc263 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/storage/blobsasuri.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/blobsasuri.go @@ -121,6 +121,10 @@ func (c *Client) blobAndFileSASURI(options SASOptions, uri, permissions, canonic "sig": {sig}, } + if start != "" { + sasParams.Add("st", start) + } + if c.apiVersion >= "2015-04-05" { if protocols != "" { sasParams.Add("spr", protocols) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/blobserviceclient.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/blobserviceclient.go index e6b9704ee183..f6a9da282253 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/storage/blobserviceclient.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/blobserviceclient.go @@ -108,8 +108,8 @@ func (b BlobStorageClient) ListContainers(params ListContainersParameters) (*Con if err != nil { return nil, err } - defer resp.body.Close() - err = xmlUnmarshal(resp.body, &outAlias) + defer resp.Body.Close() + err = xmlUnmarshal(resp.Body, &outAlias) if err != nil { return nil, err } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/blockblob.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/blockblob.go index e0176d664add..5d9467afdb75 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/storage/blockblob.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/blockblob.go @@ -229,8 +229,8 @@ func (b *Blob) PutBlockList(blocks []Block, options *PutBlockListOptions) error if err != nil { return err } - readAndCloseBody(resp.body) - return checkRespCode(resp.statusCode, []int{http.StatusCreated}) + defer readAndCloseBody(resp.Body) + return checkRespCode(resp, []int{http.StatusCreated}) } // GetBlockListOptions includes the options for a get block list operation @@ -263,8 +263,8 @@ func (b *Blob) GetBlockList(blockType BlockListType, options *GetBlockListOption if err != nil { return out, err } - defer resp.body.Close() + defer resp.Body.Close() - err = xmlUnmarshal(resp.body, &out) + err = xmlUnmarshal(resp.Body, &out) return out, err } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/client.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/client.go index 7d502306d81c..5adba4a1b387 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/storage/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/client.go @@ -17,7 +17,6 @@ package storage import ( "bufio" - "bytes" "encoding/base64" "encoding/json" "encoding/xml" @@ -35,6 +34,7 @@ import ( "strings" "time" + "github.com/Azure/azure-sdk-for-go/version" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" ) @@ -151,14 +151,8 @@ type Client struct { accountSASToken url.Values } -type storageResponse struct { - statusCode int - headers http.Header - body io.ReadCloser -} - type odataResponse struct { - storageResponse + resp *http.Response odata odataErrorWrapper } @@ -198,6 +192,7 @@ type odataErrorWrapper struct { type UnexpectedStatusCodeError struct { allowed []int got int + inner error } func (e UnexpectedStatusCodeError) Error() string { @@ -208,7 +203,7 @@ func (e UnexpectedStatusCodeError) Error() string { for _, v := range e.allowed { expected = append(expected, s(v)) } - return fmt.Sprintf("storage: status code from service response is %s; was expecting %s", got, strings.Join(expected, " or ")) + return fmt.Sprintf("storage: status code from service response is %s; was expecting %s. Inner error: %+v", got, strings.Join(expected, " or "), e.inner) } // Got is the actual status code returned by Azure. @@ -216,6 +211,11 @@ func (e UnexpectedStatusCodeError) Got() int { return e.got } +// Inner returns any inner error info. +func (e UnexpectedStatusCodeError) Inner() error { + return e.inner +} + // NewClientFromConnectionString creates a Client from the connection string. func NewClientFromConnectionString(input string) (Client, error) { // build a map of connection string key/value pairs @@ -415,7 +415,7 @@ func (c Client) getDefaultUserAgent() string { runtime.Version(), runtime.GOARCH, runtime.GOOS, - sdkVersion, + version.Number, c.apiVersion, ) } @@ -704,7 +704,7 @@ func (c Client) getStandardHeaders() map[string]string { } } -func (c Client) exec(verb, url string, headers map[string]string, body io.Reader, auth authentication) (*storageResponse, error) { +func (c Client) exec(verb, url string, headers map[string]string, body io.Reader, auth authentication) (*http.Response, error) { headers, err := c.addAuthorizationHeader(verb, url, headers, auth) if err != nil { return nil, err @@ -742,48 +742,10 @@ func (c Client) exec(verb, url string, headers map[string]string, body io.Reader } if resp.StatusCode >= 400 && resp.StatusCode <= 505 { - var respBody []byte - respBody, err = readAndCloseBody(resp.Body) - if err != nil { - return nil, err - } - - requestID, date, version := getDebugHeaders(resp.Header) - if len(respBody) == 0 { - // no error in response body, might happen in HEAD requests - err = serviceErrFromStatusCode(resp.StatusCode, resp.Status, requestID, date, version) - } else { - storageErr := AzureStorageServiceError{ - StatusCode: resp.StatusCode, - RequestID: requestID, - Date: date, - APIVersion: version, - } - // response contains storage service error object, unmarshal - if resp.Header.Get("Content-Type") == "application/xml" { - errIn := serviceErrFromXML(respBody, &storageErr) - if err != nil { // error unmarshaling the error response - err = errIn - } - } else { - errIn := serviceErrFromJSON(respBody, &storageErr) - if err != nil { // error unmarshaling the error response - err = errIn - } - } - err = storageErr - } - return &storageResponse{ - statusCode: resp.StatusCode, - headers: resp.Header, - body: ioutil.NopCloser(bytes.NewReader(respBody)), /* restore the body */ - }, err + return resp, getErrorFromResponse(resp) } - return &storageResponse{ - statusCode: resp.StatusCode, - headers: resp.Header, - body: resp.Body}, nil + return resp, nil } func (c Client) execInternalJSONCommon(verb, url string, headers map[string]string, body io.Reader, auth authentication) (*odataResponse, *http.Request, *http.Response, error) { @@ -802,10 +764,7 @@ func (c Client) execInternalJSONCommon(verb, url string, headers map[string]stri return nil, nil, nil, err } - respToRet := &odataResponse{} - respToRet.body = resp.Body - respToRet.statusCode = resp.StatusCode - respToRet.headers = resp.Header + respToRet := &odataResponse{resp: resp} statusCode := resp.StatusCode if statusCode >= 400 && statusCode <= 505 { @@ -890,7 +849,7 @@ func genChangesetReader(req *http.Request, respToRet *odataResponse, batchPartBu if err != nil { return err } - respToRet.statusCode = changesetResp.StatusCode + respToRet.resp = changesetResp } return nil @@ -963,13 +922,18 @@ func (e AzureStorageServiceError) Error() string { // checkRespCode returns UnexpectedStatusError if the given response code is not // one of the allowed status codes; otherwise nil. -func checkRespCode(respCode int, allowed []int) error { +func checkRespCode(resp *http.Response, allowed []int) error { for _, v := range allowed { - if respCode == v { + if resp.StatusCode == v { return nil } } - return UnexpectedStatusCodeError{allowed, respCode} + err := getErrorFromResponse(resp) + return UnexpectedStatusCodeError{ + allowed: allowed, + got: resp.StatusCode, + inner: err, + } } func (c Client) addMetadataToHeaders(h map[string]string, metadata map[string]string) map[string]string { @@ -986,3 +950,37 @@ func getDebugHeaders(h http.Header) (requestID, date, version string) { date = h.Get("Date") return } + +func getErrorFromResponse(resp *http.Response) error { + respBody, err := readAndCloseBody(resp.Body) + if err != nil { + return err + } + + requestID, date, version := getDebugHeaders(resp.Header) + if len(respBody) == 0 { + // no error in response body, might happen in HEAD requests + err = serviceErrFromStatusCode(resp.StatusCode, resp.Status, requestID, date, version) + } else { + storageErr := AzureStorageServiceError{ + StatusCode: resp.StatusCode, + RequestID: requestID, + Date: date, + APIVersion: version, + } + // response contains storage service error object, unmarshal + if resp.Header.Get("Content-Type") == "application/xml" { + errIn := serviceErrFromXML(respBody, &storageErr) + if err != nil { // error unmarshaling the error response + err = errIn + } + } else { + errIn := serviceErrFromJSON(respBody, &storageErr) + if err != nil { // error unmarshaling the error response + err = errIn + } + } + err = storageErr + } + return err +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/container.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/container.go index 38463bb67f0d..bba44db74747 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/storage/container.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/container.go @@ -16,7 +16,6 @@ package storage import ( "encoding/xml" - "errors" "fmt" "io" "net/http" @@ -95,11 +94,12 @@ func (c *Container) GetSASURI(options ContainerSASOptions) (string, error) { // ContainerProperties contains various properties of a container returned from // various endpoints like ListContainers. type ContainerProperties struct { - LastModified string `xml:"Last-Modified"` - Etag string `xml:"Etag"` - LeaseStatus string `xml:"LeaseStatus"` - LeaseState string `xml:"LeaseState"` - LeaseDuration string `xml:"LeaseDuration"` + LastModified string `xml:"Last-Modified"` + Etag string `xml:"Etag"` + LeaseStatus string `xml:"LeaseStatus"` + LeaseState string `xml:"LeaseState"` + LeaseDuration string `xml:"LeaseDuration"` + PublicAccess ContainerAccessType `xml:"PublicAccess"` } // ContainerListResponse contains the response fields from @@ -258,8 +258,8 @@ func (c *Container) Create(options *CreateContainerOptions) error { if err != nil { return err } - readAndCloseBody(resp.body) - return checkRespCode(resp.statusCode, []int{http.StatusCreated}) + defer readAndCloseBody(resp.Body) + return checkRespCode(resp, []int{http.StatusCreated}) } // CreateIfNotExists creates a blob container if it does not exist. Returns @@ -267,15 +267,15 @@ func (c *Container) Create(options *CreateContainerOptions) error { func (c *Container) CreateIfNotExists(options *CreateContainerOptions) (bool, error) { resp, err := c.create(options) if resp != nil { - defer readAndCloseBody(resp.body) - if resp.statusCode == http.StatusCreated || resp.statusCode == http.StatusConflict { - return resp.statusCode == http.StatusCreated, nil + defer readAndCloseBody(resp.Body) + if resp.StatusCode == http.StatusCreated || resp.StatusCode == http.StatusConflict { + return resp.StatusCode == http.StatusCreated, nil } } return false, err } -func (c *Container) create(options *CreateContainerOptions) (*storageResponse, error) { +func (c *Container) create(options *CreateContainerOptions) (*http.Response, error) { query := url.Values{"restype": {"container"}} headers := c.bsc.client.getStandardHeaders() headers = c.bsc.client.addMetadataToHeaders(headers, c.Metadata) @@ -307,9 +307,9 @@ func (c *Container) Exists() (bool, error) { resp, err := c.bsc.client.exec(http.MethodHead, uri, headers, nil, c.bsc.auth) if resp != nil { - defer readAndCloseBody(resp.body) - if resp.statusCode == http.StatusOK || resp.statusCode == http.StatusNotFound { - return resp.statusCode == http.StatusOK, nil + defer readAndCloseBody(resp.Body) + if resp.StatusCode == http.StatusOK || resp.StatusCode == http.StatusNotFound { + return resp.StatusCode == http.StatusOK, nil } } return false, err @@ -349,13 +349,8 @@ func (c *Container) SetPermissions(permissions ContainerPermissions, options *Se if err != nil { return err } - defer readAndCloseBody(resp.body) - - if err := checkRespCode(resp.statusCode, []int{http.StatusOK}); err != nil { - return errors.New("Unable to set permissions") - } - - return nil + defer readAndCloseBody(resp.Body) + return checkRespCode(resp, []int{http.StatusOK}) } // GetContainerPermissionOptions includes options for a get container permissions operation @@ -385,14 +380,14 @@ func (c *Container) GetPermissions(options *GetContainerPermissionOptions) (*Con if err != nil { return nil, err } - defer resp.body.Close() + defer resp.Body.Close() var ap AccessPolicy - err = xmlUnmarshal(resp.body, &ap.SignedIdentifiersList) + err = xmlUnmarshal(resp.Body, &ap.SignedIdentifiersList) if err != nil { return nil, err } - return buildAccessPolicy(ap, &resp.headers), nil + return buildAccessPolicy(ap, &resp.Header), nil } func buildAccessPolicy(ap AccessPolicy, headers *http.Header) *ContainerPermissions { @@ -436,8 +431,8 @@ func (c *Container) Delete(options *DeleteContainerOptions) error { if err != nil { return err } - readAndCloseBody(resp.body) - return checkRespCode(resp.statusCode, []int{http.StatusAccepted}) + defer readAndCloseBody(resp.Body) + return checkRespCode(resp, []int{http.StatusAccepted}) } // DeleteIfExists deletes the container with given name on the storage @@ -449,15 +444,15 @@ func (c *Container) Delete(options *DeleteContainerOptions) error { func (c *Container) DeleteIfExists(options *DeleteContainerOptions) (bool, error) { resp, err := c.delete(options) if resp != nil { - defer readAndCloseBody(resp.body) - if resp.statusCode == http.StatusAccepted || resp.statusCode == http.StatusNotFound { - return resp.statusCode == http.StatusAccepted, nil + defer readAndCloseBody(resp.Body) + if resp.StatusCode == http.StatusAccepted || resp.StatusCode == http.StatusNotFound { + return resp.StatusCode == http.StatusAccepted, nil } } return false, err } -func (c *Container) delete(options *DeleteContainerOptions) (*storageResponse, error) { +func (c *Container) delete(options *DeleteContainerOptions) (*http.Response, error) { query := url.Values{"restype": {"container"}} headers := c.bsc.client.getStandardHeaders() @@ -497,9 +492,9 @@ func (c *Container) ListBlobs(params ListBlobsParameters) (BlobListResponse, err if err != nil { return out, err } - defer resp.body.Close() + defer resp.Body.Close() - err = xmlUnmarshal(resp.body, &out) + err = xmlUnmarshal(resp.Body, &out) for i := range out.Blobs { out.Blobs[i].Container = c } @@ -540,8 +535,8 @@ func (c *Container) SetMetadata(options *ContainerMetadataOptions) error { if err != nil { return err } - readAndCloseBody(resp.body) - return checkRespCode(resp.statusCode, []int{http.StatusOK}) + defer readAndCloseBody(resp.Body) + return checkRespCode(resp, []int{http.StatusOK}) } // GetMetadata returns all user-defined metadata for the specified container. @@ -568,12 +563,12 @@ func (c *Container) GetMetadata(options *ContainerMetadataOptions) error { if err != nil { return err } - readAndCloseBody(resp.body) - if err := checkRespCode(resp.statusCode, []int{http.StatusOK}); err != nil { + defer readAndCloseBody(resp.Body) + if err := checkRespCode(resp, []int{http.StatusOK}); err != nil { return err } - c.writeMetadata(resp.headers) + c.writeMetadata(resp.Header) return nil } @@ -612,3 +607,34 @@ func (capd *ContainerAccessPolicy) generateContainerPermissions() (permissions s return permissions } + +// GetProperties updated the properties of the container. +// +// See https://docs.microsoft.com/en-us/rest/api/storageservices/get-container-properties +func (c *Container) GetProperties() error { + params := url.Values{ + "restype": {"container"}, + } + headers := c.bsc.client.getStandardHeaders() + + uri := c.bsc.client.getEndpoint(blobServiceName, c.buildPath(), params) + + resp, err := c.bsc.client.exec(http.MethodGet, uri, headers, nil, c.bsc.auth) + if err != nil { + return err + } + defer resp.Body.Close() + if err := checkRespCode(resp, []int{http.StatusOK}); err != nil { + return err + } + + // update properties + c.Properties.Etag = resp.Header.Get(headerEtag) + c.Properties.LeaseStatus = resp.Header.Get("x-ms-lease-status") + c.Properties.LeaseState = resp.Header.Get("x-ms-lease-state") + c.Properties.LeaseDuration = resp.Header.Get("x-ms-lease-duration") + c.Properties.LastModified = resp.Header.Get("Last-Modified") + c.Properties.PublicAccess = ContainerAccessType(resp.Header.Get(ContainerAccessHeader)) + + return nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/copyblob.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/copyblob.go index a4cc2527b67f..248dfb220eb8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/storage/copyblob.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/copyblob.go @@ -110,13 +110,13 @@ func (b *Blob) StartCopy(sourceBlob string, options *CopyOptions) (string, error if err != nil { return "", err } - defer readAndCloseBody(resp.body) + defer readAndCloseBody(resp.Body) - if err := checkRespCode(resp.statusCode, []int{http.StatusAccepted, http.StatusCreated}); err != nil { + if err := checkRespCode(resp, []int{http.StatusAccepted, http.StatusCreated}); err != nil { return "", err } - copyID := resp.headers.Get("x-ms-copy-id") + copyID := resp.Header.Get("x-ms-copy-id") if copyID == "" { return "", errors.New("Got empty copy id header") } @@ -152,8 +152,8 @@ func (b *Blob) AbortCopy(copyID string, options *AbortCopyOptions) error { if err != nil { return err } - readAndCloseBody(resp.body) - return checkRespCode(resp.statusCode, []int{http.StatusNoContent}) + defer readAndCloseBody(resp.Body) + return checkRespCode(resp, []int{http.StatusNoContent}) } // WaitForCopy loops until a BlobCopy operation is completed (or fails with error) @@ -223,13 +223,13 @@ func (b *Blob) IncrementalCopyBlob(sourceBlobURL string, snapshotTime time.Time, if err != nil { return "", err } - defer readAndCloseBody(resp.body) + defer readAndCloseBody(resp.Body) - if err := checkRespCode(resp.statusCode, []int{http.StatusAccepted}); err != nil { + if err := checkRespCode(resp, []int{http.StatusAccepted}); err != nil { return "", err } - copyID := resp.headers.Get("x-ms-copy-id") + copyID := resp.Header.Get("x-ms-copy-id") if copyID == "" { return "", errors.New("Got empty copy id header") } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/directory.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/directory.go index 189e03802444..237d10fd155c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/storage/directory.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/directory.go @@ -107,10 +107,10 @@ func (d *Directory) CreateIfNotExists(options *FileRequestOptions) (bool, error) params := prepareOptions(options) resp, err := d.fsc.createResourceNoClose(d.buildPath(), resourceDirectory, params, nil) if resp != nil { - defer readAndCloseBody(resp.body) - if resp.statusCode == http.StatusCreated || resp.statusCode == http.StatusConflict { - if resp.statusCode == http.StatusCreated { - d.updateEtagAndLastModified(resp.headers) + defer readAndCloseBody(resp.Body) + if resp.StatusCode == http.StatusCreated || resp.StatusCode == http.StatusConflict { + if resp.StatusCode == http.StatusCreated { + d.updateEtagAndLastModified(resp.Header) return true, nil } @@ -135,9 +135,9 @@ func (d *Directory) Delete(options *FileRequestOptions) error { func (d *Directory) DeleteIfExists(options *FileRequestOptions) (bool, error) { resp, err := d.fsc.deleteResourceNoClose(d.buildPath(), resourceDirectory, options) if resp != nil { - defer readAndCloseBody(resp.body) - if resp.statusCode == http.StatusAccepted || resp.statusCode == http.StatusNotFound { - return resp.statusCode == http.StatusAccepted, nil + defer readAndCloseBody(resp.Body) + if resp.StatusCode == http.StatusAccepted || resp.StatusCode == http.StatusNotFound { + return resp.StatusCode == http.StatusAccepted, nil } } return false, err @@ -200,9 +200,9 @@ func (d *Directory) ListDirsAndFiles(params ListDirsAndFilesParameters) (*DirsAn return nil, err } - defer resp.body.Close() + defer resp.Body.Close() var out DirsAndFilesListResponse - err = xmlUnmarshal(resp.body, &out) + err = xmlUnmarshal(resp.Body, &out) return &out, err } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/entity.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/entity.go index 4533d7d5edfc..5af9b1ef3e35 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/storage/entity.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/entity.go @@ -16,6 +16,7 @@ package storage import ( "bytes" + "encoding/base64" "encoding/json" "errors" "fmt" @@ -111,13 +112,13 @@ func (e *Entity) Get(timeout uint, ml MetadataLevel, options *GetEntityOptions) if err != nil { return err } - defer readAndCloseBody(resp.body) + defer readAndCloseBody(resp.Body) - if err = checkRespCode(resp.statusCode, []int{http.StatusOK}); err != nil { + if err = checkRespCode(resp, []int{http.StatusOK}); err != nil { return err } - respBody, err := ioutil.ReadAll(resp.body) + respBody, err := ioutil.ReadAll(resp.Body) if err != nil { return err } @@ -153,22 +154,21 @@ func (e *Entity) Insert(ml MetadataLevel, options *EntityOptions) error { if err != nil { return err } - defer resp.body.Close() - - data, err := ioutil.ReadAll(resp.body) - if err != nil { - return err - } + defer readAndCloseBody(resp.Body) if ml != EmptyPayload { - if err = checkRespCode(resp.statusCode, []int{http.StatusCreated}); err != nil { + if err = checkRespCode(resp, []int{http.StatusCreated}); err != nil { + return err + } + data, err := ioutil.ReadAll(resp.Body) + if err != nil { return err } if err = e.UnmarshalJSON(data); err != nil { return err } } else { - if err = checkRespCode(resp.statusCode, []int{http.StatusNoContent}); err != nil { + if err = checkRespCode(resp, []int{http.StatusNoContent}); err != nil { return err } } @@ -207,18 +207,18 @@ func (e *Entity) Delete(force bool, options *EntityOptions) error { uri := e.Table.tsc.client.getEndpoint(tableServiceName, e.buildPath(), query) resp, err := e.Table.tsc.client.exec(http.MethodDelete, uri, headers, nil, e.Table.tsc.auth) if err != nil { - if resp.statusCode == http.StatusPreconditionFailed { + if resp.StatusCode == http.StatusPreconditionFailed { return fmt.Errorf(etagErrorTemplate, err) } return err } - defer readAndCloseBody(resp.body) + defer readAndCloseBody(resp.Body) - if err = checkRespCode(resp.statusCode, []int{http.StatusNoContent}); err != nil { + if err = checkRespCode(resp, []int{http.StatusNoContent}); err != nil { return err } - return e.updateTimestamp(resp.headers) + return e.updateTimestamp(resp.Header) } // InsertOrReplace inserts an entity or replaces the existing one. @@ -247,7 +247,7 @@ func (e *Entity) MarshalJSON() ([]byte, error) { switch t := v.(type) { case []byte: completeMap[typeKey] = OdataBinary - completeMap[k] = string(t) + completeMap[k] = t case time.Time: completeMap[typeKey] = OdataDateTime completeMap[k] = t.Format(time.RFC3339Nano) @@ -321,7 +321,10 @@ func (e *Entity) UnmarshalJSON(data []byte) error { } switch v { case OdataBinary: - props[valueKey] = []byte(str) + props[valueKey], err = base64.StdEncoding.DecodeString(str) + if err != nil { + return fmt.Errorf(errorTemplate, err) + } case OdataDateTime: t, err := time.Parse("2006-01-02T15:04:05Z", str) if err != nil { @@ -396,13 +399,13 @@ func (e *Entity) insertOr(verb string, options *EntityOptions) error { if err != nil { return err } - defer readAndCloseBody(resp.body) + defer readAndCloseBody(resp.Body) - if err = checkRespCode(resp.statusCode, []int{http.StatusNoContent}); err != nil { + if err = checkRespCode(resp, []int{http.StatusNoContent}); err != nil { return err } - return e.updateEtagAndTimestamp(resp.headers) + return e.updateEtagAndTimestamp(resp.Header) } func (e *Entity) updateMerge(force bool, verb string, options *EntityOptions) error { @@ -420,18 +423,18 @@ func (e *Entity) updateMerge(force bool, verb string, options *EntityOptions) er uri := e.Table.tsc.client.getEndpoint(tableServiceName, e.buildPath(), query) resp, err := e.Table.tsc.client.exec(verb, uri, headers, bytes.NewReader(body), e.Table.tsc.auth) if err != nil { - if resp.statusCode == http.StatusPreconditionFailed { + if resp.StatusCode == http.StatusPreconditionFailed { return fmt.Errorf(etagErrorTemplate, err) } return err } - defer readAndCloseBody(resp.body) + defer readAndCloseBody(resp.Body) - if err = checkRespCode(resp.statusCode, []int{http.StatusNoContent}); err != nil { + if err = checkRespCode(resp, []int{http.StatusNoContent}); err != nil { return err } - return e.updateEtagAndTimestamp(resp.headers) + return e.updateEtagAndTimestamp(resp.Header) } func stringFromMap(props map[string]interface{}, key string) string { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/file.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/file.go index 5fb516c55fdb..8afc2e23355b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/storage/file.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/file.go @@ -28,6 +28,10 @@ import ( const fourMB = uint64(4194304) const oneTB = uint64(1099511627776) +// Export maximum range and file sizes +const MaxRangeSize = fourMB +const MaxFileSize = oneTB + // File represents a file on a share. type File struct { fsc *FileServiceClient @@ -183,9 +187,9 @@ func (f *File) Delete(options *FileRequestOptions) error { func (f *File) DeleteIfExists(options *FileRequestOptions) (bool, error) { resp, err := f.fsc.deleteResourceNoClose(f.buildPath(), resourceFile, options) if resp != nil { - defer readAndCloseBody(resp.body) - if resp.statusCode == http.StatusAccepted || resp.statusCode == http.StatusNotFound { - return resp.statusCode == http.StatusAccepted, nil + defer readAndCloseBody(resp.Body) + if resp.StatusCode == http.StatusAccepted || resp.StatusCode == http.StatusNotFound { + return resp.StatusCode == http.StatusAccepted, nil } } return false, err @@ -207,11 +211,11 @@ func (f *File) DownloadToStream(options *FileRequestOptions) (io.ReadCloser, err return nil, err } - if err = checkRespCode(resp.statusCode, []int{http.StatusOK}); err != nil { - readAndCloseBody(resp.body) + if err = checkRespCode(resp, []int{http.StatusOK}); err != nil { + readAndCloseBody(resp.Body) return nil, err } - return resp.body, nil + return resp.Body, nil } // DownloadRangeToStream operation downloads the specified range of this file with optional MD5 hash. @@ -237,14 +241,14 @@ func (f *File) DownloadRangeToStream(fileRange FileRange, options *GetFileOption return fs, err } - if err = checkRespCode(resp.statusCode, []int{http.StatusOK, http.StatusPartialContent}); err != nil { - readAndCloseBody(resp.body) + if err = checkRespCode(resp, []int{http.StatusOK, http.StatusPartialContent}); err != nil { + readAndCloseBody(resp.Body) return fs, err } - fs.Body = resp.body + fs.Body = resp.Body if options != nil && options.GetContentMD5 { - fs.ContentMD5 = resp.headers.Get("Content-MD5") + fs.ContentMD5 = resp.Header.Get("Content-MD5") } return fs, nil } @@ -310,20 +314,20 @@ func (f *File) ListRanges(options *ListRangesOptions) (*FileRanges, error) { return nil, err } - defer resp.body.Close() + defer resp.Body.Close() var cl uint64 - cl, err = strconv.ParseUint(resp.headers.Get("x-ms-content-length"), 10, 64) + cl, err = strconv.ParseUint(resp.Header.Get("x-ms-content-length"), 10, 64) if err != nil { - ioutil.ReadAll(resp.body) + ioutil.ReadAll(resp.Body) return nil, err } var out FileRanges out.ContentLength = cl - out.ETag = resp.headers.Get("ETag") - out.LastModified = resp.headers.Get("Last-Modified") + out.ETag = resp.Header.Get("ETag") + out.LastModified = resp.Header.Get("Last-Modified") - err = xmlUnmarshal(resp.body, &out) + err = xmlUnmarshal(resp.Body, &out) return &out, err } @@ -371,8 +375,8 @@ func (f *File) modifyRange(bytes io.Reader, fileRange FileRange, timeout *uint, if err != nil { return nil, err } - defer readAndCloseBody(resp.body) - return resp.headers, checkRespCode(resp.statusCode, []int{http.StatusCreated}) + defer readAndCloseBody(resp.Body) + return resp.Header, checkRespCode(resp, []int{http.StatusCreated}) } // SetMetadata replaces the metadata for this file. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/fileserviceclient.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/fileserviceclient.go index 295e3d3e25c3..6467937d2fac 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/storage/fileserviceclient.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/fileserviceclient.go @@ -154,8 +154,8 @@ func (f FileServiceClient) ListShares(params ListSharesParameters) (*ShareListRe if err != nil { return nil, err } - defer resp.body.Close() - err = xmlUnmarshal(resp.body, &out) + defer resp.Body.Close() + err = xmlUnmarshal(resp.Body, &out) // assign our client to the newly created Share objects for i := range out.Shares { @@ -179,7 +179,7 @@ func (f *FileServiceClient) SetServiceProperties(props ServiceProperties) error } // retrieves directory or share content -func (f FileServiceClient) listContent(path string, params url.Values, extraHeaders map[string]string) (*storageResponse, error) { +func (f FileServiceClient) listContent(path string, params url.Values, extraHeaders map[string]string) (*http.Response, error) { if err := f.checkForStorageEmulator(); err != nil { return nil, err } @@ -193,8 +193,8 @@ func (f FileServiceClient) listContent(path string, params url.Values, extraHead return nil, err } - if err = checkRespCode(resp.statusCode, []int{http.StatusOK}); err != nil { - readAndCloseBody(resp.body) + if err = checkRespCode(resp, []int{http.StatusOK}); err != nil { + readAndCloseBody(resp.Body) return nil, err } @@ -212,9 +212,9 @@ func (f FileServiceClient) resourceExists(path string, res resourceType) (bool, resp, err := f.client.exec(http.MethodHead, uri, headers, nil, f.auth) if resp != nil { - defer readAndCloseBody(resp.body) - if resp.statusCode == http.StatusOK || resp.statusCode == http.StatusNotFound { - return resp.statusCode == http.StatusOK, resp.headers, nil + defer readAndCloseBody(resp.Body) + if resp.StatusCode == http.StatusOK || resp.StatusCode == http.StatusNotFound { + return resp.StatusCode == http.StatusOK, resp.Header, nil } } return false, nil, err @@ -226,12 +226,12 @@ func (f FileServiceClient) createResource(path string, res resourceType, urlPara if err != nil { return nil, err } - defer readAndCloseBody(resp.body) - return resp.headers, checkRespCode(resp.statusCode, expectedResponseCodes) + defer readAndCloseBody(resp.Body) + return resp.Header, checkRespCode(resp, expectedResponseCodes) } // creates a resource depending on the specified resource type, doesn't close the response body -func (f FileServiceClient) createResourceNoClose(path string, res resourceType, urlParams url.Values, extraHeaders map[string]string) (*storageResponse, error) { +func (f FileServiceClient) createResourceNoClose(path string, res resourceType, urlParams url.Values, extraHeaders map[string]string) (*http.Response, error) { if err := f.checkForStorageEmulator(); err != nil { return nil, err } @@ -251,17 +251,17 @@ func (f FileServiceClient) getResourceHeaders(path string, comp compType, res re if err != nil { return nil, err } - defer readAndCloseBody(resp.body) + defer readAndCloseBody(resp.Body) - if err = checkRespCode(resp.statusCode, []int{http.StatusOK}); err != nil { + if err = checkRespCode(resp, []int{http.StatusOK}); err != nil { return nil, err } - return resp.headers, nil + return resp.Header, nil } // gets the specified resource, doesn't close the response body -func (f FileServiceClient) getResourceNoClose(path string, comp compType, res resourceType, params url.Values, verb string, extraHeaders map[string]string) (*storageResponse, error) { +func (f FileServiceClient) getResourceNoClose(path string, comp compType, res resourceType, params url.Values, verb string, extraHeaders map[string]string) (*http.Response, error) { if err := f.checkForStorageEmulator(); err != nil { return nil, err } @@ -279,12 +279,12 @@ func (f FileServiceClient) deleteResource(path string, res resourceType, options if err != nil { return err } - defer readAndCloseBody(resp.body) - return checkRespCode(resp.statusCode, []int{http.StatusAccepted}) + defer readAndCloseBody(resp.Body) + return checkRespCode(resp, []int{http.StatusAccepted}) } // deletes the resource and returns the response, doesn't close the response body -func (f FileServiceClient) deleteResourceNoClose(path string, res resourceType, options *FileRequestOptions) (*storageResponse, error) { +func (f FileServiceClient) deleteResourceNoClose(path string, res resourceType, options *FileRequestOptions) (*http.Response, error) { if err := f.checkForStorageEmulator(); err != nil { return nil, err } @@ -323,9 +323,9 @@ func (f FileServiceClient) setResourceHeaders(path string, comp compType, res re if err != nil { return nil, err } - defer readAndCloseBody(resp.body) + defer readAndCloseBody(resp.Body) - return resp.headers, checkRespCode(resp.statusCode, []int{http.StatusOK}) + return resp.Header, checkRespCode(resp, []int{http.StatusOK}) } //checkForStorageEmulator determines if the client is setup for use with diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/leaseblob.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/leaseblob.go index 3d9d52d8e352..22ddbcd65d8b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/storage/leaseblob.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/leaseblob.go @@ -53,13 +53,13 @@ func (b *Blob) leaseCommonPut(headers map[string]string, expectedStatus int, opt if err != nil { return nil, err } - defer readAndCloseBody(resp.body) + defer readAndCloseBody(resp.Body) - if err := checkRespCode(resp.statusCode, []int{expectedStatus}); err != nil { + if err := checkRespCode(resp, []int{expectedStatus}); err != nil { return nil, err } - return resp.headers, nil + return resp.Header, nil } // LeaseOptions includes options for all operations regarding leasing blobs diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/message.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/message.go index 7d9038a5f71f..ff13704ea10f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/storage/message.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/message.go @@ -78,13 +78,16 @@ func (m *Message) Put(options *PutMessageOptions) error { if err != nil { return err } - defer readAndCloseBody(resp.body) - - err = xmlUnmarshal(resp.body, m) + defer readAndCloseBody(resp.Body) + err = checkRespCode(resp, []int{http.StatusCreated}) + if err != nil { + return err + } + err = xmlUnmarshal(resp.Body, m) if err != nil { return err } - return checkRespCode(resp.statusCode, []int{http.StatusCreated}) + return nil } // UpdateMessageOptions is the set of options can be specified for Update Messsage @@ -125,10 +128,10 @@ func (m *Message) Update(options *UpdateMessageOptions) error { if err != nil { return err } - defer readAndCloseBody(resp.body) + defer readAndCloseBody(resp.Body) - m.PopReceipt = resp.headers.Get("x-ms-popreceipt") - nextTimeStr := resp.headers.Get("x-ms-time-next-visible") + m.PopReceipt = resp.Header.Get("x-ms-popreceipt") + nextTimeStr := resp.Header.Get("x-ms-time-next-visible") if nextTimeStr != "" { nextTime, err := time.Parse(time.RFC1123, nextTimeStr) if err != nil { @@ -137,7 +140,7 @@ func (m *Message) Update(options *UpdateMessageOptions) error { m.NextVisible = TimeRFC1123(nextTime) } - return checkRespCode(resp.statusCode, []int{http.StatusNoContent}) + return checkRespCode(resp, []int{http.StatusNoContent}) } // Delete operation deletes the specified message. @@ -157,8 +160,8 @@ func (m *Message) Delete(options *QueueServiceOptions) error { if err != nil { return err } - readAndCloseBody(resp.body) - return checkRespCode(resp.statusCode, []int{http.StatusNoContent}) + defer readAndCloseBody(resp.Body) + return checkRespCode(resp, []int{http.StatusNoContent}) } type putMessageRequest struct { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/pageblob.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/pageblob.go index f07166521696..007e19e618b4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/storage/pageblob.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/pageblob.go @@ -121,9 +121,8 @@ func (b *Blob) modifyRange(blobRange BlobRange, bytes io.Reader, options *PutPag if err != nil { return err } - readAndCloseBody(resp.body) - - return checkRespCode(resp.statusCode, []int{http.StatusCreated}) + defer readAndCloseBody(resp.Body) + return checkRespCode(resp, []int{http.StatusCreated}) } // GetPageRangesOptions includes the options for a get page ranges operation @@ -161,12 +160,12 @@ func (b *Blob) GetPageRanges(options *GetPageRangesOptions) (GetPageRangesRespon if err != nil { return out, err } - defer resp.body.Close() + defer readAndCloseBody(resp.Body) - if err = checkRespCode(resp.statusCode, []int{http.StatusOK}); err != nil { + if err = checkRespCode(resp, []int{http.StatusOK}); err != nil { return out, err } - err = xmlUnmarshal(resp.body, &out) + err = xmlUnmarshal(resp.Body, &out) return out, err } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/queue.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/queue.go index 499592ebd125..9a821c56ade3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/storage/queue.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/queue.go @@ -16,7 +16,6 @@ package storage import ( "encoding/xml" - "errors" "fmt" "io" "net/http" @@ -92,8 +91,8 @@ func (q *Queue) Create(options *QueueServiceOptions) error { if err != nil { return err } - readAndCloseBody(resp.body) - return checkRespCode(resp.statusCode, []int{http.StatusCreated}) + defer readAndCloseBody(resp.Body) + return checkRespCode(resp, []int{http.StatusCreated}) } // Delete operation permanently deletes the specified queue. @@ -112,8 +111,8 @@ func (q *Queue) Delete(options *QueueServiceOptions) error { if err != nil { return err } - readAndCloseBody(resp.body) - return checkRespCode(resp.statusCode, []int{http.StatusNoContent}) + defer readAndCloseBody(resp.Body) + return checkRespCode(resp, []int{http.StatusNoContent}) } // Exists returns true if a queue with given name exists. @@ -121,10 +120,11 @@ func (q *Queue) Exists() (bool, error) { uri := q.qsc.client.getEndpoint(queueServiceName, q.buildPath(), url.Values{"comp": {"metadata"}}) resp, err := q.qsc.client.exec(http.MethodGet, uri, q.qsc.client.getStandardHeaders(), nil, q.qsc.auth) if resp != nil { - defer readAndCloseBody(resp.body) - if resp.statusCode == http.StatusOK || resp.statusCode == http.StatusNotFound { - return resp.statusCode == http.StatusOK, nil + defer readAndCloseBody(resp.Body) + if resp.StatusCode == http.StatusOK || resp.StatusCode == http.StatusNotFound { + return resp.StatusCode == http.StatusOK, nil } + err = getErrorFromResponse(resp) } return false, err } @@ -148,8 +148,8 @@ func (q *Queue) SetMetadata(options *QueueServiceOptions) error { if err != nil { return err } - readAndCloseBody(resp.body) - return checkRespCode(resp.statusCode, []int{http.StatusNoContent}) + defer readAndCloseBody(resp.Body) + return checkRespCode(resp, []int{http.StatusNoContent}) } // GetMetadata operation retrieves user-defined metadata and queue @@ -175,13 +175,13 @@ func (q *Queue) GetMetadata(options *QueueServiceOptions) error { if err != nil { return err } - defer readAndCloseBody(resp.body) + defer readAndCloseBody(resp.Body) - if err := checkRespCode(resp.statusCode, []int{http.StatusOK}); err != nil { + if err := checkRespCode(resp, []int{http.StatusOK}); err != nil { return err } - aproxMessagesStr := resp.headers.Get(http.CanonicalHeaderKey(approximateMessagesCountHeader)) + aproxMessagesStr := resp.Header.Get(http.CanonicalHeaderKey(approximateMessagesCountHeader)) if aproxMessagesStr != "" { aproxMessages, err := strconv.ParseUint(aproxMessagesStr, 10, 64) if err != nil { @@ -190,7 +190,7 @@ func (q *Queue) GetMetadata(options *QueueServiceOptions) error { q.AproxMessageCount = aproxMessages } - q.Metadata = getMetadataFromHeaders(resp.headers) + q.Metadata = getMetadataFromHeaders(resp.Header) return nil } @@ -241,10 +241,10 @@ func (q *Queue) GetMessages(options *GetMessagesOptions) ([]Message, error) { if err != nil { return []Message{}, err } - defer readAndCloseBody(resp.body) + defer resp.Body.Close() var out messages - err = xmlUnmarshal(resp.body, &out) + err = xmlUnmarshal(resp.Body, &out) if err != nil { return []Message{}, err } @@ -284,10 +284,10 @@ func (q *Queue) PeekMessages(options *PeekMessagesOptions) ([]Message, error) { if err != nil { return []Message{}, err } - defer readAndCloseBody(resp.body) + defer resp.Body.Close() var out messages - err = xmlUnmarshal(resp.body, &out) + err = xmlUnmarshal(resp.Body, &out) if err != nil { return []Message{}, err } @@ -314,8 +314,8 @@ func (q *Queue) ClearMessages(options *QueueServiceOptions) error { if err != nil { return err } - readAndCloseBody(resp.body) - return checkRespCode(resp.statusCode, []int{http.StatusNoContent}) + defer readAndCloseBody(resp.Body) + return checkRespCode(resp, []int{http.StatusNoContent}) } // SetPermissions sets up queue permissions @@ -341,13 +341,8 @@ func (q *Queue) SetPermissions(permissions QueuePermissions, options *SetQueuePe if err != nil { return err } - defer readAndCloseBody(resp.body) - - if err := checkRespCode(resp.statusCode, []int{http.StatusNoContent}); err != nil { - return errors.New("Unable to set permissions") - } - - return nil + defer readAndCloseBody(resp.Body) + return checkRespCode(resp, []int{http.StatusNoContent}) } func generateQueueACLpayload(policies []QueueAccessPolicy) (io.Reader, int, error) { @@ -409,14 +404,14 @@ func (q *Queue) GetPermissions(options *GetQueuePermissionOptions) (*QueuePermis if err != nil { return nil, err } - defer resp.body.Close() + defer resp.Body.Close() var ap AccessPolicy - err = xmlUnmarshal(resp.body, &ap.SignedIdentifiersList) + err = xmlUnmarshal(resp.Body, &ap.SignedIdentifiersList) if err != nil { return nil, err } - return buildQueueAccessPolicy(ap, &resp.headers), nil + return buildQueueAccessPolicy(ap, &resp.Header), nil } func buildQueueAccessPolicy(ap AccessPolicy, headers *http.Header) *QueuePermissions { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/share.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/share.go index a14d9d324474..0ded501077bb 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/storage/share.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/share.go @@ -75,10 +75,10 @@ func (s *Share) CreateIfNotExists(options *FileRequestOptions) (bool, error) { params := prepareOptions(options) resp, err := s.fsc.createResourceNoClose(s.buildPath(), resourceShare, params, extraheaders) if resp != nil { - defer readAndCloseBody(resp.body) - if resp.statusCode == http.StatusCreated || resp.statusCode == http.StatusConflict { - if resp.statusCode == http.StatusCreated { - s.updateEtagAndLastModified(resp.headers) + defer readAndCloseBody(resp.Body) + if resp.StatusCode == http.StatusCreated || resp.StatusCode == http.StatusConflict { + if resp.StatusCode == http.StatusCreated { + s.updateEtagAndLastModified(resp.Header) return true, nil } return false, s.FetchAttributes(nil) @@ -103,9 +103,9 @@ func (s *Share) Delete(options *FileRequestOptions) error { func (s *Share) DeleteIfExists(options *FileRequestOptions) (bool, error) { resp, err := s.fsc.deleteResourceNoClose(s.buildPath(), resourceShare, options) if resp != nil { - defer readAndCloseBody(resp.body) - if resp.statusCode == http.StatusAccepted || resp.statusCode == http.StatusNotFound { - return resp.statusCode == http.StatusAccepted, nil + defer readAndCloseBody(resp.Body) + if resp.StatusCode == http.StatusAccepted || resp.StatusCode == http.StatusNotFound { + return resp.StatusCode == http.StatusAccepted, nil } } return false, err diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/storageservice.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/storageservice.go index c102619c9873..a68ad09303cf 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/storage/storageservice.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/storageservice.go @@ -77,14 +77,14 @@ func (c Client) getServiceProperties(service string, auth authentication) (*Serv if err != nil { return nil, err } - defer resp.body.Close() + defer resp.Body.Close() - if err := checkRespCode(resp.statusCode, []int{http.StatusOK}); err != nil { + if err := checkRespCode(resp, []int{http.StatusOK}); err != nil { return nil, err } var out ServiceProperties - err = xmlUnmarshal(resp.body, &out) + err = xmlUnmarshal(resp.Body, &out) if err != nil { return nil, err } @@ -126,6 +126,6 @@ func (c Client) setServiceProperties(props ServiceProperties, service string, au if err != nil { return err } - readAndCloseBody(resp.body) - return checkRespCode(resp.statusCode, []int{http.StatusAccepted}) + defer readAndCloseBody(resp.Body) + return checkRespCode(resp, []int{http.StatusAccepted}) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/table.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/table.go index 6c01d32ee13e..b96ca6e12867 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/storage/table.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/table.go @@ -97,13 +97,13 @@ func (t *Table) Get(timeout uint, ml MetadataLevel) error { if err != nil { return err } - defer readAndCloseBody(resp.body) + defer resp.Body.Close() - if err = checkRespCode(resp.statusCode, []int{http.StatusOK}); err != nil { + if err = checkRespCode(resp, []int{http.StatusOK}); err != nil { return err } - respBody, err := ioutil.ReadAll(resp.body) + respBody, err := ioutil.ReadAll(resp.Body) if err != nil { return err } @@ -143,20 +143,20 @@ func (t *Table) Create(timeout uint, ml MetadataLevel, options *TableOptions) er if err != nil { return err } - defer readAndCloseBody(resp.body) + defer resp.Body.Close() if ml == EmptyPayload { - if err := checkRespCode(resp.statusCode, []int{http.StatusNoContent}); err != nil { + if err := checkRespCode(resp, []int{http.StatusNoContent}); err != nil { return err } } else { - if err := checkRespCode(resp.statusCode, []int{http.StatusCreated}); err != nil { + if err := checkRespCode(resp, []int{http.StatusCreated}); err != nil { return err } } if ml != EmptyPayload { - data, err := ioutil.ReadAll(resp.body) + data, err := ioutil.ReadAll(resp.Body) if err != nil { return err } @@ -186,9 +186,9 @@ func (t *Table) Delete(timeout uint, options *TableOptions) error { if err != nil { return err } - defer readAndCloseBody(resp.body) + defer readAndCloseBody(resp.Body) - return checkRespCode(resp.statusCode, []int{http.StatusNoContent}) + return checkRespCode(resp, []int{http.StatusNoContent}) } // QueryOptions includes options for a query entities operation. @@ -269,9 +269,9 @@ func (t *Table) SetPermissions(tap []TableAccessPolicy, timeout uint, options *T if err != nil { return err } - defer readAndCloseBody(resp.body) + defer readAndCloseBody(resp.Body) - return checkRespCode(resp.statusCode, []int{http.StatusNoContent}) + return checkRespCode(resp, []int{http.StatusNoContent}) } func generateTableACLPayload(policies []TableAccessPolicy) (io.Reader, int, error) { @@ -301,14 +301,14 @@ func (t *Table) GetPermissions(timeout int, options *TableOptions) ([]TableAcces if err != nil { return nil, err } - defer resp.body.Close() + defer resp.Body.Close() - if err = checkRespCode(resp.statusCode, []int{http.StatusOK}); err != nil { + if err = checkRespCode(resp, []int{http.StatusOK}); err != nil { return nil, err } var ap AccessPolicy - err = xmlUnmarshal(resp.body, &ap.SignedIdentifiersList) + err = xmlUnmarshal(resp.Body, &ap.SignedIdentifiersList) if err != nil { return nil, err } @@ -325,13 +325,13 @@ func (t *Table) queryEntities(uri string, headers map[string]string, ml Metadata if err != nil { return nil, err } - defer resp.body.Close() + defer resp.Body.Close() - if err = checkRespCode(resp.statusCode, []int{http.StatusOK}); err != nil { + if err = checkRespCode(resp, []int{http.StatusOK}); err != nil { return nil, err } - data, err := ioutil.ReadAll(resp.body) + data, err := ioutil.ReadAll(resp.Body) if err != nil { return nil, err } @@ -346,7 +346,7 @@ func (t *Table) queryEntities(uri string, headers map[string]string, ml Metadata } entities.table = t - contToken := extractContinuationTokenFromHeaders(resp.headers) + contToken := extractContinuationTokenFromHeaders(resp.Header) if contToken == nil { entities.NextLink = nil } else { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/table_batch.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/table_batch.go index d1d75a2eb1a5..6595fb70fc1c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/storage/table_batch.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/table_batch.go @@ -163,15 +163,15 @@ func (t *TableBatch) ExecuteBatch() error { if err != nil { return err } - defer resp.body.Close() + defer readAndCloseBody(resp.resp.Body) - if err = checkRespCode(resp.statusCode, []int{http.StatusAccepted}); err != nil { + if err = checkRespCode(resp.resp, []int{http.StatusAccepted}); err != nil { // check which batch failed. operationFailedMessage := t.getFailedOperation(resp.odata.Err.Message.Value) - requestID, date, version := getDebugHeaders(resp.headers) + requestID, date, version := getDebugHeaders(resp.resp.Header) return AzureStorageServiceError{ - StatusCode: resp.statusCode, + StatusCode: resp.resp.StatusCode, Code: resp.odata.Err.Code, RequestID: requestID, Date: date, diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/tableserviceclient.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/tableserviceclient.go index 456bee7733af..1f063a395200 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/storage/tableserviceclient.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/tableserviceclient.go @@ -145,13 +145,13 @@ func (t *TableServiceClient) queryTables(uri string, headers map[string]string, if err != nil { return nil, err } - defer resp.body.Close() + defer resp.Body.Close() - if err := checkRespCode(resp.statusCode, []int{http.StatusOK}); err != nil { + if err := checkRespCode(resp, []int{http.StatusOK}); err != nil { return nil, err } - respBody, err := ioutil.ReadAll(resp.body) + respBody, err := ioutil.ReadAll(resp.Body) if err != nil { return nil, err } @@ -166,7 +166,7 @@ func (t *TableServiceClient) queryTables(uri string, headers map[string]string, } out.tsc = t - nextLink := resp.headers.Get(http.CanonicalHeaderKey(headerXmsContinuation)) + nextLink := resp.Header.Get(http.CanonicalHeaderKey(headerXmsContinuation)) if nextLink == "" { out.NextLink = nil } else { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/util.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/util.go index 089a74a8cc67..e8a5dcf8caf1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/storage/util.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/storage/util.go @@ -209,6 +209,11 @@ func (t *TimeRFC1123) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error return nil } +// MarshalXML marshals using time.RFC1123. +func (t *TimeRFC1123) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + return e.EncodeElement(time.Time(*t).Format(time.RFC1123), start) +} + // returns a map of custom metadata values from the specified HTTP header func getMetadataFromHeaders(header http.Header) map[string]string { metadata := make(map[string]string) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/storage/version.go b/vendor/github.com/Azure/azure-sdk-for-go/storage/version.go deleted file mode 100644 index dc02dbcd18fb..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/storage/version.go +++ /dev/null @@ -1,19 +0,0 @@ -package storage - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -var ( - sdkVersion = "v12.5.0-beta" -) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/version/version.go b/vendor/github.com/Azure/azure-sdk-for-go/version/version.go index 477d6ab7e087..f317ffe3c1b2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/version/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/version/version.go @@ -18,4 +18,4 @@ package version // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Number contains the semantic version of this SDK. -const Number = "v14.1.1" +const Number = "v14.5.0" diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/token.go b/vendor/github.com/Azure/go-autorest/autorest/adal/token.go index 4eb0c1adf63a..d98504122b46 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/adal/token.go +++ b/vendor/github.com/Azure/go-autorest/autorest/adal/token.go @@ -27,6 +27,7 @@ import ( "net/url" "strconv" "strings" + "sync" "time" "github.com/Azure/go-autorest/autorest/date" @@ -242,13 +243,13 @@ func (secret *ServicePrincipalCertificateSecret) SetAuthenticationValues(spt *Se // ServicePrincipalToken encapsulates a Token created for a Service Principal. type ServicePrincipalToken struct { - Token - + token Token secret ServicePrincipalSecret oauthConfig OAuthConfig clientID string resource string autoRefresh bool + refreshLock *sync.RWMutex refreshWithin time.Duration sender Sender @@ -282,6 +283,7 @@ func NewServicePrincipalTokenWithSecret(oauthConfig OAuthConfig, id string, reso clientID: id, resource: resource, autoRefresh: true, + refreshLock: &sync.RWMutex{}, refreshWithin: defaultRefresh, sender: &http.Client{}, refreshCallbacks: callbacks, @@ -313,7 +315,7 @@ func NewServicePrincipalTokenFromManualToken(oauthConfig OAuthConfig, clientID s return nil, err } - spt.Token = token + spt.token = token return spt, nil } @@ -499,6 +501,7 @@ func newServicePrincipalTokenFromMSI(msiEndpoint, resource string, userAssignedI secret: &ServicePrincipalMSISecret{}, resource: resource, autoRefresh: true, + refreshLock: &sync.RWMutex{}, refreshWithin: defaultRefresh, sender: &http.Client{}, refreshCallbacks: callbacks, @@ -532,10 +535,15 @@ func newTokenRefreshError(message string, resp *http.Response) TokenRefreshError } // EnsureFresh will refresh the token if it will expire within the refresh window (as set by -// RefreshWithin) and autoRefresh flag is on. +// RefreshWithin) and autoRefresh flag is on. This method is safe for concurrent use. func (spt *ServicePrincipalToken) EnsureFresh() error { - if spt.autoRefresh && spt.WillExpireIn(spt.refreshWithin) { - return spt.Refresh() + if spt.autoRefresh && spt.token.WillExpireIn(spt.refreshWithin) { + // take the write lock then check to see if the token was already refreshed + spt.refreshLock.Lock() + defer spt.refreshLock.Unlock() + if spt.token.WillExpireIn(spt.refreshWithin) { + return spt.refreshInternal(spt.resource) + } } return nil } @@ -544,7 +552,7 @@ func (spt *ServicePrincipalToken) EnsureFresh() error { func (spt *ServicePrincipalToken) InvokeRefreshCallbacks(token Token) error { if spt.refreshCallbacks != nil { for _, callback := range spt.refreshCallbacks { - err := callback(spt.Token) + err := callback(spt.token) if err != nil { return fmt.Errorf("adal: TokenRefreshCallback handler failed. Error = '%v'", err) } @@ -554,12 +562,18 @@ func (spt *ServicePrincipalToken) InvokeRefreshCallbacks(token Token) error { } // Refresh obtains a fresh token for the Service Principal. +// This method is not safe for concurrent use and should be syncrhonized. func (spt *ServicePrincipalToken) Refresh() error { + spt.refreshLock.Lock() + defer spt.refreshLock.Unlock() return spt.refreshInternal(spt.resource) } // RefreshExchange refreshes the token, but for a different resource. +// This method is not safe for concurrent use and should be syncrhonized. func (spt *ServicePrincipalToken) RefreshExchange(resource string) error { + spt.refreshLock.Lock() + defer spt.refreshLock.Unlock() return spt.refreshInternal(resource) } @@ -579,9 +593,9 @@ func (spt *ServicePrincipalToken) refreshInternal(resource string) error { v.Set("client_id", spt.clientID) v.Set("resource", resource) - if spt.RefreshToken != "" { + if spt.token.RefreshToken != "" { v.Set("grant_type", OAuthGrantTypeRefreshToken) - v.Set("refresh_token", spt.RefreshToken) + v.Set("refresh_token", spt.token.RefreshToken) } else { v.Set("grant_type", spt.getGrantType()) err := spt.secret.SetAuthenticationValues(spt, &v) @@ -629,7 +643,7 @@ func (spt *ServicePrincipalToken) refreshInternal(resource string) error { return fmt.Errorf("adal: Failed to unmarshal the service principal token during refresh. Error = '%v' JSON = '%s'", err, string(rb)) } - spt.Token = token + spt.token = token return spt.InvokeRefreshCallbacks(token) } @@ -649,3 +663,17 @@ func (spt *ServicePrincipalToken) SetRefreshWithin(d time.Duration) { // SetSender sets the http.Client used when obtaining the Service Principal token. An // undecorated http.Client is used by default. func (spt *ServicePrincipalToken) SetSender(s Sender) { spt.sender = s } + +// OAuthToken implements the OAuthTokenProvider interface. It returns the current access token. +func (spt *ServicePrincipalToken) OAuthToken() string { + spt.refreshLock.RLock() + defer spt.refreshLock.RUnlock() + return spt.token.OAuthToken() +} + +// Token returns a copy of the current token. +func (spt *ServicePrincipalToken) Token() Token { + spt.refreshLock.RLock() + defer spt.refreshLock.RUnlock() + return spt.token +} diff --git a/vendor/github.com/Azure/go-autorest/autorest/authorization.go b/vendor/github.com/Azure/go-autorest/autorest/authorization.go index 214b0e6f26c7..4a602f6760af 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/authorization.go +++ b/vendor/github.com/Azure/go-autorest/autorest/authorization.go @@ -233,3 +233,22 @@ func newBearerChallenge(resp *http.Response) (bc bearerChallenge, err error) { return bc, err } + +// EventGridKeyAuthorizer implements authorization for event grid using key authentication. +type EventGridKeyAuthorizer struct { + topicKey string +} + +// NewEventGridKeyAuthorizer creates a new EventGridKeyAuthorizer +// with the specified topic key. +func NewEventGridKeyAuthorizer(topicKey string) EventGridKeyAuthorizer { + return EventGridKeyAuthorizer{topicKey: topicKey} +} + +// WithAuthorization returns a PrepareDecorator that adds the aeg-sas-key authentication header. +func (egta EventGridKeyAuthorizer) WithAuthorization() PrepareDecorator { + headers := map[string]interface{}{ + "aeg-sas-key": egta.topicKey, + } + return NewAPIKeyAuthorizerWithHeaders(headers).WithAuthorization() +} diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/async.go b/vendor/github.com/Azure/go-autorest/autorest/azure/async.go index f90699f6cc38..a18b61041654 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/async.go +++ b/vendor/github.com/Azure/go-autorest/autorest/azure/async.go @@ -39,7 +39,7 @@ const ( operationSucceeded string = "Succeeded" ) -var pollingCodes = [...]int{http.StatusAccepted, http.StatusCreated, http.StatusOK} +var pollingCodes = [...]int{http.StatusNoContent, http.StatusAccepted, http.StatusCreated, http.StatusOK} // Future provides a mechanism to access the status and results of an asynchronous request. // Since futures are stateful they should be passed by value to avoid race conditions. @@ -78,13 +78,39 @@ func (f *Future) Done(sender autorest.Sender) (bool, error) { if f.ps.hasTerminated() { return true, f.errorInfo() } - resp, err := sender.Do(f.req) f.resp = resp - if err != nil || !autorest.ResponseHasStatusCode(resp, pollingCodes[:]...) { + if err != nil { return false, err } + if !autorest.ResponseHasStatusCode(resp, pollingCodes[:]...) { + // check response body for error content + if resp.Body != nil { + type respErr struct { + ServiceError ServiceError `json:"error"` + } + re := respErr{} + + defer resp.Body.Close() + b, err := ioutil.ReadAll(resp.Body) + if err != nil { + return false, err + } + err = json.Unmarshal(b, &re) + if err != nil { + return false, err + } + return false, re.ServiceError + } + + // try to return something meaningful + return false, ServiceError{ + Code: fmt.Sprintf("%v", resp.StatusCode), + Message: resp.Status, + } + } + err = updatePollingState(resp, &f.ps) if err != nil { return false, err @@ -185,6 +211,12 @@ func (f *Future) UnmarshalJSON(data []byte) error { return err } +// PollingURL returns the URL used for retrieving the status of the long-running operation. +// For LROs that use the Location header the final URL value is used to retrieve the result. +func (f Future) PollingURL() string { + return f.ps.URI +} + // DoPollForAsynchronous returns a SendDecorator that polls if the http.Response is for an Azure // long-running operation. It will delay between requests for the duration specified in the // RetryAfter header or, if the header is absent, the passed delay. Polling may be canceled by @@ -300,7 +332,9 @@ func (ps provisioningStatus) hasTerminated() bool { } func (ps provisioningStatus) hasProvisioningError() bool { - return ps.ProvisioningError != ServiceError{} + // code and message are required fields so only check them + return len(ps.ProvisioningError.Code) > 0 || + len(ps.ProvisioningError.Message) > 0 } // PollingMethodType defines a type used for enumerating polling mechanisms. @@ -321,8 +355,7 @@ type pollingState struct { PollingMethod PollingMethodType `json:"pollingMethod"` URI string `json:"uri"` State string `json:"state"` - Code string `json:"code"` - Message string `json:"message"` + ServiceError *ServiceError `json:"error,omitempty"` } func (ps pollingState) hasSucceeded() bool { @@ -338,7 +371,11 @@ func (ps pollingState) hasFailed() bool { } func (ps pollingState) Error() string { - return fmt.Sprintf("Long running operation terminated with status '%s': Code=%q Message=%q", ps.State, ps.Code, ps.Message) + s := fmt.Sprintf("Long running operation terminated with status '%s'", ps.State) + if ps.ServiceError != nil { + s = fmt.Sprintf("%s: %+v", s, *ps.ServiceError) + } + return s } // updatePollingState maps the operation status -- retrieved from either a provisioningState @@ -430,18 +467,14 @@ func updatePollingState(resp *http.Response, ps *pollingState) error { // -- Response // -- Otherwise, Unknown if ps.hasFailed() { - if ps.PollingMethod == PollingAsyncOperation { - or := pt.(*operationResource) - ps.Code = or.OperationError.Code - ps.Message = or.OperationError.Message + if or, ok := pt.(*operationResource); ok { + ps.ServiceError = &or.OperationError + } else if p, ok := pt.(*provisioningStatus); ok && p.hasProvisioningError() { + ps.ServiceError = &p.ProvisioningError } else { - p := pt.(*provisioningStatus) - if p.hasProvisioningError() { - ps.Code = p.ProvisioningError.Code - ps.Message = p.ProvisioningError.Message - } else { - ps.Code = "Unknown" - ps.Message = "None" + ps.ServiceError = &ServiceError{ + Code: "Unknown", + Message: "None", } } } @@ -458,3 +491,21 @@ func newPollingRequest(ps pollingState) (*http.Request, error) { return reqPoll, nil } + +// AsyncOpIncompleteError is the type that's returned from a future that has not completed. +type AsyncOpIncompleteError struct { + // FutureType is the name of the type composed of a azure.Future. + FutureType string +} + +// Error returns an error message including the originating type name of the error. +func (e AsyncOpIncompleteError) Error() string { + return fmt.Sprintf("%s: asynchronous operation has not completed", e.FutureType) +} + +// NewAsyncOpIncompleteError creates a new AsyncOpIncompleteError with the specified parameters. +func NewAsyncOpIncompleteError(futureType string) AsyncOpIncompleteError { + return AsyncOpIncompleteError{ + FutureType: futureType, + } +} diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go b/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go index fa18356476b9..2383b2d74428 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go +++ b/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go @@ -1,8 +1,5 @@ -/* -Package azure provides Azure-specific implementations used with AutoRest. - -See the included examples for more detail. -*/ +// Package azure provides Azure-specific implementations used with AutoRest. +// See the included examples for more detail. package azure // Copyright 2017 Microsoft Corporation @@ -43,21 +40,88 @@ const ( ) // ServiceError encapsulates the error response from an Azure service. +// It adhears to the OData v4 specification for error responses. type ServiceError struct { - Code string `json:"code"` - Message string `json:"message"` - Details *[]interface{} `json:"details"` + Code string `json:"code"` + Message string `json:"message"` + Target *string `json:"target"` + Details []map[string]interface{} `json:"details"` + InnerError map[string]interface{} `json:"innererror"` } func (se ServiceError) Error() string { + result := fmt.Sprintf("Code=%q Message=%q", se.Code, se.Message) + + if se.Target != nil { + result += fmt.Sprintf(" Target=%q", *se.Target) + } + if se.Details != nil { - d, err := json.Marshal(*(se.Details)) + d, err := json.Marshal(se.Details) if err != nil { - return fmt.Sprintf("Code=%q Message=%q Details=%v", se.Code, se.Message, *se.Details) + result += fmt.Sprintf(" Details=%v", se.Details) } - return fmt.Sprintf("Code=%q Message=%q Details=%v", se.Code, se.Message, string(d)) + result += fmt.Sprintf(" Details=%v", string(d)) } - return fmt.Sprintf("Code=%q Message=%q", se.Code, se.Message) + + if se.InnerError != nil { + d, err := json.Marshal(se.InnerError) + if err != nil { + result += fmt.Sprintf(" InnerError=%v", se.InnerError) + } + result += fmt.Sprintf(" InnerError=%v", string(d)) + } + + return result +} + +// UnmarshalJSON implements the json.Unmarshaler interface for the ServiceError type. +func (se *ServiceError) UnmarshalJSON(b []byte) error { + // per the OData v4 spec the details field must be an array of JSON objects. + // unfortunately not all services adhear to the spec and just return a single + // object instead of an array with one object. so we have to perform some + // shenanigans to accommodate both cases. + // http://docs.oasis-open.org/odata/odata-json-format/v4.0/os/odata-json-format-v4.0-os.html#_Toc372793091 + + type serviceError1 struct { + Code string `json:"code"` + Message string `json:"message"` + Target *string `json:"target"` + Details []map[string]interface{} `json:"details"` + InnerError map[string]interface{} `json:"innererror"` + } + + type serviceError2 struct { + Code string `json:"code"` + Message string `json:"message"` + Target *string `json:"target"` + Details map[string]interface{} `json:"details"` + InnerError map[string]interface{} `json:"innererror"` + } + + se1 := serviceError1{} + err := json.Unmarshal(b, &se1) + if err == nil { + se.populate(se1.Code, se1.Message, se1.Target, se1.Details, se1.InnerError) + return nil + } + + se2 := serviceError2{} + err = json.Unmarshal(b, &se2) + if err == nil { + se.populate(se2.Code, se2.Message, se2.Target, nil, se2.InnerError) + se.Details = append(se.Details, se2.Details) + return nil + } + return err +} + +func (se *ServiceError) populate(code, message string, target *string, details []map[string]interface{}, inner map[string]interface{}) { + se.Code = code + se.Message = message + se.Target = target + se.Details = details + se.InnerError = inner } // RequestError describes an error response returned by Azure service. diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/environments.go b/vendor/github.com/Azure/go-autorest/autorest/azure/environments.go index efdab6a110cf..0916b14f34ae 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/environments.go +++ b/vendor/github.com/Azure/go-autorest/autorest/azure/environments.go @@ -44,6 +44,7 @@ type Environment struct { GalleryEndpoint string `json:"galleryEndpoint"` KeyVaultEndpoint string `json:"keyVaultEndpoint"` GraphEndpoint string `json:"graphEndpoint"` + ServiceBusEndpoint string `json:"serviceBusEndpoint"` StorageEndpointSuffix string `json:"storageEndpointSuffix"` SQLDatabaseDNSSuffix string `json:"sqlDatabaseDNSSuffix"` TrafficManagerDNSSuffix string `json:"trafficManagerDNSSuffix"` @@ -66,11 +67,12 @@ var ( GalleryEndpoint: "https://gallery.azure.com/", KeyVaultEndpoint: "https://vault.azure.net/", GraphEndpoint: "https://graph.windows.net/", + ServiceBusEndpoint: "https://servicebus.windows.net/", StorageEndpointSuffix: "core.windows.net", SQLDatabaseDNSSuffix: "database.windows.net", TrafficManagerDNSSuffix: "trafficmanager.net", KeyVaultDNSSuffix: "vault.azure.net", - ServiceBusEndpointSuffix: "servicebus.azure.com", + ServiceBusEndpointSuffix: "servicebus.windows.net", ServiceManagementVMDNSSuffix: "cloudapp.net", ResourceManagerVMDNSSuffix: "cloudapp.azure.com", ContainerRegistryDNSSuffix: "azurecr.io", @@ -83,10 +85,11 @@ var ( PublishSettingsURL: "https://manage.windowsazure.us/publishsettings/index", ServiceManagementEndpoint: "https://management.core.usgovcloudapi.net/", ResourceManagerEndpoint: "https://management.usgovcloudapi.net/", - ActiveDirectoryEndpoint: "https://login.microsoftonline.com/", + ActiveDirectoryEndpoint: "https://login.microsoftonline.us/", GalleryEndpoint: "https://gallery.usgovcloudapi.net/", KeyVaultEndpoint: "https://vault.usgovcloudapi.net/", - GraphEndpoint: "https://graph.usgovcloudapi.net/", + GraphEndpoint: "https://graph.windows.net/", + ServiceBusEndpoint: "https://servicebus.usgovcloudapi.net/", StorageEndpointSuffix: "core.usgovcloudapi.net", SQLDatabaseDNSSuffix: "database.usgovcloudapi.net", TrafficManagerDNSSuffix: "usgovtrafficmanager.net", @@ -108,11 +111,12 @@ var ( GalleryEndpoint: "https://gallery.chinacloudapi.cn/", KeyVaultEndpoint: "https://vault.azure.cn/", GraphEndpoint: "https://graph.chinacloudapi.cn/", + ServiceBusEndpoint: "https://servicebus.chinacloudapi.cn/", StorageEndpointSuffix: "core.chinacloudapi.cn", SQLDatabaseDNSSuffix: "database.chinacloudapi.cn", TrafficManagerDNSSuffix: "trafficmanager.cn", KeyVaultDNSSuffix: "vault.azure.cn", - ServiceBusEndpointSuffix: "servicebus.chinacloudapi.net", + ServiceBusEndpointSuffix: "servicebus.chinacloudapi.cn", ServiceManagementVMDNSSuffix: "chinacloudapp.cn", ResourceManagerVMDNSSuffix: "cloudapp.azure.cn", ContainerRegistryDNSSuffix: "azurecr.io", @@ -129,6 +133,7 @@ var ( GalleryEndpoint: "https://gallery.cloudapi.de/", KeyVaultEndpoint: "https://vault.microsoftazure.de/", GraphEndpoint: "https://graph.cloudapi.de/", + ServiceBusEndpoint: "https://servicebus.cloudapi.de/", StorageEndpointSuffix: "core.cloudapi.de", SQLDatabaseDNSSuffix: "database.cloudapi.de", TrafficManagerDNSSuffix: "azuretrafficmanager.de", diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/rp.go b/vendor/github.com/Azure/go-autorest/autorest/azure/rp.go index b6b95d6fdbcb..2c88d60ba6c6 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/rp.go +++ b/vendor/github.com/Azure/go-autorest/autorest/azure/rp.go @@ -70,11 +70,8 @@ func DoRetryWithRegistration(client autorest.Client) autorest.SendDecorator { } func getProvider(re RequestError) (string, error) { - if re.ServiceError != nil { - if re.ServiceError.Details != nil && len(*re.ServiceError.Details) > 0 { - detail := (*re.ServiceError.Details)[0].(map[string]interface{}) - return detail["target"].(string), nil - } + if re.ServiceError != nil && len(re.ServiceError.Details) > 0 { + return re.ServiceError.Details[0]["target"].(string), nil } return "", errors.New("provider was not found in the response") } diff --git a/vendor/github.com/Azure/go-autorest/autorest/validation/error.go b/vendor/github.com/Azure/go-autorest/autorest/validation/error.go new file mode 100644 index 000000000000..fed156dbf6e6 --- /dev/null +++ b/vendor/github.com/Azure/go-autorest/autorest/validation/error.go @@ -0,0 +1,48 @@ +package validation + +// Copyright 2017 Microsoft Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import ( + "fmt" +) + +// Error is the type that's returned when the validation of an APIs arguments constraints fails. +type Error struct { + // PackageType is the package type of the object emitting the error. For types, the value + // matches that produced the the '%T' format specifier of the fmt package. For other elements, + // such as functions, it is just the package name (e.g., "autorest"). + PackageType string + + // Method is the name of the method raising the error. + Method string + + // Message is the error message. + Message string +} + +// Error returns a string containing the details of the validation failure. +func (e Error) Error() string { + return fmt.Sprintf("%s#%s: Invalid input: %s", e.PackageType, e.Method, e.Message) +} + +// NewError creates a new Error object with the specified parameters. +// message is treated as a format string to which the optional args apply. +func NewError(packageType string, method string, message string, args ...interface{}) Error { + return Error{ + PackageType: packageType, + Method: method, + Message: fmt.Sprintf(message, args...), + } +} diff --git a/vendor/github.com/Azure/go-autorest/autorest/validation/validation.go b/vendor/github.com/Azure/go-autorest/autorest/validation/validation.go index 3fe62c93056d..d886e0b3fbfc 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/validation/validation.go +++ b/vendor/github.com/Azure/go-autorest/autorest/validation/validation.go @@ -390,6 +390,8 @@ func createError(x reflect.Value, v Constraint, err string) error { // NewErrorWithValidationError appends package type and method name in // validation error. +// +// Deprecated: Please use validation.NewError() instead. func NewErrorWithValidationError(err error, packageType, method string) error { - return fmt.Errorf("%s#%s: Invalid input: %v", packageType, method, err) + return NewError(packageType, method, err.Error()) } diff --git a/vendor/github.com/Azure/go-autorest/autorest/version.go b/vendor/github.com/Azure/go-autorest/autorest/version.go index f588807dbb9c..a19c0d35a2d4 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/version.go +++ b/vendor/github.com/Azure/go-autorest/autorest/version.go @@ -22,9 +22,9 @@ import ( ) const ( - major = 8 - minor = 0 - patch = 0 + major = 9 + minor = 8 + patch = 1 tag = "" ) diff --git a/vendor/vendor.json b/vendor/vendor.json index 1c6ffb9e8bcd..2b1cb761d493 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -3,345 +3,340 @@ "ignore": "test", "package": [ { - "checksumSHA1": "04RpBRvxCFIrlZr4QGlWxEYu5jk=", + "checksumSHA1": "MYhFFBypnLTBilLP9fOJg+CwJd0=", "path": "github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "lNNgGpjE0bFWk01GbinWzzrvYMg=", + "checksumSHA1": "YTtfx0vYAsxSTvZfISPuEbukOG8=", "path": "github.com/Azure/azure-sdk-for-go/services/authorization/mgmt/2015-07-01/authorization", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "0SGJv3vkB3mDzm2fEqyRhGBL+b0=", + "checksumSHA1": "3uo6R9VzBxtX/UrgYMavskwhYgk=", "path": "github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "r5ng4N9t9KBcTLlcoJBus/Wt8G0=", + "checksumSHA1": "V3P5MwxLep5CDVpClDmW+vo3B5U=", "path": "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2017-04-02/cdn", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "OaJWyTycs9HCUx4mXO/8+cPn6Dc=", + "checksumSHA1": "fD2ekdjE6xa2tUhFWppmf2r83eE=", "path": "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "mCnH22sssytnBgmMtiOiZ1fiUAE=", + "checksumSHA1": "tvhcKJB64+DHtZcVWW7aIspTFas=", "path": "github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-02-01-preview/containerinstance", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "WYjcCFUAHbnfCAYS7EO83a6FwSA=", + "checksumSHA1": "muo3Hc2/MdCa27j83JDlmXKJoy0=", "path": "github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2017-10-01/containerregistry", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "2+Uo711eqenN0yATZUvyVur3BDo=", + "checksumSHA1": "vstGIRQyM+OoCh6dGJGBydOBnkI=", "path": "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2017-09-30/containerservice", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "E7FkdI3WlMLqnMoinimQQKH2yLA=", + "checksumSHA1": "lNqFCvNXug07p/1HrvRgeah6u/Q=", "path": "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "uJCBS9ImFK2B54NzUEPMKdePuGI=", - "path": "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" - }, - { - "checksumSHA1": "QiY007vq22jp7uk7bDxEq1/YsYI=", + "checksumSHA1": "Sary+wu3lyfbmGXKcdAzIwCqozA=", "path": "github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2017-09-15-preview/eventgrid", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "C3vT4FIPyBCkJ/DRPJGvA2kEV2A=", + "checksumSHA1": "/uCXZ3Jw+TPqejW5Awp/RyQ4PUA=", "path": "github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "Yy2uufjDcDOtCci5MoDEmmTsdfE=", + "checksumSHA1": "MMvMBIK3DhUZjE1xz9IiTH6uj98=", "path": "github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "7mrCMBhJ0IdK1u7tBX3LDxmohxc=", + "checksumSHA1": "l4BaDOG5showWuLiGBjsY4eVhtk=", "path": "github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2017-07-01/devices", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "Qyvr+VKOVBA9x/PYyaLBNaPD6CA=", + "checksumSHA1": "lnL7lwCjHMBgWTn/EbsNBaRASeE=", "path": "github.com/Azure/azure-sdk-for-go/services/keyvault/2016-10-01/keyvault", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "wyP62ZVT4AV4hO/NBDh/uvVa6Zg=", + "checksumSHA1": "e76xeGW1GSFbs525XCUu+5+Lzeo=", "path": "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2016-10-01/keyvault", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "vGZFW297gcvEB3n5mkX60zDWPaY=", + "checksumSHA1": "/Yl3qThgc9R6CqvUq3CS4UkoIY4=", "path": "github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "/bK6KPyxXraJOySSQUNP2Iezgrc=", + "checksumSHA1": "e2X2Jmt5BoJDbzhGinne9BhxFXs=", "path": "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "UCsGrHob/smdv6NU0fCUrSJpQqE=", + "checksumSHA1": "m7wz3sjPBmQCoyxaL+HXE0i/HEk=", "path": "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "CeXlAup0Yf2Tw4UO7aDZDLI/wPI=", + "checksumSHA1": "xlZLptp4hA1ADE6nB6abID/31qc=", "path": "github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "WMfs+FCE3stapwrAvAS3fjFZlHk=", + "checksumSHA1": "8xQejGxFZvbHn6UxXFAPt6b2BV4=", "path": "github.com/Azure/azure-sdk-for-go/services/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-16T17:41:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "qOcKrxfayIRgAKlAZu9XYTSfeA0=", + "checksumSHA1": "lb8SaWqAZHt4YmIM442GNo9x2po=", "path": "github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" + }, + { + "checksumSHA1": "GBxGGQiPjgIFL3Nh80fxk3ol2MQ=", + "path": "github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns", + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "09i0LjiY4GkYSRNObda25c1hsos=", + "checksumSHA1": "o07ZFEu1kYQyqs2P7WZO3APv/LE=", "path": "github.com/Azure/azure-sdk-for-go/services/redis/mgmt/2016-04-01/redis", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "7f5Uqi6joNQQGO0D1fuLOH1vqwc=", + "checksumSHA1": "KTVMKvYwHKXTG33L4BaXnNudkGw=", "path": "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-06-01/subscriptions", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "rnRxkR6w0aXOM0V9y3HTNz0+raQ=", + "checksumSHA1": "8M8jlDhclmKOPjASulgUgVxKwC8=", "path": "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-09-01/locks", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "oNSB5LmmOu68djMmeORcCDYn/3o=", + "checksumSHA1": "VB76pkprLH4eW5s937tVqTnsIcA=", "path": "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "TO9sw/AzJ/PhTE5gO+3HYJfl7Lo=", + "checksumSHA1": "2Pq5xLSlhMK3wFJYC09w2+lS5UY=", "path": "github.com/Azure/azure-sdk-for-go/services/scheduler/mgmt/2016-03-01/scheduler", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "FAgW0CqXXC9K8ScnAcoTb5nLBF0=", + "checksumSHA1": "awcqb21xoxHP4GCkwhKwDzpTKdA=", "path": "github.com/Azure/azure-sdk-for-go/services/search/mgmt/2015-08-19/search", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "dHGgohlhfFkUPVcSkWFJnhwnkV8=", + "checksumSHA1": "A7lLaQxjoLuUHGS8MXkUtmTD7Ec=", "path": "github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "oZDb0i9D6dludQmrSGDFF3UeZHc=", + "checksumSHA1": "NeumViYG7RGexk9SDM59P80wZM8=", "path": "github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2015-05-01-preview/sql", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "UEgAKa3mlclVQ+TopgpxIkN/T9Y=", + "checksumSHA1": "zd2iEobBYC8YrvOtEPTQu0fK80k=", "path": "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "LApakbrvkkhEu3hJVuLkERdGrSk=", + "checksumSHA1": "DP6f7105iot83H3w36ArY5APqlI=", "path": "github.com/Azure/azure-sdk-for-go/services/trafficmanager/mgmt/2017-05-01/trafficmanager", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "X56B9OyWsdOtpvblfATNgPB/xzI=", + "checksumSHA1": "Hc/Xnlkz+OYfJsTHH/BmhGY+uLY=", "path": "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "ySVXlzloGIus0rS4fpdN3hSOgz8=", + "checksumSHA1": "MylX4FA7dsRk43nOWARnrgMOqnM=", "path": "github.com/Azure/azure-sdk-for-go/storage", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "0f2bCAIQjO9op810x5LnuZnAmM0=", + "checksumSHA1": "2sw6AX1QLYDPQIX6jSxMgxubuQ0=", "path": "github.com/Azure/azure-sdk-for-go/version", - "revision": "1e334c402ea1460704b0263e5d188f28ad946ce1", - "revisionTime": "2018-02-16T17:41:56Z" + "revision": "e67cd39e942c417ae5e9ae1165f778d9fe8996e0", + "revisionTime": "2018-03-16T20:43:19Z", + "version": "=v14.5.0", + "versionExact": "v14.5.0" }, { - "checksumSHA1": "RzIYmvG1ReOud+kafFsZTDIZSK0=", - "comment": "v9.7.0", + "checksumSHA1": "sM9XTbrCfgS5BPxpFLeM5YwOZWg=", "path": "github.com/Azure/go-autorest/autorest", - "revision": "8c58b4788dedd95779efe0ac2055bb6a1b9b8e01", - "revisionTime": "2018-01-06T16:29:27Z", - "version": "v9.7.0", - "versionExact": "v9.7.0" + "revision": "5a06e9ddbe3c22262059b8e061777b9934f982bd", + "revisionTime": "2018-02-08T22:49:56Z", + "version": "=v10.1.0", + "versionExact": "v10.1.0" }, { - "checksumSHA1": "OxKbGGQUfsDtM4Fz4ysBpallhOE=", - "comment": "v9.7.0", + "checksumSHA1": "xmsYFX1qHpwvXbqnT9yg4UQ2MlA=", "path": "github.com/Azure/go-autorest/autorest/adal", - "revision": "8c58b4788dedd95779efe0ac2055bb6a1b9b8e01", - "revisionTime": "2018-01-06T16:29:27Z", - "version": "v9.7.0", - "versionExact": "v9.7.0" + "revision": "5a06e9ddbe3c22262059b8e061777b9934f982bd", + "revisionTime": "2018-02-08T22:49:56Z", + "version": "=v10.1.0", + "versionExact": "v10.1.0" }, { - "checksumSHA1": "PwTnRhiCu8p2D1M2nsM0ADL4FM0=", - "comment": "v9.7.0", + "checksumSHA1": "KFHzaLA4zo34W0FJ5ah/1WBbB9Q=", "path": "github.com/Azure/go-autorest/autorest/azure", - "revision": "8c58b4788dedd95779efe0ac2055bb6a1b9b8e01", - "revisionTime": "2018-01-06T16:29:27Z", - "version": "v9.7.0", - "versionExact": "v9.7.0" + "revision": "5a06e9ddbe3c22262059b8e061777b9934f982bd", + "revisionTime": "2018-02-08T22:49:56Z", + "version": "=v10.1.0", + "versionExact": "v10.1.0" }, { "checksumSHA1": "+nXRwVB/JVEGe+oLsFhCmSkKPuI=", - "comment": "v9.7.0", "path": "github.com/Azure/go-autorest/autorest/azure/cli", - "revision": "8c58b4788dedd95779efe0ac2055bb6a1b9b8e01", - "revisionTime": "2018-01-06T16:29:27Z", - "version": "v9.7.0", - "versionExact": "v9.7.0" + "revision": "5a06e9ddbe3c22262059b8e061777b9934f982bd", + "revisionTime": "2018-02-08T22:49:56Z", + "version": "=v10.1.0", + "versionExact": "v10.1.0" }, { "checksumSHA1": "9nXCi9qQsYjxCeajJKWttxgEt0I=", - "comment": "v9.7.0", "path": "github.com/Azure/go-autorest/autorest/date", - "revision": "8c58b4788dedd95779efe0ac2055bb6a1b9b8e01", - "revisionTime": "2018-01-06T16:29:27Z", - "version": "v9.7.0", - "versionExact": "v9.7.0" + "revision": "5a06e9ddbe3c22262059b8e061777b9934f982bd", + "revisionTime": "2018-02-08T22:49:56Z", + "version": "=v10.1.0", + "versionExact": "v10.1.0" }, { "checksumSHA1": "SbBb2GcJNm5GjuPKGL2777QywR4=", - "comment": "v9.7.0", "path": "github.com/Azure/go-autorest/autorest/to", - "revision": "8c58b4788dedd95779efe0ac2055bb6a1b9b8e01", - "revisionTime": "2018-01-06T16:29:27Z", - "version": "v9.7.0", - "versionExact": "v9.7.0" + "revision": "5a06e9ddbe3c22262059b8e061777b9934f982bd", + "revisionTime": "2018-02-08T22:49:56Z", + "version": "=v10.1.0", + "versionExact": "v10.1.0" }, { - "checksumSHA1": "HfqZyKllcHQDvTwgCaYL1jUPmW0=", - "comment": "v9.7.0", + "checksumSHA1": "5UH4IFIB/98iowPCzzVs4M4MXiQ=", "path": "github.com/Azure/go-autorest/autorest/validation", - "revision": "8c58b4788dedd95779efe0ac2055bb6a1b9b8e01", - "revisionTime": "2018-01-06T16:29:27Z", - "version": "v9.7.0", - "versionExact": "v9.7.0" + "revision": "5a06e9ddbe3c22262059b8e061777b9934f982bd", + "revisionTime": "2018-02-08T22:49:56Z", + "version": "=v10.1.0", + "versionExact": "v10.1.0" }, { "checksumSHA1": "jQh1fnoKPKMURvKkpdRjN695nAQ=",