From c8d0a5c34ea711bd64bb306a4a9e7d230e5ff063 Mon Sep 17 00:00:00 2001 From: tombuildsstuff Date: Thu, 5 Apr 2018 12:12:08 +0200 Subject: [PATCH 1/7] Vendoring v15.0.0 of the Azure SDK for Go --- .../mgmt/2015-05-01/insights/annotations.go | 318 + .../mgmt/2015-05-01/insights/apikeys.go | 28 +- .../insights/componentavailablefeatures.go | 107 + .../componentcurrentbillingfeatures.go | 16 +- .../insights/componentfeaturecapabilities.go | 108 + .../insights/componentquotastatus.go | 6 +- .../mgmt/2015-05-01/insights/components.go | 182 +- .../insights/exportconfigurations.go | 43 +- .../mgmt/2015-05-01/insights/favorite.go | 318 + .../mgmt/2015-05-01/insights/favorites.go | 125 + .../mgmt/2015-05-01/insights/models.go | 767 +- .../mgmt/2015-05-01/insights/operations.go | 2 +- .../proactivedetectionconfigurations.go | 249 + .../mgmt/2015-05-01/insights/version.go | 6 +- .../2015-05-01/insights/webtestlocations.go | 107 + .../mgmt/2015-05-01/insights/webtests.go | 22 +- .../insights/workitemconfigurations.go | 313 + .../mgmt/2015-07-01/authorization/models.go | 2 +- .../provideroperationsmetadata.go | 4 + .../authorization/roleassignments.go | 43 +- .../authorization/roledefinitions.go | 12 +- .../mgmt/2015-07-01/authorization/version.go | 6 +- .../mgmt/2015-10-31/automation/account.go | 26 +- .../mgmt/2015-10-31/automation/activity.go | 47 +- .../agentregistrationinformation.go | 44 +- .../mgmt/2015-10-31/automation/certificate.go | 104 +- .../mgmt/2015-10-31/automation/client.go | 18 +- .../mgmt/2015-10-31/automation/connection.go | 104 +- .../2015-10-31/automation/connectiontype.go | 84 +- .../mgmt/2015-10-31/automation/credential.go | 104 +- .../automation/dsccompilationjob.go | 84 +- .../automation/dsccompilationjobstream.go | 116 + .../2015-10-31/automation/dscconfiguration.go | 186 +- .../mgmt/2015-10-31/automation/dscnode.go | 83 +- .../automation/dscnodeconfiguration.go | 86 +- .../mgmt/2015-10-31/automation/fields.go | 26 +- .../automation/hybridrunbookworkergroup.go | 85 +- .../mgmt/2015-10-31/automation/job.go | 151 +- .../mgmt/2015-10-31/automation/jobschedule.go | 83 +- .../mgmt/2015-10-31/automation/jobstream.go | 47 +- .../mgmt/2015-10-31/automation/keys.go | 113 + .../2015-10-31/automation/linkedworkspace.go | 113 + .../mgmt/2015-10-31/automation/models.go | 4141 +++-- .../mgmt/2015-10-31/automation/module.go | 102 +- .../mgmt/2015-10-31/automation/nodereports.go | 71 +- .../2015-10-31/automation/objectdatatypes.go | 43 +- .../mgmt/2015-10-31/automation/operations.go | 8 +- .../mgmt/2015-10-31/automation/runbook.go | 136 +- .../2015-10-31/automation/runbookdraft.go | 244 +- .../mgmt/2015-10-31/automation/schedule.go | 102 +- .../mgmt/2015-10-31/automation/statistics.go | 14 +- .../automation/{testjobs.go => testjob.go} | 157 +- .../2015-10-31/automation/testjobstreams.go | 50 +- .../mgmt/2015-10-31/automation/usages.go | 10 +- .../mgmt/2015-10-31/automation/variable.go | 102 +- .../mgmt/2015-10-31/automation/version.go | 6 +- .../mgmt/2015-10-31/automation/webhook.go | 119 +- .../cdn/mgmt/2017-04-02/cdn/client.go | 8 +- .../cdn/mgmt/2017-04-02/cdn/customdomains.go | 38 +- .../cdn/mgmt/2017-04-02/cdn/endpoints.go | 76 +- .../cdn/mgmt/2017-04-02/cdn/models.go | 1257 +- .../cdn/mgmt/2017-04-02/cdn/origins.go | 22 +- .../cdn/mgmt/2017-04-02/cdn/profiles.go | 24 +- .../cdn/mgmt/2017-04-02/cdn/version.go | 6 +- .../2017-12-01/compute/availabilitysets.go | 71 +- .../2017-12-01/compute/containerservices.go | 21 +- .../compute/mgmt/2017-12-01/compute/disks.go | 50 +- .../compute/mgmt/2017-12-01/compute/images.go | 79 +- .../mgmt/2017-12-01/compute/loganalytics.go | 16 +- .../compute/mgmt/2017-12-01/compute/models.go | 4253 ++++- .../mgmt/2017-12-01/compute/operations.go | 98 + .../mgmt/2017-12-01/compute/snapshots.go | 51 +- .../compute/mgmt/2017-12-01/compute/usage.go | 2 +- .../mgmt/2017-12-01/compute/version.go | 6 +- .../compute/virtualmachineextensions.go | 16 +- .../compute/virtualmachineimages.go | 12 +- .../compute/virtualmachineruncommands.go | 4 +- .../2017-12-01/compute/virtualmachines.go | 87 +- .../virtualmachinescalesetextensions.go | 12 +- .../compute/virtualmachinescalesets.go | 58 +- .../compute/virtualmachinescalesetvms.go | 40 +- .../2017-12-01/compute/virtualmachinesizes.go | 2 +- .../containerinstance/containergroups.go | 45 +- .../containerinstance/models.go | 345 +- .../containerinstance/startcontainer.go | 111 + .../containerinstance/version.go | 6 +- .../2017-10-01/containerregistry/models.go | 1042 +- .../containerregistry/registries.go | 24 +- .../containerregistry/replications.go | 22 +- .../2017-10-01/containerregistry/version.go | 6 +- .../2017-10-01/containerregistry/webhooks.go | 28 +- .../containerservice/containerservices.go | 33 +- .../containerservice/managedclusters.go | 4 +- .../2017-09-30/containerservice/models.go | 878 +- .../2017-09-30/containerservice/version.go | 6 +- .../mgmt/2015-04-08/documentdb/client.go | 16 +- .../mgmt/2015-04-08/documentdb/collection.go | 58 +- .../documentdb/collectionpartition.go | 210 + .../documentdb/collectionpartitionregion.go | 127 + .../2015-04-08/documentdb/collectionregion.go | 30 +- .../mgmt/2015-04-08/documentdb/database.go | 50 +- .../documentdb/databaseaccountregion.go | 25 +- .../2015-04-08/documentdb/databaseaccounts.go | 75 +- .../mgmt/2015-04-08/documentdb/models.go | 753 +- .../mgmt/2015-04-08/documentdb/operations.go | 8 +- .../documentdb/partitionkeyrangeid.go | 126 + .../documentdb/partitionkeyrangeidregion.go | 128 + .../mgmt/2015-04-08/documentdb/percentile.go | 123 + .../documentdb/percentilesourcetarget.go | 127 + .../2015-04-08/documentdb/percentiletarget.go | 125 + .../mgmt/2015-04-08/documentdb/version.go | 6 +- .../dns/mgmt/2016-04-01/dns/models.go | 386 +- .../dns/mgmt/2016-04-01/dns/recordsets.go | 44 +- .../dns/mgmt/2016-04-01/dns/version.go | 6 +- .../services/dns/mgmt/2016-04-01/dns/zones.go | 14 +- .../eventgrid/eventsubscriptions.go | 38 +- .../2017-09-15-preview/eventgrid/models.go | 930 +- .../2017-09-15-preview/eventgrid/topics.go | 34 +- .../2017-09-15-preview/eventgrid/version.go | 6 +- .../2017-04-01/eventhub/consumergroups.go | 28 +- .../eventhub/disasterrecoveryconfigs.go | 65 +- .../mgmt/2017-04-01/eventhub/eventhubs.go | 69 +- .../mgmt/2017-04-01/eventhub/messagingplan.go | 118 + .../mgmt/2017-04-01/eventhub/models.go | 1028 +- .../mgmt/2017-04-01/eventhub/namespaces.go | 73 +- .../mgmt/2017-04-01/eventhub/regions.go | 141 + .../mgmt/2017-04-01/eventhub/version.go | 6 +- .../graphrbac/1.6/graphrbac/applications.go | 22 +- .../graphrbac/1.6/graphrbac/groups.go | 23 +- .../graphrbac/1.6/graphrbac/models.go | 953 +- .../graphrbac/1.6/graphrbac/objects.go | 4 +- .../1.6/graphrbac/serviceprincipals.go | 12 +- .../services/graphrbac/1.6/graphrbac/users.go | 13 +- .../graphrbac/1.6/graphrbac/version.go | 6 +- .../mgmt/2017-07-01/devices/certificates.go | 43 +- .../mgmt/2017-07-01/devices/iothubresource.go | 88 +- .../iothub/mgmt/2017-07-01/devices/models.go | 280 +- .../iothub/mgmt/2017-07-01/devices/version.go | 6 +- .../keyvault/2016-10-01/keyvault/client.go | 485 +- .../keyvault/2016-10-01/keyvault/models.go | 824 +- .../keyvault/2016-10-01/keyvault/version.go | 6 +- .../mgmt/2016-10-01/keyvault/models.go | 497 +- .../mgmt/2016-10-01/keyvault/operations.go | 127 + .../mgmt/2016-10-01/keyvault/vaults.go | 353 +- .../mgmt/2016-10-01/keyvault/version.go | 6 +- .../insights/actiongroups.go | 85 +- .../insights/activitylogalerts.go | 6 +- .../insights/alertruleincidents.go | 4 +- .../2017-05-01-preview/insights/alertrules.go | 10 +- .../insights/autoscalesettings.go | 10 +- .../insights/diagnosticsettings.go | 6 +- .../insights/logprofiles.go | 6 +- .../2017-05-01-preview/insights/models.go | 2006 ++- .../2017-05-01-preview/insights/version.go | 6 +- .../mysql/checknameavailability.go | 7 +- .../mgmt/2017-04-30-preview/mysql/client.go | 2 +- .../mysql/configurations.go | 21 +- .../2017-04-30-preview/mysql/databases.go | 26 +- .../2017-04-30-preview/mysql/firewallrules.go | 29 +- .../mysql/locationbasedperformancetier.go | 4 +- .../mgmt/2017-04-30-preview/mysql/logfiles.go | 6 +- .../mgmt/2017-04-30-preview/mysql/models.go | 1316 +- .../2017-04-30-preview/mysql/operations.go | 2 +- .../mysql/performancetiers.go | 3 +- .../mgmt/2017-04-30-preview/mysql/servers.go | 28 +- .../mgmt/2017-04-30-preview/mysql/version.go | 6 +- .../mysql/virtualnetworkrules.go | 357 - .../2017-09-01/network/applicationgateways.go | 30 +- .../network/applicationsecuritygroups.go | 2 +- .../network/mgmt/2017-09-01/network/client.go | 4 +- .../network/defaultsecurityrules.go | 8 +- .../expressroutecircuitauthorizations.go | 6 +- .../network/expressroutecircuitpeerings.go | 2 +- .../network/expressroutecircuits.go | 4 +- .../2017-09-01/network/inboundnatrules.go | 4 +- .../mgmt/2017-09-01/network/interfaces.go | 31 +- .../2017-09-01/network/loadbalancerprobes.go | 4 +- .../mgmt/2017-09-01/network/loadbalancers.go | 16 +- .../network/localnetworkgateways.go | 12 +- .../network/mgmt/2017-09-01/network/models.go | 9948 +++++++----- .../mgmt/2017-09-01/network/packetcaptures.go | 15 +- .../2017-09-01/network/publicipaddresses.go | 24 +- .../2017-09-01/network/routefilterrules.go | 26 +- .../mgmt/2017-09-01/network/routefilters.go | 4 +- .../network/mgmt/2017-09-01/network/routes.go | 14 +- .../mgmt/2017-09-01/network/routetables.go | 12 +- .../mgmt/2017-09-01/network/securitygroups.go | 20 +- .../mgmt/2017-09-01/network/securityrules.go | 20 +- .../mgmt/2017-09-01/network/subnets.go | 2 +- .../network/mgmt/2017-09-01/network/usages.go | 2 +- .../mgmt/2017-09-01/network/version.go | 6 +- .../virtualnetworkgatewayconnections.go | 33 +- .../network/virtualnetworkgateways.go | 74 +- .../network/virtualnetworkpeerings.go | 6 +- .../2017-09-01/network/virtualnetworks.go | 8 +- .../mgmt/2017-09-01/network/watchers.go | 74 +- .../operationalinsights/client.go | 2 +- .../operationalinsights/datasources.go | 24 +- .../operationalinsights/linkedservices.go | 26 +- .../operationalinsights/models.go | 979 +- .../operationalinsights/operations.go | 126 + .../operationalinsights/savedsearches.go | 432 - .../operationalinsights/storageinsights.go | 383 - .../operationalinsights/version.go | 6 +- .../operationalinsights/workspaces.go | 321 +- .../managementassociations.go | 21 +- .../managementconfigurations.go | 12 +- .../operationsmanagement/models.go | 6 +- .../operationsmanagement/solutions.go | 10 +- .../operationsmanagement/version.go | 6 +- .../postgresql/checknameavailability.go | 6 +- .../2017-04-30-preview/postgresql/client.go | 2 +- .../postgresql/configurations.go | 20 +- .../postgresql/databases.go | 27 +- .../postgresql/firewallrules.go | 28 +- .../locationbasedperformancetier.go | 4 +- .../2017-04-30-preview/postgresql/logfiles.go | 6 +- .../2017-04-30-preview/postgresql/models.go | 1313 +- .../postgresql/operations.go | 3 +- .../postgresql/performancetiers.go | 2 +- .../2017-04-30-preview/postgresql/servers.go | 28 +- .../2017-04-30-preview/postgresql/version.go | 6 +- .../postgresql/virtualnetworkrules.go | 357 - .../mgmt/2016-04-01/redis/firewallrule.go | 17 +- .../redis/mgmt/2016-04-01/redis/models.go | 1090 +- .../mgmt/2016-04-01/redis/patchschedules.go | 8 +- .../redis/mgmt/2016-04-01/redis/redis.go | 58 +- .../redis/mgmt/2016-04-01/redis/version.go | 6 +- .../mgmt/2016-06-01/subscriptions/models.go | 10 + .../mgmt/2016-06-01/subscriptions/version.go | 6 +- .../mgmt/2016-09-01/locks/managementlocks.go | 68 +- .../resources/mgmt/2016-09-01/locks/models.go | 100 +- .../mgmt/2016-09-01/locks/version.go | 6 +- .../mgmt/2016-12-01/policy/assignments.go | 29 +- .../mgmt/2016-12-01/policy/definitions.go | 15 +- .../mgmt/2016-12-01/policy/models.go | 186 +- .../mgmt/2016-12-01/policy/version.go | 6 +- .../resources/deploymentoperations.go | 12 +- .../mgmt/2017-05-10/resources/deployments.go | 46 +- .../mgmt/2017-05-10/resources/groups.go | 30 +- .../mgmt/2017-05-10/resources/models.go | 868 +- .../mgmt/2017-05-10/resources/resources.go | 122 +- .../mgmt/2017-05-10/resources/version.go | 6 +- .../2016-03-01/scheduler/jobcollections.go | 12 +- .../mgmt/2016-03-01/scheduler/jobs.go | 31 +- .../mgmt/2016-03-01/scheduler/models.go | 457 +- .../mgmt/2016-03-01/scheduler/version.go | 6 +- .../mgmt/2015-08-19/search/adminkeys.go | 18 +- .../search/mgmt/2015-08-19/search/models.go | 281 +- .../mgmt/2015-08-19/search/operations.go | 98 + .../mgmt/2015-08-19/search/querykeys.go | 28 +- .../search/mgmt/2015-08-19/search/services.go | 133 +- .../search/mgmt/2015-08-19/search/version.go | 6 +- .../servicebus/disasterrecoveryconfigs.go | 65 +- .../mgmt/2017-04-01/servicebus/eventhubs.go | 5 +- .../mgmt/2017-04-01/servicebus/models.go | 1353 +- .../mgmt/2017-04-01/servicebus/namespaces.go | 71 +- .../mgmt/2017-04-01/servicebus/queues.go | 69 +- .../mgmt/2017-04-01/servicebus/regions.go | 2 +- .../mgmt/2017-04-01/servicebus/rules.go | 28 +- .../2017-04-01/servicebus/subscriptions.go | 28 +- .../mgmt/2017-04-01/servicebus/topics.go | 69 +- .../mgmt/2017-04-01/servicebus/version.go | 6 +- .../sql/backuplongtermretentionpolicies.go | 39 +- .../sql/backuplongtermretentionvaults.go | 36 +- .../sql/databaseblobauditingpolicies.go | 32 +- .../mgmt/2015-05-01-preview/sql/databases.go | 125 +- .../sql/databasethreatdetectionpolicies.go | 33 +- .../2015-05-01-preview/sql/databaseusages.go | 6 +- .../sql/datamaskingpolicies.go | 31 +- .../sql/datamaskingrules.go | 35 +- .../sql/elasticpoolactivities.go | 6 +- .../sql/elasticpooldatabaseactivities.go | 6 +- .../2015-05-01-preview/sql/elasticpools.go | 46 +- .../sql/encryptionprotectors.go | 33 +- .../2015-05-01-preview/sql/failovergroups.go | 47 +- .../2015-05-01-preview/sql/firewallrules.go | 26 +- .../sql/geobackuppolicies.go | 39 +- .../sql/mgmt/2015-05-01-preview/sql/models.go | 6190 +++++--- .../sql/recommendedelasticpools.go | 16 +- .../sql/recoverabledatabases.go | 10 +- .../sql/replicationlinks.go | 35 +- .../sql/restorabledroppeddatabases.go | 11 +- .../2015-05-01-preview/sql/restorepoints.go | 6 +- .../sql/serverazureadadministrators.go | 49 +- .../sql/servercommunicationlinks.go | 27 +- .../sql/serverconnectionpolicies.go | 29 +- .../mgmt/2015-05-01-preview/sql/serverkeys.go | 31 +- .../mgmt/2015-05-01-preview/sql/servers.go | 32 +- .../2015-05-01-preview/sql/serverusages.go | 4 +- .../sql/serviceobjectives.go | 10 +- .../sql/servicetieradvisors.go | 8 +- .../sql/subscriptionusages.go | 3 +- .../mgmt/2015-05-01-preview/sql/syncagents.go | 37 +- .../mgmt/2015-05-01-preview/sql/syncgroups.go | 72 +- .../2015-05-01-preview/sql/syncmembers.go | 60 +- .../transparentdataencryptionactivities.go | 15 +- .../sql/transparentdataencryptions.go | 34 +- .../mgmt/2015-05-01-preview/sql/version.go | 6 +- .../sql/virtualnetworkrules.go | 26 +- .../mgmt/2017-10-01/storage/accounts.go | 287 +- .../storage/mgmt/2017-10-01/storage/client.go | 14 +- .../storage/mgmt/2017-10-01/storage/models.go | 1191 +- .../mgmt/2017-10-01/storage/operations.go | 14 +- .../storage/mgmt/2017-10-01/storage/skus.go | 14 +- .../storage/mgmt/2017-10-01/storage/usage.go | 14 +- .../mgmt/2017-10-01/storage/version.go | 6 +- .../2017-05-01/trafficmanager/endpoints.go | 18 +- .../mgmt/2017-05-01/trafficmanager/models.go | 416 +- .../2017-05-01/trafficmanager/profiles.go | 20 +- .../mgmt/2017-05-01/trafficmanager/version.go | 6 +- .../services/web/mgmt/2016-09-01/web/apps.go | 2042 ++- .../web/appservicecertificateorders.go | 118 +- .../2016-09-01/web/appserviceenvironments.go | 126 +- .../mgmt/2016-09-01/web/appserviceplans.go | 183 +- .../web/mgmt/2016-09-01/web/certificates.go | 14 +- .../web/mgmt/2016-09-01/web/client.go | 130 +- .../web/mgmt/2016-09-01/web/diagnostics.go | 56 +- .../web/mgmt/2016-09-01/web/domains.go | 123 +- .../web/mgmt/2016-09-01/web/models.go | 12849 ++++++++++------ .../web/mgmt/2016-09-01/web/provider.go | 94 +- .../mgmt/2016-09-01/web/recommendations.go | 301 +- .../mgmt/2016-09-01/web/topleveldomains.go | 2 +- .../web/mgmt/2016-09-01/web/version.go | 6 +- .../Azure/azure-sdk-for-go/storage/README.md | 81 +- .../Azure/azure-sdk-for-go/storage/blob.go | 68 +- .../azure-sdk-for-go/storage/blobsasuri.go | 4 + .../storage/blobserviceclient.go | 4 +- .../azure-sdk-for-go/storage/blockblob.go | 8 +- .../Azure/azure-sdk-for-go/storage/client.go | 124 +- .../azure-sdk-for-go/storage/container.go | 102 +- .../azure-sdk-for-go/storage/copyblob.go | 16 +- .../azure-sdk-for-go/storage/directory.go | 18 +- .../Azure/azure-sdk-for-go/storage/entity.go | 51 +- .../Azure/azure-sdk-for-go/storage/file.go | 40 +- .../storage/fileserviceclient.go | 40 +- .../azure-sdk-for-go/storage/leaseblob.go | 6 +- .../Azure/azure-sdk-for-go/storage/message.go | 23 +- .../azure-sdk-for-go/storage/pageblob.go | 11 +- .../Azure/azure-sdk-for-go/storage/queue.go | 55 +- .../Azure/azure-sdk-for-go/storage/share.go | 14 +- .../storage/storageservice.go | 10 +- .../Azure/azure-sdk-for-go/storage/table.go | 36 +- .../azure-sdk-for-go/storage/table_batch.go | 8 +- .../storage/tableserviceclient.go | 8 +- .../Azure/azure-sdk-for-go/storage/util.go | 5 + .../Azure/azure-sdk-for-go/storage/version.go | 19 - .../Azure/azure-sdk-for-go/version/version.go | 2 +- vendor/vendor.json | 358 +- 349 files changed, 51297 insertions(+), 26450 deletions(-) create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/annotations.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/componentavailablefeatures.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/componentfeaturecapabilities.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/favorite.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/favorites.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/proactivedetectionconfigurations.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/webtestlocations.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/workitemconfigurations.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dsccompilationjobstream.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/keys.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/linkedworkspace.go rename vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/{testjobs.go => testjob.go} (55%) create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/operations.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-02-01-preview/containerinstance/startcontainer.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/collectionpartition.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/collectionpartitionregion.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/partitionkeyrangeid.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/partitionkeyrangeidregion.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/percentile.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/percentilesourcetarget.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2015-04-08/documentdb/percentiletarget.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/messagingplan.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/regions.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2016-10-01/keyvault/operations.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-04-30-preview/mysql/virtualnetworkrules.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/operations.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/savedsearches.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/storageinsights.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-04-30-preview/postgresql/virtualnetworkrules.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/search/mgmt/2015-08-19/search/operations.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/storage/version.go diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/annotations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/annotations.go new file mode 100644 index 000000000000..c6b16adb42e8 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/annotations.go @@ -0,0 +1,318 @@ +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" +) + +// AnnotationsClient is the composite Swagger for Application Insights Management Client +type AnnotationsClient struct { + BaseClient +} + +// NewAnnotationsClient creates an instance of the AnnotationsClient client. +func NewAnnotationsClient(subscriptionID string) AnnotationsClient { + return NewAnnotationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAnnotationsClientWithBaseURI creates an instance of the AnnotationsClient client. +func NewAnnotationsClientWithBaseURI(baseURI string, subscriptionID string) AnnotationsClient { + return AnnotationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create an Annotation of an Application Insights component. +// +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. annotationProperties is properties that need to be specified to create an annotation of a +// Application Insights component. +func (client AnnotationsClient) Create(ctx context.Context, resourceGroupName string, resourceName string, annotationProperties Annotation) (result ListAnnotation, err error) { + req, err := client.CreatePreparer(ctx, resourceGroupName, resourceName, annotationProperties) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.AnnotationsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.AnnotationsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.AnnotationsClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client AnnotationsClient) CreatePreparer(ctx context.Context, resourceGroupName string, resourceName string, annotationProperties Annotation) (*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.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations", pathParameters), + autorest.WithJSON(annotationProperties), + autorest.WithQueryParameters(queryParameters)) + 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 AnnotationsClient) CreateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client AnnotationsClient) CreateResponder(resp *http.Response) (result ListAnnotation, 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 +} + +// Delete delete an Annotation of an Application Insights component. +// +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. annotationID is the unique annotation ID. This is unique within a Application Insights +// component. +func (client AnnotationsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, annotationID string) (result SetObject, err error) { + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, annotationID) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.AnnotationsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.AnnotationsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.AnnotationsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AnnotationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string, annotationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "annotationId": autorest.Encode("path", annotationID), + "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.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations/{annotationId}", 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 AnnotationsClient) 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 AnnotationsClient) DeleteResponder(resp *http.Response) (result SetObject, 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 +} + +// Get get the annotation for given id. +// +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. annotationID is the unique annotation ID. This is unique within a Application Insights +// component. +func (client AnnotationsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, annotationID string) (result ListAnnotation, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, annotationID) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.AnnotationsClient", "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.AnnotationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.AnnotationsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AnnotationsClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string, annotationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "annotationId": autorest.Encode("path", annotationID), + "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}/Annotations/{annotationId}", 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 AnnotationsClient) 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 AnnotationsClient) GetResponder(resp *http.Response) (result ListAnnotation, 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 +} + +// List gets the list of annotations for a component for given time range +// +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. start is the start time to query from for annotations, cannot be older than 90 days from +// current date. end is the end time to query for annotations. +func (client AnnotationsClient) List(ctx context.Context, resourceGroupName string, resourceName string, start string, end string) (result ListAnnotation, err error) { + req, err := client.ListPreparer(ctx, resourceGroupName, resourceName, start, end) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.AnnotationsClient", "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.AnnotationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.AnnotationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client AnnotationsClient) ListPreparer(ctx context.Context, resourceGroupName string, resourceName string, start string, end 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, + "end": autorest.Encode("query", end), + "start": autorest.Encode("query", start), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations", 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 AnnotationsClient) 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 AnnotationsClient) ListResponder(resp *http.Response) (result ListAnnotation, 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 +} 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..832dfaf7f107 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 { @@ -80,10 +80,10 @@ func (client APIKeysClient) CreatePreparer(ctx context.Context, resourceGroupNam } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/ApiKeys", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ApiKeys", pathParameters), autorest.WithJSON(APIKeyProperties), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -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 { @@ -152,7 +152,7 @@ func (client APIKeysClient) DeletePreparer(ctx context.Context, resourceGroupNam preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/APIKeys/{keyId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/APIKeys/{keyId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -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 { @@ -220,7 +220,7 @@ func (client APIKeysClient) GetPreparer(ctx context.Context, resourceGroupName s preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/APIKeys/{keyId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/APIKeys/{keyId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -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 { @@ -287,7 +287,7 @@ func (client APIKeysClient) ListPreparer(ctx context.Context, resourceGroupName preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/ApiKeys", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ApiKeys", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } 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..2e7d7b4c9733 --- /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..55678b16ce99 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 { @@ -82,7 +82,7 @@ func (client ComponentCurrentBillingFeaturesClient) GetPreparer(ctx context.Cont preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/currentbillingfeatures", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/currentbillingfeatures", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -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 { @@ -148,10 +148,10 @@ func (client ComponentCurrentBillingFeaturesClient) UpdatePreparer(ctx context.C } 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.insights/components/{resourceName}/currentbillingfeatures", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/currentbillingfeatures", pathParameters), autorest.WithJSON(billingFeaturesProperties), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) 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..78a56cdd44b2 --- /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..991b6d4bc255 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 { @@ -81,7 +81,7 @@ func (client ComponentQuotaStatusClient) GetPreparer(ctx context.Context, resour preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/quotastatus", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/quotastatus", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } 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..b403b928518b 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) @@ -87,10 +88,10 @@ func (client ComponentsClient) CreateOrUpdatePreparer(ctx context.Context, resou } 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.insights/components/{resourceName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}", pathParameters), autorest.WithJSON(insightProperties), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -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 { @@ -158,7 +159,7 @@ func (client ComponentsClient) DeletePreparer(ctx context.Context, resourceGroup preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -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 { @@ -224,7 +225,7 @@ func (client ComponentsClient) GetPreparer(ctx context.Context, resourceGroupNam preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -249,6 +250,76 @@ func (client ComponentsClient) GetResponder(resp *http.Response) (result Applica return } +// GetPurgeStatus gets the status of a previously submitted purge using the id returned from the original purge +// request. +// +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. purgeID is in a purge status request, this is the Id of the operation the status of which is +// returned. +func (client ComponentsClient) GetPurgeStatus(ctx context.Context, resourceGroupName string, resourceName string, purgeID string) (result ComponentPurgeStatusResponse, err error) { + req, err := client.GetPurgeStatusPreparer(ctx, resourceGroupName, resourceName, purgeID) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.ComponentsClient", "GetPurgeStatus", nil, "Failure preparing request") + return + } + + resp, err := client.GetPurgeStatusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.ComponentsClient", "GetPurgeStatus", resp, "Failure sending request") + return + } + + result, err = client.GetPurgeStatusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.ComponentsClient", "GetPurgeStatus", resp, "Failure responding to request") + } + + return +} + +// GetPurgeStatusPreparer prepares the GetPurgeStatus request. +func (client ComponentsClient) GetPurgeStatusPreparer(ctx context.Context, resourceGroupName string, resourceName string, purgeID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "purgeId": autorest.Encode("path", purgeID), + "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}/operations/{purgeId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPurgeStatusSender sends the GetPurgeStatus request. The method will close the +// http.Response Body if it receives an error. +func (client ComponentsClient) GetPurgeStatusSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetPurgeStatusResponder handles the response to the GetPurgeStatus request. The method always +// closes the http.Response Body. +func (client ComponentsClient) GetPurgeStatusResponder(resp *http.Response) (result ComponentPurgeStatusResponse, 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 all Application Insights components within a subscription. func (client ComponentsClient) List(ctx context.Context) (result ApplicationInsightsComponentListResultPage, err error) { result.fn = client.listNextResults @@ -287,7 +358,7 @@ func (client ComponentsClient) ListPreparer(ctx context.Context) (*http.Request, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/microsoft.insights/components", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/components", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -380,7 +451,7 @@ func (client ComponentsClient) ListByResourceGroupPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -432,10 +503,87 @@ func (client ComponentsClient) ListByResourceGroupComplete(ctx context.Context, return } +// Purge purges data in an Application Insights component by a set of user-defined filters. +// +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. body is describes the body of a request to purge data in a single table of an Application +// Insights component +func (client ComponentsClient) Purge(ctx context.Context, resourceGroupName string, resourceName string, body ComponentPurgeBody) (result ComponentPurgeResponse, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body.Table", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "body.Filters", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("insights.ComponentsClient", "Purge", err.Error()) + } + + req, err := client.PurgePreparer(ctx, resourceGroupName, resourceName, body) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.ComponentsClient", "Purge", nil, "Failure preparing request") + return + } + + resp, err := client.PurgeSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.ComponentsClient", "Purge", resp, "Failure sending request") + return + } + + result, err = client.PurgeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.ComponentsClient", "Purge", resp, "Failure responding to request") + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client ComponentsClient) PurgePreparer(ctx context.Context, resourceGroupName string, resourceName string, body ComponentPurgeBody) (*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.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/purge", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client ComponentsClient) PurgeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client ComponentsClient) PurgeResponder(resp *http.Response) (result ComponentPurgeResponse, 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 +} + // 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 { @@ -472,10 +620,10 @@ func (client ComponentsClient) UpdateTagsPreparer(ctx context.Context, resourceG } 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.insights/components/{resourceName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}", pathParameters), autorest.WithJSON(componentTags), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) 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..c76a488ca74d 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 { @@ -80,10 +80,10 @@ func (client ExportConfigurationsClient) CreatePreparer(ctx context.Context, res } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration", pathParameters), autorest.WithJSON(exportProperties), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -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 { @@ -153,7 +153,7 @@ func (client ExportConfigurationsClient) DeletePreparer(ctx context.Context, res preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration/{exportId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -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 { @@ -222,7 +222,7 @@ func (client ExportConfigurationsClient) GetPreparer(ctx context.Context, resour preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration/{exportId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -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 { @@ -289,7 +289,7 @@ func (client ExportConfigurationsClient) ListPreparer(ctx context.Context, resou preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -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 { @@ -356,10 +357,10 @@ func (client ExportConfigurationsClient) UpdatePreparer(ctx context.Context, res } 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.insights/components/{resourceName}/exportconfiguration/{exportId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}", pathParameters), autorest.WithJSON(exportProperties), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/favorite.go b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/favorite.go new file mode 100644 index 000000000000..c18bef50305f --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/favorite.go @@ -0,0 +1,318 @@ +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" +) + +// FavoriteClient is the composite Swagger for Application Insights Management Client +type FavoriteClient struct { + BaseClient +} + +// NewFavoriteClient creates an instance of the FavoriteClient client. +func NewFavoriteClient(subscriptionID string) FavoriteClient { + return NewFavoriteClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewFavoriteClientWithBaseURI creates an instance of the FavoriteClient client. +func NewFavoriteClientWithBaseURI(baseURI string, subscriptionID string) FavoriteClient { + return FavoriteClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Add adds a new favorites to an Application Insights component. +// +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. favoriteID is the Id of a specific favorite defined in the Application Insights component +// favoriteProperties is properties that need to be specified to create a new favorite and add it to an Application +// Insights component. +func (client FavoriteClient) Add(ctx context.Context, resourceGroupName string, resourceName string, favoriteID string, favoriteProperties ApplicationInsightsComponentFavorite) (result ApplicationInsightsComponentFavorite, err error) { + req, err := client.AddPreparer(ctx, resourceGroupName, resourceName, favoriteID, favoriteProperties) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.FavoriteClient", "Add", nil, "Failure preparing request") + return + } + + resp, err := client.AddSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.FavoriteClient", "Add", resp, "Failure sending request") + return + } + + result, err = client.AddResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.FavoriteClient", "Add", resp, "Failure responding to request") + } + + return +} + +// AddPreparer prepares the Add request. +func (client FavoriteClient) AddPreparer(ctx context.Context, resourceGroupName string, resourceName string, favoriteID string, favoriteProperties ApplicationInsightsComponentFavorite) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "favoriteId": autorest.Encode("path", favoriteID), + "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.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}", pathParameters), + autorest.WithJSON(favoriteProperties), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AddSender sends the Add request. The method will close the +// http.Response Body if it receives an error. +func (client FavoriteClient) AddSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// AddResponder handles the response to the Add request. The method always +// closes the http.Response Body. +func (client FavoriteClient) AddResponder(resp *http.Response) (result ApplicationInsightsComponentFavorite, 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 remove a favorite that is associated to an Application Insights component. +// +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. favoriteID is the Id of a specific favorite defined in the Application Insights component +func (client FavoriteClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, favoriteID string) (result autorest.Response, err error) { + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, favoriteID) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.FavoriteClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "insights.FavoriteClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.FavoriteClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client FavoriteClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string, favoriteID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "favoriteId": autorest.Encode("path", favoriteID), + "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.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}", 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 FavoriteClient) 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 FavoriteClient) 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 get a single favorite by its FavoriteId, defined within an Application Insights component. +// +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. favoriteID is the Id of a specific favorite defined in the Application Insights component +func (client FavoriteClient) Get(ctx context.Context, resourceGroupName string, resourceName string, favoriteID string) (result ApplicationInsightsComponentFavorite, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, favoriteID) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.FavoriteClient", "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.FavoriteClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.FavoriteClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client FavoriteClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string, favoriteID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "favoriteId": autorest.Encode("path", favoriteID), + "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}/favorites/{favoriteId}", 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 FavoriteClient) 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 FavoriteClient) GetResponder(resp *http.Response) (result ApplicationInsightsComponentFavorite, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates a favorite that has already been added to an Application Insights component. +// +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. favoriteID is the Id of a specific favorite defined in the Application Insights component +// favoriteProperties is properties that need to be specified to update the existing favorite. +func (client FavoriteClient) Update(ctx context.Context, resourceGroupName string, resourceName string, favoriteID string, favoriteProperties ApplicationInsightsComponentFavorite) (result ApplicationInsightsComponentFavorite, err error) { + req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceName, favoriteID, favoriteProperties) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.FavoriteClient", "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.FavoriteClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.FavoriteClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client FavoriteClient) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, favoriteID string, favoriteProperties ApplicationInsightsComponentFavorite) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "favoriteId": autorest.Encode("path", favoriteID), + "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.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}", pathParameters), + autorest.WithJSON(favoriteProperties), + 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 FavoriteClient) 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 FavoriteClient) UpdateResponder(resp *http.Response) (result ApplicationInsightsComponentFavorite, 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/favorites.go b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/favorites.go new file mode 100644 index 000000000000..119f18af713a --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/favorites.go @@ -0,0 +1,125 @@ +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" +) + +// FavoritesClient is the composite Swagger for Application Insights Management Client +type FavoritesClient struct { + BaseClient +} + +// NewFavoritesClient creates an instance of the FavoritesClient client. +func NewFavoritesClient(subscriptionID string) FavoritesClient { + return NewFavoritesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewFavoritesClientWithBaseURI creates an instance of the FavoritesClient client. +func NewFavoritesClientWithBaseURI(baseURI string, subscriptionID string) FavoritesClient { + return FavoritesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List gets a list of favorites defined within an Application Insights component. +// +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. favoriteType is the type of favorite. Value can be either shared or user. sourceType is +// source type of favorite to return. When left out, the source type defaults to 'other' (not present in this +// enum). canFetchContent is flag indicating whether or not to return the full content for each applicable +// favorite. If false, only return summary content for favorites. tags is tags that must be present on each +// favorite returned. +func (client FavoritesClient) List(ctx context.Context, resourceGroupName string, resourceName string, favoriteType FavoriteType, sourceType FavoriteSourceType, canFetchContent *bool, tags []string) (result ListApplicationInsightsComponentFavorite, err error) { + req, err := client.ListPreparer(ctx, resourceGroupName, resourceName, favoriteType, sourceType, canFetchContent, tags) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.FavoritesClient", "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.FavoritesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.FavoritesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client FavoritesClient) ListPreparer(ctx context.Context, resourceGroupName string, resourceName string, favoriteType FavoriteType, sourceType FavoriteSourceType, canFetchContent *bool, tags []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, + } + if len(string(favoriteType)) > 0 { + queryParameters["favoriteType"] = autorest.Encode("query", favoriteType) + } else { + queryParameters["favoriteType"] = autorest.Encode("query", "shared") + } + if len(string(sourceType)) > 0 { + queryParameters["sourceType"] = autorest.Encode("query", sourceType) + } + if canFetchContent != nil { + queryParameters["canFetchContent"] = autorest.Encode("query", *canFetchContent) + } + if tags != nil && len(tags) > 0 { + queryParameters["tags"] = autorest.Encode("query", tags, ",") + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites", 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 FavoritesClient) 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 FavoritesClient) ListResponder(resp *http.Response) (result ListApplicationInsightsComponentFavorite, 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 +} 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..99026d27bb3b 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 @@ -35,6 +35,53 @@ const ( Web ApplicationType = "web" ) +// PossibleApplicationTypeValues returns an array of possible values for the ApplicationType const type. +func PossibleApplicationTypeValues() []ApplicationType { + return []ApplicationType{Other, Web} +} + +// FavoriteSourceType enumerates the values for favorite source type. +type FavoriteSourceType string + +const ( + // Events ... + Events FavoriteSourceType = "events" + // Funnel ... + Funnel FavoriteSourceType = "funnel" + // Impact ... + Impact FavoriteSourceType = "impact" + // Notebook ... + Notebook FavoriteSourceType = "notebook" + // Retention ... + Retention FavoriteSourceType = "retention" + // Segmentation ... + Segmentation FavoriteSourceType = "segmentation" + // Sessions ... + Sessions FavoriteSourceType = "sessions" + // Userflows ... + Userflows FavoriteSourceType = "userflows" +) + +// PossibleFavoriteSourceTypeValues returns an array of possible values for the FavoriteSourceType const type. +func PossibleFavoriteSourceTypeValues() []FavoriteSourceType { + return []FavoriteSourceType{Events, Funnel, Impact, Notebook, Retention, Segmentation, Sessions, Userflows} +} + +// FavoriteType enumerates the values for favorite type. +type FavoriteType string + +const ( + // Shared ... + Shared FavoriteType = "shared" + // User ... + User FavoriteType = "user" +) + +// PossibleFavoriteTypeValues returns an array of possible values for the FavoriteType const type. +func PossibleFavoriteTypeValues() []FavoriteType { + return []FavoriteType{Shared, User} +} + // FlowType enumerates the values for flow type. type FlowType string @@ -43,6 +90,26 @@ const ( Bluefield FlowType = "Bluefield" ) +// PossibleFlowTypeValues returns an array of possible values for the FlowType const type. +func PossibleFlowTypeValues() []FlowType { + return []FlowType{Bluefield} +} + +// PurgeState enumerates the values for purge state. +type PurgeState string + +const ( + // Completed ... + Completed PurgeState = "Completed" + // Pending ... + Pending PurgeState = "Pending" +) + +// PossiblePurgeStateValues returns an array of possible values for the PurgeState const type. +func PossiblePurgeStateValues() []PurgeState { + return []PurgeState{Completed, Pending} +} + // RequestSource enumerates the values for request source. type RequestSource string @@ -51,6 +118,11 @@ const ( Rest RequestSource = "rest" ) +// PossibleRequestSourceValues returns an array of possible values for the RequestSource const type. +func PossibleRequestSourceValues() []RequestSource { + return []RequestSource{Rest} +} + // WebTestKind enumerates the values for web test kind. type WebTestKind string @@ -61,6 +133,36 @@ const ( Ping WebTestKind = "ping" ) +// PossibleWebTestKindValues returns an array of possible values for the WebTestKind const type. +func PossibleWebTestKindValues() []WebTestKind { + return []WebTestKind{Multistep, Ping} +} + +// Annotation annotation associated with an application insights resource. +type Annotation struct { + // AnnotationName - Name of annotation + AnnotationName *string `json:"AnnotationName,omitempty"` + // Category - Category of annotation, free form + Category *string `json:"Category,omitempty"` + // EventTime - Time when event occurred + EventTime *date.Time `json:"EventTime,omitempty"` + // ID - Unique Id for annotation + ID *string `json:"Id,omitempty"` + // Properties - Serialized JSON object for detailed properties + Properties *string `json:"Properties,omitempty"` + // RelatedAnnotation - Related parent annotation if any + RelatedAnnotation *string `json:"RelatedAnnotation,omitempty"` +} + +// AnnotationError error associated with trying to create annotation with Id that already exist +type AnnotationError struct { + // Code - Error detail code and explanation + Code *string `json:"code,omitempty"` + // Message - Error message + Message *string `json:"message,omitempty"` + Innererror *InnerError `json:"innererror,omitempty"` +} + // APIKeyRequest an Application Insights component API Key createion request definition. type APIKeyRequest struct { // Name - The name of the API Key. @@ -74,6 +176,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 +189,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 +314,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 +397,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 +420,109 @@ type ApplicationInsightsComponentExportRequest struct { DestinationAccountID *string `json:"DestinationAccountId,omitempty"` } +// ApplicationInsightsComponentFavorite properties that define a favorite that is associated to an Application +// Insights component. +type ApplicationInsightsComponentFavorite struct { + autorest.Response `json:"-"` + // Name - The user-defined name of the favorite. + Name *string `json:"Name,omitempty"` + // Config - Configuration of this particular favorite, which are driven by the Azure portal UX. Configuration data is a string containing valid JSON + Config *string `json:"Config,omitempty"` + // Version - This instance's version of the data model. This can change as new features are added that can be marked favorite. Current examples include MetricsExplorer (ME) and Search. + Version *string `json:"Version,omitempty"` + // FavoriteID - Internally assigned unique id of the favorite definition. + FavoriteID *string `json:"FavoriteId,omitempty"` + // FavoriteType - Enum indicating if this favorite definition is owned by a specific user or is shared between all users with access to the Application Insights component. Possible values include: 'Shared', 'User' + FavoriteType FavoriteType `json:"FavoriteType,omitempty"` + // SourceType - The source of the favorite definition. + SourceType *string `json:"SourceType,omitempty"` + // TimeModified - Date and time in UTC of the last modification that was made to this favorite definition. + TimeModified *string `json:"TimeModified,omitempty"` + // Tags - A list of 0 or more tags that are associated with this favorite definition + Tags *[]string `json:"Tags,omitempty"` + // Category - Favorite category, as defined by the user at creation time. + Category *string `json:"Category,omitempty"` + // IsGeneratedFromTemplate - Flag denoting wether or not this favorite was generated from a template. + IsGeneratedFromTemplate *bool `json:"IsGeneratedFromTemplate,omitempty"` + // UserID - Unique user id of the specific user that owns this favorite. + UserID *string `json:"UserId,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 +532,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 +626,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 +704,55 @@ 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. +// ApplicationInsightsComponentWebTestLocation properties that define a web test location available to an +// Application Insights Component. +type ApplicationInsightsComponentWebTestLocation struct { + // DisplayName - The display name of the web test location. + DisplayName *string `json:"DisplayName,omitempty"` + // Tag - Internally defined geographic location tag. + Tag *string `json:"Tag,omitempty"` +} + +// ApplicationInsightsWebTestLocationsListResult describes the list of web test locations available to an +// Application Insights Component. +type ApplicationInsightsWebTestLocationsListResult struct { + autorest.Response `json:"-"` + // Value - List of web test locations. + Value *[]ApplicationInsightsComponentWebTestLocation `json:"value,omitempty"` +} + +// ComponentPurgeBody describes the body of a purge request for an App Insights component +type ComponentPurgeBody struct { + // Table - Table from which to purge data. + Table *string `json:"table,omitempty"` + // Filters - The set of columns and filters (queries) to run over them to purge the resulting data. + Filters *[]ComponentPurgeBodyFilters `json:"filters,omitempty"` +} + +// ComponentPurgeBodyFilters user-defined filters to return data which will be purged from the table. +type ComponentPurgeBodyFilters struct { + // Column - The column of the table over which the given query should run + Column *string `json:"column,omitempty"` + // Filter - A query to to run over the provided table and column to purge the corresponding data. + Filter *string `json:"filter,omitempty"` +} + +// ComponentPurgeResponse response containing operationId for a specific purge action. +type ComponentPurgeResponse struct { + autorest.Response `json:"-"` + // OperationID - Id to use when querying for status for a particular purge operation. + OperationID *string `json:"operationId,omitempty"` +} + +// ComponentPurgeStatusResponse response containing status for a specific purge operation. +type ComponentPurgeStatusResponse struct { + autorest.Response `json:"-"` + // Status - Status of the operation represented by the requested Id. Possible values include: 'Pending', 'Completed' + Status PurgeState `json:"status,omitempty"` +} + +// 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"` @@ -438,12 +760,44 @@ type ErrorResponse struct { Message *string `json:"message,omitempty"` } +// InnerError inner error +type InnerError struct { + // Diagnosticcontext - Provides correlation for request + Diagnosticcontext *string `json:"diagnosticcontext,omitempty"` + // Time - Request time + Time *date.Time `json:"time,omitempty"` +} + +// ListAnnotation ... +type ListAnnotation struct { + autorest.Response `json:"-"` + Value *[]Annotation `json:"value,omitempty"` +} + // ListApplicationInsightsComponentExportConfiguration ... type ListApplicationInsightsComponentExportConfiguration struct { autorest.Response `json:"-"` Value *[]ApplicationInsightsComponentExportConfiguration `json:"value,omitempty"` } +// ListApplicationInsightsComponentFavorite ... +type ListApplicationInsightsComponentFavorite struct { + autorest.Response `json:"-"` + Value *[]ApplicationInsightsComponentFavorite `json:"value,omitempty"` +} + +// ListApplicationInsightsComponentProactiveDetectionConfiguration ... +type ListApplicationInsightsComponentProactiveDetectionConfiguration struct { + autorest.Response `json:"-"` + Value *[]ApplicationInsightsComponentProactiveDetectionConfiguration `json:"value,omitempty"` +} + +// ListWorkItemConfiguration ... +type ListWorkItemConfiguration struct { + autorest.Response `json:"-"` + Value *[]WorkItemConfiguration `json:"value,omitempty"` +} + // Operation CDN REST API operation type Operation struct { // Name - Operation name: {provider}/{resource}/{operation} @@ -462,8 +816,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 +930,59 @@ 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) +} + +// SetObject ... +type SetObject struct { + autorest.Response `json:"-"` + Value interface{} `json:"value,omitempty"` } // 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 +992,116 @@ 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{}) + if wt.Kind != "" { + objectMap["kind"] = wt.Kind } - 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.WebTestProperties != nil { + objectMap["properties"] = wt.WebTestProperties } - - 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.ID != nil { + objectMap["id"] = wt.ID } - - 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.Name != nil { + objectMap["name"] = wt.Name } - - 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.Type != nil { + objectMap["type"] = wt.Type } - - 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.Location != nil { + objectMap["location"] = wt.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - wt.Location = &location + if wt.Tags != nil { + objectMap["tags"] = wt.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 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 + } + 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"` @@ -827,3 +1240,39 @@ type WebTestPropertiesConfiguration struct { // WebTest - The XML specification of a WebTest to run against an application. WebTest *string `json:"WebTest,omitempty"` } + +// WorkItemConfiguration work item configuration associated with an application insights resource. +type WorkItemConfiguration struct { + autorest.Response `json:"-"` + // ConnectorID - Connector identifier where work item is created + ConnectorID *string `json:"ConnectorId,omitempty"` + // ConfigDisplayName - Configuration friendly name + ConfigDisplayName *string `json:"ConfigDisplayName,omitempty"` + // IsDefault - Boolean value indicating whether configuration is default + IsDefault *bool `json:"IsDefault,omitempty"` + // ID - Unique Id for work item + ID *string `json:"Id,omitempty"` + // ConfigProperties - Serialized JSON object for detailed properties + ConfigProperties *string `json:"ConfigProperties,omitempty"` +} + +// WorkItemConfigurationError error associated with trying to get work item configuration or configurations +type WorkItemConfigurationError struct { + // Code - Error detail code and explanation + Code *string `json:"code,omitempty"` + // Message - Error message + Message *string `json:"message,omitempty"` + Innererror *InnerError `json:"innererror,omitempty"` +} + +// WorkItemCreateConfiguration work item configuration creation payload +type WorkItemCreateConfiguration struct { + // ConnectorID - Unique connector id + ConnectorID *string `json:"ConnectorId,omitempty"` + // ConnectorDataConfiguration - Serialized JSON object for detaile d properties + ConnectorDataConfiguration *string `json:"ConnectorDataConfiguration,omitempty"` + // ValidateOnly - Boolean indicating validate only + ValidateOnly *bool `json:"ValidateOnly,omitempty"` + // WorkItemProperties - Custom work item properties + WorkItemProperties *string `json:"WorkItemProperties,omitempty"` +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/operations.go index 5ec3ae1bedc8..a06822f91600 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/operations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/operations.go @@ -73,7 +73,7 @@ func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/microsoft.insights/operations"), + autorest.WithPath("/providers/Microsoft.Insights/operations"), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } 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..00b8a1aa812b --- /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.AsContentType("application/json; charset=utf-8"), + 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/webtestlocations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/webtestlocations.go new file mode 100644 index 000000000000..5f865462c81e --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/webtestlocations.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" +) + +// WebTestLocationsClient is the composite Swagger for Application Insights Management Client +type WebTestLocationsClient struct { + BaseClient +} + +// NewWebTestLocationsClient creates an instance of the WebTestLocationsClient client. +func NewWebTestLocationsClient(subscriptionID string) WebTestLocationsClient { + return NewWebTestLocationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWebTestLocationsClientWithBaseURI creates an instance of the WebTestLocationsClient client. +func NewWebTestLocationsClientWithBaseURI(baseURI string, subscriptionID string) WebTestLocationsClient { + return WebTestLocationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List gets a list of web test locations available to this Application Insights component. +// +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. +func (client WebTestLocationsClient) List(ctx context.Context, resourceGroupName string, resourceName string) (result ApplicationInsightsWebTestLocationsListResult, err error) { + req, err := client.ListPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.WebTestLocationsClient", "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.WebTestLocationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.WebTestLocationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client WebTestLocationsClient) 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}/syntheticmonitorlocations", 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 WebTestLocationsClient) 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 WebTestLocationsClient) ListResponder(resp *http.Response) (result ApplicationInsightsWebTestLocationsListResult, 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/webtests.go b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/webtests.go index 069ec99afe2f..5d8de80ebddf 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) @@ -91,10 +91,10 @@ func (client WebTestsClient) CreateOrUpdatePreparer(ctx context.Context, resourc } 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.insights/webtests/{webTestName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}", pathParameters), autorest.WithJSON(webTestDefinition), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -162,7 +162,7 @@ func (client WebTestsClient) DeletePreparer(ctx context.Context, resourceGroupNa preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -228,7 +228,7 @@ func (client WebTestsClient) GetPreparer(ctx context.Context, resourceGroupName preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -291,7 +291,7 @@ func (client WebTestsClient) ListPreparer(ctx context.Context) (*http.Request, e preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/microsoft.insights/webtests", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/webtests", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -384,7 +384,7 @@ func (client WebTestsClient) ListByResourceGroupPreparer(ctx context.Context, re preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -476,10 +476,10 @@ func (client WebTestsClient) UpdateTagsPreparer(ctx context.Context, resourceGro } 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.insights/webtests/{webTestName}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}", pathParameters), autorest.WithJSON(webTestTags), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/workitemconfigurations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/workitemconfigurations.go new file mode 100644 index 000000000000..4b05a66cd462 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights/workitemconfigurations.go @@ -0,0 +1,313 @@ +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" +) + +// WorkItemConfigurationsClient is the composite Swagger for Application Insights Management Client +type WorkItemConfigurationsClient struct { + BaseClient +} + +// NewWorkItemConfigurationsClient creates an instance of the WorkItemConfigurationsClient client. +func NewWorkItemConfigurationsClient(subscriptionID string) WorkItemConfigurationsClient { + return NewWorkItemConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkItemConfigurationsClientWithBaseURI creates an instance of the WorkItemConfigurationsClient client. +func NewWorkItemConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) WorkItemConfigurationsClient { + return WorkItemConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create a work item configuration for an Application Insights component. +// +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. workItemConfigurationProperties is properties that need to be specified to create a work +// item configuration of a Application Insights component. +func (client WorkItemConfigurationsClient) Create(ctx context.Context, resourceGroupName string, resourceName string, workItemConfigurationProperties WorkItemCreateConfiguration) (result WorkItemConfiguration, err error) { + req, err := client.CreatePreparer(ctx, resourceGroupName, resourceName, workItemConfigurationProperties) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.WorkItemConfigurationsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.WorkItemConfigurationsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.WorkItemConfigurationsClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client WorkItemConfigurationsClient) CreatePreparer(ctx context.Context, resourceGroupName string, resourceName string, workItemConfigurationProperties WorkItemCreateConfiguration) (*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.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs", pathParameters), + autorest.WithJSON(workItemConfigurationProperties), + autorest.WithQueryParameters(queryParameters)) + 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 WorkItemConfigurationsClient) CreateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client WorkItemConfigurationsClient) CreateResponder(resp *http.Response) (result WorkItemConfiguration, 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 delete an workitem configuration of an Application Insights component. +// +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. workItemConfigID is the unique work item configuration Id. This can be either friendly name +// of connector as defined in connector configuration +func (client WorkItemConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, workItemConfigID string) (result SetObject, err error) { + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, workItemConfigID) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.WorkItemConfigurationsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.WorkItemConfigurationsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.WorkItemConfigurationsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client WorkItemConfigurationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string, workItemConfigID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workItemConfigId": autorest.Encode("path", workItemConfigID), + } + + const APIVersion = "2015-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs/{workItemConfigId}", 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 WorkItemConfigurationsClient) 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 WorkItemConfigurationsClient) DeleteResponder(resp *http.Response) (result SetObject, 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 +} + +// GetDefault gets default work item configurations that exist for the application +// +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. +func (client WorkItemConfigurationsClient) GetDefault(ctx context.Context, resourceGroupName string, resourceName string) (result WorkItemConfiguration, err error) { + req, err := client.GetDefaultPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.WorkItemConfigurationsClient", "GetDefault", nil, "Failure preparing request") + return + } + + resp, err := client.GetDefaultSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.WorkItemConfigurationsClient", "GetDefault", resp, "Failure sending request") + return + } + + result, err = client.GetDefaultResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.WorkItemConfigurationsClient", "GetDefault", resp, "Failure responding to request") + } + + return +} + +// GetDefaultPreparer prepares the GetDefault request. +func (client WorkItemConfigurationsClient) GetDefaultPreparer(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}/DefaultWorkItemConfig", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetDefaultSender sends the GetDefault request. The method will close the +// http.Response Body if it receives an error. +func (client WorkItemConfigurationsClient) GetDefaultSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetDefaultResponder handles the response to the GetDefault request. The method always +// closes the http.Response Body. +func (client WorkItemConfigurationsClient) GetDefaultResponder(resp *http.Response) (result WorkItemConfiguration, 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 the list work item configurations that exist for the application +// +// resourceGroupName is the name of the resource group. resourceName is the name of the Application Insights +// component resource. +func (client WorkItemConfigurationsClient) List(ctx context.Context, resourceGroupName string, resourceName string) (result ListWorkItemConfiguration, err error) { + req, err := client.ListPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.WorkItemConfigurationsClient", "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.WorkItemConfigurationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.WorkItemConfigurationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client WorkItemConfigurationsClient) 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}/WorkItemConfigs", 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 WorkItemConfigurationsClient) 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 WorkItemConfigurationsClient) ListResponder(resp *http.Response) (result ListWorkItemConfiguration, 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 +} 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..a1186a9537e2 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. @@ -85,7 +85,7 @@ func (client RoleAssignmentsClient) CreatePreparer(ctx context.Context, scope st } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}", pathParameters), @@ -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) { @@ -154,7 +155,7 @@ func (client RoleAssignmentsClient) CreateByIDPreparer(ctx context.Context, role } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/{roleAssignmentId}", pathParameters), @@ -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..dd90e819f46a 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 { @@ -81,7 +81,7 @@ func (client RoleDefinitionsClient) CreateOrUpdatePreparer(ctx context.Context, } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}", pathParameters), @@ -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..037f73a92408 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 @@ -31,24 +31,24 @@ type AccountClient struct { } // NewAccountClient creates an instance of the AccountClient client. -func NewAccountClient(subscriptionID string, resourceGroupName string) AccountClient { - return NewAccountClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) +func NewAccountClient(subscriptionID string) AccountClient { + return NewAccountClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAccountClientWithBaseURI creates an instance of the AccountClient client. -func NewAccountClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) AccountClient { - return AccountClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} +func NewAccountClientWithBaseURI(baseURI string, subscriptionID string) AccountClient { + return AccountClient{NewWithBaseURI(baseURI, subscriptionID)} } // 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) @@ -86,7 +86,7 @@ func (client AccountClient) CreateOrUpdatePreparer(ctx context.Context, resource } 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.Automation/automationAccounts/{automationAccountName}", pathParameters), @@ -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) @@ -493,7 +493,7 @@ func (client AccountClient) UpdatePreparer(ctx context.Context, resourceGroupNam } 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.Automation/automationAccounts/{automationAccountName}", pathParameters), 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..ac9db9eb863f 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 @@ -31,27 +31,27 @@ type ActivityClient struct { } // NewActivityClient creates an instance of the ActivityClient client. -func NewActivityClient(subscriptionID string, resourceGroupName string) ActivityClient { - return NewActivityClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) +func NewActivityClient(subscriptionID string) ActivityClient { + return NewActivityClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewActivityClientWithBaseURI creates an instance of the ActivityClient client. -func NewActivityClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) ActivityClient { - return ActivityClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} +func NewActivityClientWithBaseURI(baseURI string, subscriptionID string) ActivityClient { + return ActivityClient{NewWithBaseURI(baseURI, subscriptionID)} } // 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. -func (client ActivityClient) Get(ctx context.Context, automationAccountName string, moduleName string, activityName string) (result Activity, err error) { +// resourceGroupName is the resource group name. 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, resourceGroupName string, 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") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ActivityClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, automationAccountName, moduleName, activityName) + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, moduleName, activityName) if err != nil { err = autorest.NewErrorWithError(err, "automation.ActivityClient", "Get", nil, "Failure preparing request") return @@ -73,12 +73,12 @@ func (client ActivityClient) Get(ctx context.Context, automationAccountName stri } // GetPreparer prepares the Get request. -func (client ActivityClient) GetPreparer(ctx context.Context, automationAccountName string, moduleName string, activityName string) (*http.Request, error) { +func (client ActivityClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, activityName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "activityName": autorest.Encode("path", activityName), "automationAccountName": autorest.Encode("path", automationAccountName), "moduleName": autorest.Encode("path", moduleName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -117,16 +117,17 @@ func (client ActivityClient) GetResponder(resp *http.Response) (result Activity, // ListByModule retrieve a list of activities in the module identified by module name. // -// automationAccountName is the automation account name. moduleName is the name of module. -func (client ActivityClient) ListByModule(ctx context.Context, automationAccountName string, moduleName string) (result ActivityListResultPage, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. moduleName +// is the name of module. +func (client ActivityClient) ListByModule(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (result ActivityListResultPage, 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", "ListByModule") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ActivityClient", "ListByModule", err.Error()) } result.fn = client.listByModuleNextResults - req, err := client.ListByModulePreparer(ctx, automationAccountName, moduleName) + req, err := client.ListByModulePreparer(ctx, resourceGroupName, automationAccountName, moduleName) if err != nil { err = autorest.NewErrorWithError(err, "automation.ActivityClient", "ListByModule", nil, "Failure preparing request") return @@ -148,11 +149,11 @@ func (client ActivityClient) ListByModule(ctx context.Context, automationAccount } // ListByModulePreparer prepares the ListByModule request. -func (client ActivityClient) ListByModulePreparer(ctx context.Context, automationAccountName string, moduleName string) (*http.Request, error) { +func (client ActivityClient) ListByModulePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "moduleName": autorest.Encode("path", moduleName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -211,7 +212,7 @@ func (client ActivityClient) listByModuleNextResults(lastResults ActivityListRes } // ListByModuleComplete enumerates all values, automatically crossing page boundaries as required. -func (client ActivityClient) ListByModuleComplete(ctx context.Context, automationAccountName string, moduleName string) (result ActivityListResultIterator, err error) { - result.page, err = client.ListByModule(ctx, automationAccountName, moduleName) +func (client ActivityClient) ListByModuleComplete(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (result ActivityListResultIterator, err error) { + result.page, err = client.ListByModule(ctx, resourceGroupName, automationAccountName, moduleName) return } 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..365936df4f91 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 @@ -31,27 +31,27 @@ type AgentRegistrationInformationClient struct { } // NewAgentRegistrationInformationClient creates an instance of the AgentRegistrationInformationClient client. -func NewAgentRegistrationInformationClient(subscriptionID string, resourceGroupName string) AgentRegistrationInformationClient { - return NewAgentRegistrationInformationClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) +func NewAgentRegistrationInformationClient(subscriptionID string) AgentRegistrationInformationClient { + return NewAgentRegistrationInformationClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewAgentRegistrationInformationClientWithBaseURI creates an instance of the AgentRegistrationInformationClient // client. -func NewAgentRegistrationInformationClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) AgentRegistrationInformationClient { - return AgentRegistrationInformationClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} +func NewAgentRegistrationInformationClientWithBaseURI(baseURI string, subscriptionID string) AgentRegistrationInformationClient { + return AgentRegistrationInformationClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get retrieve the automation agent registration information. // -// automationAccountName is the automation account name. -func (client AgentRegistrationInformationClient) Get(ctx context.Context, automationAccountName string) (result AgentRegistration, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +func (client AgentRegistrationInformationClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string) (result AgentRegistration, 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.AgentRegistrationInformationClient", "Get") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.AgentRegistrationInformationClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, automationAccountName) + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName) if err != nil { err = autorest.NewErrorWithError(err, "automation.AgentRegistrationInformationClient", "Get", nil, "Failure preparing request") return @@ -73,10 +73,10 @@ func (client AgentRegistrationInformationClient) Get(ctx context.Context, automa } // GetPreparer prepares the Get request. -func (client AgentRegistrationInformationClient) GetPreparer(ctx context.Context, automationAccountName string) (*http.Request, error) { +func (client AgentRegistrationInformationClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -115,16 +115,16 @@ func (client AgentRegistrationInformationClient) GetResponder(resp *http.Respons // RegenerateKey regenerate a primary or secondary agent registration key // -// automationAccountName is the automation account name. parameters is the name of the agent registration key to be -// regenerated -func (client AgentRegistrationInformationClient) RegenerateKey(ctx context.Context, automationAccountName string, parameters AgentRegistrationRegenerateKeyParameter) (result AgentRegistration, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. parameters +// is the name of the agent registration key to be regenerated +func (client AgentRegistrationInformationClient) RegenerateKey(ctx context.Context, resourceGroupName string, automationAccountName string, parameters AgentRegistrationRegenerateKeyParameter) (result AgentRegistration, 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.AgentRegistrationInformationClient", "RegenerateKey") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.AgentRegistrationInformationClient", "RegenerateKey", err.Error()) } - req, err := client.RegenerateKeyPreparer(ctx, automationAccountName, parameters) + req, err := client.RegenerateKeyPreparer(ctx, resourceGroupName, automationAccountName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.AgentRegistrationInformationClient", "RegenerateKey", nil, "Failure preparing request") return @@ -146,10 +146,10 @@ func (client AgentRegistrationInformationClient) RegenerateKey(ctx context.Conte } // RegenerateKeyPreparer prepares the RegenerateKey request. -func (client AgentRegistrationInformationClient) RegenerateKeyPreparer(ctx context.Context, automationAccountName string, parameters AgentRegistrationRegenerateKeyParameter) (*http.Request, error) { +func (client AgentRegistrationInformationClient) RegenerateKeyPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, parameters AgentRegistrationRegenerateKeyParameter) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -159,7 +159,7 @@ func (client AgentRegistrationInformationClient) RegenerateKeyPreparer(ctx conte } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/agentRegistrationInformation/regenerateKey", pathParameters), 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..11a65b7c908b 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 @@ -31,31 +31,32 @@ type CertificateClient struct { } // NewCertificateClient creates an instance of the CertificateClient client. -func NewCertificateClient(subscriptionID string, resourceGroupName string) CertificateClient { - return NewCertificateClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) +func NewCertificateClient(subscriptionID string) CertificateClient { + return NewCertificateClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewCertificateClientWithBaseURI creates an instance of the CertificateClient client. -func NewCertificateClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) CertificateClient { - return CertificateClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} +func NewCertificateClientWithBaseURI(baseURI string, subscriptionID string) CertificateClient { + return CertificateClient{NewWithBaseURI(baseURI, subscriptionID)} } // 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. -func (client CertificateClient) CreateOrUpdate(ctx context.Context, automationAccountName string, certificateName string, parameters CertificateCreateOrUpdateParameters) (result Certificate, err error) { +// resourceGroupName is the resource group name. 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, resourceGroupName string, automationAccountName string, certificateName string, parameters CertificateCreateOrUpdateParameters) (result Certificate, 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: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, 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) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, certificateName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.CertificateClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -77,11 +78,11 @@ func (client CertificateClient) CreateOrUpdate(ctx context.Context, automationAc } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client CertificateClient) CreateOrUpdatePreparer(ctx context.Context, automationAccountName string, certificateName string, parameters CertificateCreateOrUpdateParameters) (*http.Request, error) { +func (client CertificateClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string, parameters CertificateCreateOrUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "certificateName": autorest.Encode("path", certificateName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -91,7 +92,7 @@ func (client CertificateClient) CreateOrUpdatePreparer(ctx context.Context, auto } 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.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}", pathParameters), @@ -122,15 +123,16 @@ func (client CertificateClient) CreateOrUpdateResponder(resp *http.Response) (re // Delete delete the certificate. // -// automationAccountName is the automation account name. certificateName is the name of certificate. -func (client CertificateClient) Delete(ctx context.Context, automationAccountName string, certificateName string) (result autorest.Response, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// certificateName is the name of certificate. +func (client CertificateClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName 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.CertificateClient", "Delete") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.CertificateClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, automationAccountName, certificateName) + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, certificateName) if err != nil { err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Delete", nil, "Failure preparing request") return @@ -152,11 +154,11 @@ func (client CertificateClient) Delete(ctx context.Context, automationAccountNam } // DeletePreparer prepares the Delete request. -func (client CertificateClient) DeletePreparer(ctx context.Context, automationAccountName string, certificateName string) (*http.Request, error) { +func (client CertificateClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "certificateName": autorest.Encode("path", certificateName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -194,15 +196,16 @@ func (client CertificateClient) DeleteResponder(resp *http.Response) (result aut // Get retrieve the certificate identified by certificate name. // -// automationAccountName is the automation account name. certificateName is the name of certificate. -func (client CertificateClient) Get(ctx context.Context, automationAccountName string, certificateName string) (result Certificate, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// certificateName is the name of certificate. +func (client CertificateClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string) (result Certificate, 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.CertificateClient", "Get") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.CertificateClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, automationAccountName, certificateName) + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, certificateName) if err != nil { err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Get", nil, "Failure preparing request") return @@ -224,11 +227,11 @@ func (client CertificateClient) Get(ctx context.Context, automationAccountName s } // GetPreparer prepares the Get request. -func (client CertificateClient) GetPreparer(ctx context.Context, automationAccountName string, certificateName string) (*http.Request, error) { +func (client CertificateClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "certificateName": autorest.Encode("path", certificateName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -267,16 +270,16 @@ func (client CertificateClient) GetResponder(resp *http.Response) (result Certif // ListByAutomationAccount retrieve a list of certificates. // -// automationAccountName is the automation account name. -func (client CertificateClient) ListByAutomationAccount(ctx context.Context, automationAccountName string) (result CertificateListResultPage, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +func (client CertificateClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result CertificateListResultPage, 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.CertificateClient", "ListByAutomationAccount") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.CertificateClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName) + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) if err != nil { err = autorest.NewErrorWithError(err, "automation.CertificateClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -298,10 +301,10 @@ func (client CertificateClient) ListByAutomationAccount(ctx context.Context, aut } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client CertificateClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string) (*http.Request, error) { +func (client CertificateClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -360,23 +363,24 @@ func (client CertificateClient) listByAutomationAccountNextResults(lastResults C } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client CertificateClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string) (result CertificateListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, automationAccountName) +func (client CertificateClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result CertificateListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) return } // Update update a certificate. // -// automationAccountName is the automation account name. certificateName is the parameters supplied to the update -// certificate operation. parameters is the parameters supplied to the update certificate operation. -func (client CertificateClient) Update(ctx context.Context, automationAccountName string, certificateName string, parameters CertificateUpdateParameters) (result Certificate, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// certificateName is the parameters supplied to the update certificate operation. parameters is the parameters +// supplied to the update certificate operation. +func (client CertificateClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string, parameters CertificateUpdateParameters) (result Certificate, 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.CertificateClient", "Update") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.CertificateClient", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, automationAccountName, certificateName, parameters) + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, certificateName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Update", nil, "Failure preparing request") return @@ -398,11 +402,11 @@ func (client CertificateClient) Update(ctx context.Context, automationAccountNam } // UpdatePreparer prepares the Update request. -func (client CertificateClient) UpdatePreparer(ctx context.Context, automationAccountName string, certificateName string, parameters CertificateUpdateParameters) (*http.Request, error) { +func (client CertificateClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string, parameters CertificateUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "certificateName": autorest.Encode("path", certificateName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -412,7 +416,7 @@ func (client CertificateClient) UpdatePreparer(ctx context.Context, automationAc } 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.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}", pathParameters), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/client.go index b66b006734a9..707fd618586a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/client.go @@ -32,22 +32,20 @@ const ( // BaseClient is the base client for Automation. type BaseClient struct { autorest.Client - BaseURI string - SubscriptionID string - ResourceGroupName string + BaseURI string + SubscriptionID string } // New creates an instance of the BaseClient client. -func New(subscriptionID string, resourceGroupName string) BaseClient { - return NewWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) } // NewWithBaseURI creates an instance of the BaseClient client. -func NewWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) BaseClient { +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return BaseClient{ - Client: autorest.NewClientWithUserAgent(UserAgent()), - BaseURI: baseURI, - SubscriptionID: subscriptionID, - ResourceGroupName: resourceGroupName, + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, } } 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..39287927d6eb 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 @@ -31,31 +31,32 @@ type ConnectionClient struct { } // NewConnectionClient creates an instance of the ConnectionClient client. -func NewConnectionClient(subscriptionID string, resourceGroupName string) ConnectionClient { - return NewConnectionClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) +func NewConnectionClient(subscriptionID string) ConnectionClient { + return NewConnectionClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewConnectionClientWithBaseURI creates an instance of the ConnectionClient client. -func NewConnectionClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) ConnectionClient { - return ConnectionClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} +func NewConnectionClientWithBaseURI(baseURI string, subscriptionID string) ConnectionClient { + return ConnectionClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate create or update a connection. // -// automationAccountName is the automation account name. connectionName is the parameters supplied to the create or -// update connection operation. parameters is the parameters supplied to the create or update connection operation. -func (client ConnectionClient) CreateOrUpdate(ctx context.Context, automationAccountName string, connectionName string, parameters ConnectionCreateOrUpdateParameters) (result Connection, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// connectionName is the parameters supplied to the create or update connection operation. parameters is the +// parameters supplied to the create or update connection operation. +func (client ConnectionClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string, parameters ConnectionCreateOrUpdateParameters) (result Connection, 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: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, 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) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, connectionName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -77,11 +78,11 @@ func (client ConnectionClient) CreateOrUpdate(ctx context.Context, automationAcc } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ConnectionClient) CreateOrUpdatePreparer(ctx context.Context, automationAccountName string, connectionName string, parameters ConnectionCreateOrUpdateParameters) (*http.Request, error) { +func (client ConnectionClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string, parameters ConnectionCreateOrUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -91,7 +92,7 @@ func (client ConnectionClient) CreateOrUpdatePreparer(ctx context.Context, autom } 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.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}", pathParameters), @@ -122,15 +123,16 @@ func (client ConnectionClient) CreateOrUpdateResponder(resp *http.Response) (res // Delete delete the connection. // -// automationAccountName is the automation account name. connectionName is the name of connection. -func (client ConnectionClient) Delete(ctx context.Context, automationAccountName string, connectionName string) (result Connection, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// connectionName is the name of connection. +func (client ConnectionClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string) (result Connection, 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.ConnectionClient", "Delete") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ConnectionClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, automationAccountName, connectionName) + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, connectionName) if err != nil { err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Delete", nil, "Failure preparing request") return @@ -152,11 +154,11 @@ func (client ConnectionClient) Delete(ctx context.Context, automationAccountName } // DeletePreparer prepares the Delete request. -func (client ConnectionClient) DeletePreparer(ctx context.Context, automationAccountName string, connectionName string) (*http.Request, error) { +func (client ConnectionClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -195,15 +197,16 @@ func (client ConnectionClient) DeleteResponder(resp *http.Response) (result Conn // Get retrieve the connection identified by connection name. // -// automationAccountName is the automation account name. connectionName is the name of connection. -func (client ConnectionClient) Get(ctx context.Context, automationAccountName string, connectionName string) (result Connection, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// connectionName is the name of connection. +func (client ConnectionClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string) (result Connection, 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.ConnectionClient", "Get") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ConnectionClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, automationAccountName, connectionName) + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, connectionName) if err != nil { err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Get", nil, "Failure preparing request") return @@ -225,11 +228,11 @@ func (client ConnectionClient) Get(ctx context.Context, automationAccountName st } // GetPreparer prepares the Get request. -func (client ConnectionClient) GetPreparer(ctx context.Context, automationAccountName string, connectionName string) (*http.Request, error) { +func (client ConnectionClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -268,16 +271,16 @@ func (client ConnectionClient) GetResponder(resp *http.Response) (result Connect // ListByAutomationAccount retrieve a list of connections. // -// automationAccountName is the automation account name. -func (client ConnectionClient) ListByAutomationAccount(ctx context.Context, automationAccountName string) (result ConnectionListResultPage, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +func (client ConnectionClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result ConnectionListResultPage, 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.ConnectionClient", "ListByAutomationAccount") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ConnectionClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName) + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) if err != nil { err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -299,10 +302,10 @@ func (client ConnectionClient) ListByAutomationAccount(ctx context.Context, auto } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client ConnectionClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string) (*http.Request, error) { +func (client ConnectionClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -361,23 +364,24 @@ func (client ConnectionClient) listByAutomationAccountNextResults(lastResults Co } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client ConnectionClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string) (result ConnectionListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, automationAccountName) +func (client ConnectionClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result ConnectionListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) return } // Update update a connection. // -// automationAccountName is the automation account name. connectionName is the parameters supplied to the update a -// connection operation. parameters is the parameters supplied to the update a connection operation. -func (client ConnectionClient) Update(ctx context.Context, automationAccountName string, connectionName string, parameters ConnectionUpdateParameters) (result Connection, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// connectionName is the parameters supplied to the update a connection operation. parameters is the parameters +// supplied to the update a connection operation. +func (client ConnectionClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string, parameters ConnectionUpdateParameters) (result Connection, 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.ConnectionClient", "Update") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ConnectionClient", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, automationAccountName, connectionName, parameters) + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, connectionName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Update", nil, "Failure preparing request") return @@ -399,11 +403,11 @@ func (client ConnectionClient) Update(ctx context.Context, automationAccountName } // UpdatePreparer prepares the Update request. -func (client ConnectionClient) UpdatePreparer(ctx context.Context, automationAccountName string, connectionName string, parameters ConnectionUpdateParameters) (*http.Request, error) { +func (client ConnectionClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string, parameters ConnectionUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -413,7 +417,7 @@ func (client ConnectionClient) UpdatePreparer(ctx context.Context, automationAcc } 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.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}", pathParameters), 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..a5ce642d08d0 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 @@ -31,32 +31,32 @@ type ConnectionTypeClient struct { } // NewConnectionTypeClient creates an instance of the ConnectionTypeClient client. -func NewConnectionTypeClient(subscriptionID string, resourceGroupName string) ConnectionTypeClient { - return NewConnectionTypeClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) +func NewConnectionTypeClient(subscriptionID string) ConnectionTypeClient { + return NewConnectionTypeClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewConnectionTypeClientWithBaseURI creates an instance of the ConnectionTypeClient client. -func NewConnectionTypeClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) ConnectionTypeClient { - return ConnectionTypeClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} +func NewConnectionTypeClientWithBaseURI(baseURI string, subscriptionID string) ConnectionTypeClient { + return ConnectionTypeClient{NewWithBaseURI(baseURI, subscriptionID)} } // 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. -func (client ConnectionTypeClient) CreateOrUpdate(ctx context.Context, automationAccountName string, connectionTypeName string, parameters ConnectionTypeCreateOrUpdateParameters) (result ConnectionType, err error) { +// resourceGroupName is the resource group name. 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, resourceGroupName string, automationAccountName string, connectionTypeName string, parameters ConnectionTypeCreateOrUpdateParameters) (result ConnectionType, 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: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, 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) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, connectionTypeName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -78,11 +78,11 @@ func (client ConnectionTypeClient) CreateOrUpdate(ctx context.Context, automatio } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ConnectionTypeClient) CreateOrUpdatePreparer(ctx context.Context, automationAccountName string, connectionTypeName string, parameters ConnectionTypeCreateOrUpdateParameters) (*http.Request, error) { +func (client ConnectionTypeClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string, parameters ConnectionTypeCreateOrUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "connectionTypeName": autorest.Encode("path", connectionTypeName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -92,7 +92,7 @@ func (client ConnectionTypeClient) CreateOrUpdatePreparer(ctx context.Context, a } 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.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}", pathParameters), @@ -123,15 +123,16 @@ func (client ConnectionTypeClient) CreateOrUpdateResponder(resp *http.Response) // Delete delete the connectiontype. // -// automationAccountName is the automation account name. connectionTypeName is the name of connectiontype. -func (client ConnectionTypeClient) Delete(ctx context.Context, automationAccountName string, connectionTypeName string) (result autorest.Response, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// connectionTypeName is the name of connectiontype. +func (client ConnectionTypeClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName 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.ConnectionTypeClient", "Delete") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ConnectionTypeClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, automationAccountName, connectionTypeName) + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, connectionTypeName) if err != nil { err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "Delete", nil, "Failure preparing request") return @@ -153,11 +154,11 @@ func (client ConnectionTypeClient) Delete(ctx context.Context, automationAccount } // DeletePreparer prepares the Delete request. -func (client ConnectionTypeClient) DeletePreparer(ctx context.Context, automationAccountName string, connectionTypeName string) (*http.Request, error) { +func (client ConnectionTypeClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "connectionTypeName": autorest.Encode("path", connectionTypeName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -195,15 +196,16 @@ func (client ConnectionTypeClient) DeleteResponder(resp *http.Response) (result // Get retrieve the connectiontype identified by connectiontype name. // -// automationAccountName is the automation account name. connectionTypeName is the name of connectiontype. -func (client ConnectionTypeClient) Get(ctx context.Context, automationAccountName string, connectionTypeName string) (result ConnectionType, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// connectionTypeName is the name of connectiontype. +func (client ConnectionTypeClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string) (result ConnectionType, 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.ConnectionTypeClient", "Get") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ConnectionTypeClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, automationAccountName, connectionTypeName) + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, connectionTypeName) if err != nil { err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "Get", nil, "Failure preparing request") return @@ -225,11 +227,11 @@ func (client ConnectionTypeClient) Get(ctx context.Context, automationAccountNam } // GetPreparer prepares the Get request. -func (client ConnectionTypeClient) GetPreparer(ctx context.Context, automationAccountName string, connectionTypeName string) (*http.Request, error) { +func (client ConnectionTypeClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "connectionTypeName": autorest.Encode("path", connectionTypeName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -268,16 +270,16 @@ func (client ConnectionTypeClient) GetResponder(resp *http.Response) (result Con // ListByAutomationAccount retrieve a list of connectiontypes. // -// automationAccountName is the automation account name. -func (client ConnectionTypeClient) ListByAutomationAccount(ctx context.Context, automationAccountName string) (result ConnectionTypeListResultPage, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +func (client ConnectionTypeClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result ConnectionTypeListResultPage, 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.ConnectionTypeClient", "ListByAutomationAccount") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ConnectionTypeClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName) + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) if err != nil { err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -299,10 +301,10 @@ func (client ConnectionTypeClient) ListByAutomationAccount(ctx context.Context, } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client ConnectionTypeClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string) (*http.Request, error) { +func (client ConnectionTypeClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -361,7 +363,7 @@ func (client ConnectionTypeClient) listByAutomationAccountNextResults(lastResult } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client ConnectionTypeClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string) (result ConnectionTypeListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, automationAccountName) +func (client ConnectionTypeClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result ConnectionTypeListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) return } 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..11f696368414 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 @@ -31,33 +31,34 @@ type CredentialClient struct { } // NewCredentialClient creates an instance of the CredentialClient client. -func NewCredentialClient(subscriptionID string, resourceGroupName string) CredentialClient { - return NewCredentialClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) +func NewCredentialClient(subscriptionID string) CredentialClient { + return NewCredentialClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewCredentialClientWithBaseURI creates an instance of the CredentialClient client. -func NewCredentialClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) CredentialClient { - return CredentialClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} +func NewCredentialClientWithBaseURI(baseURI string, subscriptionID string) CredentialClient { + return CredentialClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate create a credential. // -// automationAccountName is the automation account name. credentialName is the parameters supplied to the create or -// update credential operation. parameters is the parameters supplied to the create or update credential operation. -func (client CredentialClient) CreateOrUpdate(ctx context.Context, automationAccountName string, credentialName string, parameters CredentialCreateOrUpdateParameters) (result Credential, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// credentialName is the parameters supplied to the create or update credential operation. parameters is the +// parameters supplied to the create or update credential operation. +func (client CredentialClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string, parameters CredentialCreateOrUpdateParameters) (result Credential, 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: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.CredentialCreateOrUpdateProperties", Name: validation.Null, Rule: true, 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) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, credentialName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.CredentialClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -79,11 +80,11 @@ func (client CredentialClient) CreateOrUpdate(ctx context.Context, automationAcc } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client CredentialClient) CreateOrUpdatePreparer(ctx context.Context, automationAccountName string, credentialName string, parameters CredentialCreateOrUpdateParameters) (*http.Request, error) { +func (client CredentialClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string, parameters CredentialCreateOrUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "credentialName": autorest.Encode("path", credentialName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -93,7 +94,7 @@ func (client CredentialClient) CreateOrUpdatePreparer(ctx context.Context, autom } 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.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}", pathParameters), @@ -124,15 +125,16 @@ func (client CredentialClient) CreateOrUpdateResponder(resp *http.Response) (res // Delete delete the credential. // -// automationAccountName is the automation account name. credentialName is the name of credential. -func (client CredentialClient) Delete(ctx context.Context, automationAccountName string, credentialName string) (result autorest.Response, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// credentialName is the name of credential. +func (client CredentialClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName 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.CredentialClient", "Delete") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.CredentialClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, automationAccountName, credentialName) + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, credentialName) if err != nil { err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Delete", nil, "Failure preparing request") return @@ -154,11 +156,11 @@ func (client CredentialClient) Delete(ctx context.Context, automationAccountName } // DeletePreparer prepares the Delete request. -func (client CredentialClient) DeletePreparer(ctx context.Context, automationAccountName string, credentialName string) (*http.Request, error) { +func (client CredentialClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "credentialName": autorest.Encode("path", credentialName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -196,15 +198,16 @@ func (client CredentialClient) DeleteResponder(resp *http.Response) (result auto // Get retrieve the credential identified by credential name. // -// automationAccountName is the automation account name. credentialName is the name of credential. -func (client CredentialClient) Get(ctx context.Context, automationAccountName string, credentialName string) (result Credential, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// credentialName is the name of credential. +func (client CredentialClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string) (result Credential, 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.CredentialClient", "Get") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.CredentialClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, automationAccountName, credentialName) + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, credentialName) if err != nil { err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Get", nil, "Failure preparing request") return @@ -226,11 +229,11 @@ func (client CredentialClient) Get(ctx context.Context, automationAccountName st } // GetPreparer prepares the Get request. -func (client CredentialClient) GetPreparer(ctx context.Context, automationAccountName string, credentialName string) (*http.Request, error) { +func (client CredentialClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "credentialName": autorest.Encode("path", credentialName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -269,16 +272,16 @@ func (client CredentialClient) GetResponder(resp *http.Response) (result Credent // ListByAutomationAccount retrieve a list of credentials. // -// automationAccountName is the automation account name. -func (client CredentialClient) ListByAutomationAccount(ctx context.Context, automationAccountName string) (result CredentialListResultPage, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +func (client CredentialClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result CredentialListResultPage, 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.CredentialClient", "ListByAutomationAccount") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.CredentialClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName) + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) if err != nil { err = autorest.NewErrorWithError(err, "automation.CredentialClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -300,10 +303,10 @@ func (client CredentialClient) ListByAutomationAccount(ctx context.Context, auto } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client CredentialClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string) (*http.Request, error) { +func (client CredentialClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -362,23 +365,24 @@ func (client CredentialClient) listByAutomationAccountNextResults(lastResults Cr } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client CredentialClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string) (result CredentialListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, automationAccountName) +func (client CredentialClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result CredentialListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) return } // Update update a credential. // -// automationAccountName is the automation account name. credentialName is the parameters supplied to the Update -// credential operation. parameters is the parameters supplied to the Update credential operation. -func (client CredentialClient) Update(ctx context.Context, automationAccountName string, credentialName string, parameters CredentialUpdateParameters) (result Credential, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// credentialName is the parameters supplied to the Update credential operation. parameters is the parameters +// supplied to the Update credential operation. +func (client CredentialClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string, parameters CredentialUpdateParameters) (result Credential, 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.CredentialClient", "Update") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.CredentialClient", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, automationAccountName, credentialName, parameters) + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, credentialName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Update", nil, "Failure preparing request") return @@ -400,11 +404,11 @@ func (client CredentialClient) Update(ctx context.Context, automationAccountName } // UpdatePreparer prepares the Update request. -func (client CredentialClient) UpdatePreparer(ctx context.Context, automationAccountName string, credentialName string, parameters CredentialUpdateParameters) (*http.Request, error) { +func (client CredentialClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string, parameters CredentialUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "credentialName": autorest.Encode("path", credentialName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -414,7 +418,7 @@ func (client CredentialClient) UpdatePreparer(ctx context.Context, automationAcc } 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.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}", pathParameters), 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..148d7c66aebb 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 @@ -32,30 +32,31 @@ type DscCompilationJobClient struct { } // NewDscCompilationJobClient creates an instance of the DscCompilationJobClient client. -func NewDscCompilationJobClient(subscriptionID string, resourceGroupName string) DscCompilationJobClient { - return NewDscCompilationJobClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) +func NewDscCompilationJobClient(subscriptionID string) DscCompilationJobClient { + return NewDscCompilationJobClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewDscCompilationJobClientWithBaseURI creates an instance of the DscCompilationJobClient client. -func NewDscCompilationJobClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) DscCompilationJobClient { - return DscCompilationJobClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} +func NewDscCompilationJobClientWithBaseURI(baseURI string, subscriptionID string) DscCompilationJobClient { + return DscCompilationJobClient{NewWithBaseURI(baseURI, subscriptionID)} } // 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. -func (client DscCompilationJobClient) Create(ctx context.Context, automationAccountName string, compilationJobID uuid.UUID, parameters DscCompilationJobCreateParameters) (result DscCompilationJob, err error) { +// resourceGroupName is the resource group name. 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, resourceGroupName string, automationAccountName string, compilationJobID uuid.UUID, parameters DscCompilationJobCreateParameters) (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}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {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) + req, err := client.CreatePreparer(ctx, resourceGroupName, automationAccountName, compilationJobID, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "Create", nil, "Failure preparing request") return @@ -77,11 +78,11 @@ func (client DscCompilationJobClient) Create(ctx context.Context, automationAcco } // CreatePreparer prepares the Create request. -func (client DscCompilationJobClient) CreatePreparer(ctx context.Context, automationAccountName string, compilationJobID uuid.UUID, parameters DscCompilationJobCreateParameters) (*http.Request, error) { +func (client DscCompilationJobClient) CreatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, compilationJobID uuid.UUID, parameters DscCompilationJobCreateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "compilationJobId": autorest.Encode("path", compilationJobID), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -91,7 +92,7 @@ func (client DscCompilationJobClient) CreatePreparer(ctx context.Context, automa } 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.Automation/automationAccounts/{automationAccountName}/compilationjobs/{compilationJobId}", pathParameters), @@ -122,15 +123,16 @@ 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. -func (client DscCompilationJobClient) Get(ctx context.Context, automationAccountName string, compilationJobID uuid.UUID) (result DscCompilationJob, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// compilationJobID is the Dsc configuration compilation job id. +func (client DscCompilationJobClient) Get(ctx context.Context, resourceGroupName string, 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") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscCompilationJobClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, automationAccountName, compilationJobID) + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, compilationJobID) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "Get", nil, "Failure preparing request") return @@ -152,11 +154,11 @@ func (client DscCompilationJobClient) Get(ctx context.Context, automationAccount } // GetPreparer prepares the Get request. -func (client DscCompilationJobClient) GetPreparer(ctx context.Context, automationAccountName string, compilationJobID uuid.UUID) (*http.Request, error) { +func (client DscCompilationJobClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, compilationJobID uuid.UUID) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "compilationJobId": autorest.Encode("path", compilationJobID), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -195,15 +197,16 @@ func (client DscCompilationJobClient) GetResponder(resp *http.Response) (result // GetStream retrieve the job stream identified by job stream id. // -// automationAccountName is the automation account name. jobID is the job id. jobStreamID is the job stream id. -func (client DscCompilationJobClient) GetStream(ctx context.Context, automationAccountName string, jobID uuid.UUID, jobStreamID string) (result JobStream, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. jobID is the +// job id. jobStreamID is the job stream id. +func (client DscCompilationJobClient) GetStream(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID, 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.DscCompilationJobClient", "GetStream") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscCompilationJobClient", "GetStream", err.Error()) } - req, err := client.GetStreamPreparer(ctx, automationAccountName, jobID, jobStreamID) + req, err := client.GetStreamPreparer(ctx, resourceGroupName, automationAccountName, jobID, jobStreamID) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "GetStream", nil, "Failure preparing request") return @@ -225,12 +228,12 @@ func (client DscCompilationJobClient) GetStream(ctx context.Context, automationA } // GetStreamPreparer prepares the GetStream request. -func (client DscCompilationJobClient) GetStreamPreparer(ctx context.Context, automationAccountName string, jobID uuid.UUID, jobStreamID string) (*http.Request, error) { +func (client DscCompilationJobClient) GetStreamPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID, jobStreamID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "jobId": autorest.Encode("path", jobID), "jobStreamId": autorest.Encode("path", jobStreamID), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -269,16 +272,17 @@ func (client DscCompilationJobClient) GetStreamResponder(resp *http.Response) (r // ListByAutomationAccount retrieve a list of dsc compilation jobs. // -// automationAccountName is the automation account name. filter is the filter to apply on the operation. -func (client DscCompilationJobClient) ListByAutomationAccount(ctx context.Context, automationAccountName string, filter string) (result DscCompilationJobListResultPage, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. filter is +// the filter to apply on the operation. +func (client DscCompilationJobClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result DscCompilationJobListResultPage, 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", "ListByAutomationAccount") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscCompilationJobClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName, filter) + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -300,10 +304,10 @@ func (client DscCompilationJobClient) ListByAutomationAccount(ctx context.Contex } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client DscCompilationJobClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string, filter string) (*http.Request, error) { +func (client DscCompilationJobClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -365,7 +369,7 @@ func (client DscCompilationJobClient) listByAutomationAccountNextResults(lastRes } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client DscCompilationJobClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string, filter string) (result DscCompilationJobListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, automationAccountName, filter) +func (client DscCompilationJobClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result DscCompilationJobListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dsccompilationjobstream.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dsccompilationjobstream.go new file mode 100644 index 000000000000..6e103018fe4c --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dsccompilationjobstream.go @@ -0,0 +1,116 @@ +package automation + +// 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" + "github.com/satori/go.uuid" + "net/http" +) + +// DscCompilationJobStreamClient is the automation Client +type DscCompilationJobStreamClient struct { + BaseClient +} + +// NewDscCompilationJobStreamClient creates an instance of the DscCompilationJobStreamClient client. +func NewDscCompilationJobStreamClient(subscriptionID string) DscCompilationJobStreamClient { + return NewDscCompilationJobStreamClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDscCompilationJobStreamClientWithBaseURI creates an instance of the DscCompilationJobStreamClient client. +func NewDscCompilationJobStreamClientWithBaseURI(baseURI string, subscriptionID string) DscCompilationJobStreamClient { + return DscCompilationJobStreamClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByJob retrieve all the job streams for the compilation Job. +// +// resourceGroupName is the resource group name. automationAccountName is the automation account name. jobID is the +// job id. +func (client DscCompilationJobStreamClient) ListByJob(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (result JobStreamListResult, 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.NewError("automation.DscCompilationJobStreamClient", "ListByJob", err.Error()) + } + + req, err := client.ListByJobPreparer(ctx, resourceGroupName, automationAccountName, jobID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobStreamClient", "ListByJob", nil, "Failure preparing request") + return + } + + resp, err := client.ListByJobSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobStreamClient", "ListByJob", resp, "Failure sending request") + return + } + + result, err = client.ListByJobResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobStreamClient", "ListByJob", resp, "Failure responding to request") + } + + return +} + +// ListByJobPreparer prepares the ListByJob request. +func (client DscCompilationJobStreamClient) ListByJobPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobId": autorest.Encode("path", jobID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{jobId}/streams/", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByJobSender sends the ListByJob request. The method will close the +// http.Response Body if it receives an error. +func (client DscCompilationJobStreamClient) ListByJobSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByJobResponder handles the response to the ListByJob request. The method always +// closes the http.Response Body. +func (client DscCompilationJobStreamClient) ListByJobResponder(resp *http.Response) (result JobStreamListResult, 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/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..87d1abc507ae 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 @@ -31,23 +31,24 @@ type DscConfigurationClient struct { } // NewDscConfigurationClient creates an instance of the DscConfigurationClient client. -func NewDscConfigurationClient(subscriptionID string, resourceGroupName string) DscConfigurationClient { - return NewDscConfigurationClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) +func NewDscConfigurationClient(subscriptionID string) DscConfigurationClient { + return NewDscConfigurationClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewDscConfigurationClientWithBaseURI creates an instance of the DscConfigurationClient client. -func NewDscConfigurationClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) DscConfigurationClient { - return DscConfigurationClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} +func NewDscConfigurationClientWithBaseURI(baseURI string, subscriptionID string) DscConfigurationClient { + return DscConfigurationClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate create the configuration identified by configuration name. // -// automationAccountName is the automation account name. configurationName is the create or update parameters for -// configuration. parameters is the create or update parameters for configuration. -func (client DscConfigurationClient) CreateOrUpdate(ctx context.Context, automationAccountName string, configurationName string, parameters DscConfigurationCreateOrUpdateParameters) (result DscConfiguration, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// configurationName is the create or update parameters for configuration. parameters is the create or update +// parameters for configuration. +func (client DscConfigurationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string, parameters DscConfigurationCreateOrUpdateParameters) (result DscConfiguration, 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: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.DscConfigurationCreateOrUpdateProperties", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.DscConfigurationCreateOrUpdateProperties.Source", Name: validation.Null, Rule: true, @@ -57,10 +58,10 @@ 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) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, configurationName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -82,11 +83,11 @@ func (client DscConfigurationClient) CreateOrUpdate(ctx context.Context, automat } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DscConfigurationClient) CreateOrUpdatePreparer(ctx context.Context, automationAccountName string, configurationName string, parameters DscConfigurationCreateOrUpdateParameters) (*http.Request, error) { +func (client DscConfigurationClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string, parameters DscConfigurationCreateOrUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "configurationName": autorest.Encode("path", configurationName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -96,7 +97,7 @@ func (client DscConfigurationClient) CreateOrUpdatePreparer(ctx context.Context, } 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.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}", pathParameters), @@ -127,15 +128,16 @@ func (client DscConfigurationClient) CreateOrUpdateResponder(resp *http.Response // Delete delete the dsc configuration identified by configuration name. // -// automationAccountName is the automation account name. configurationName is the configuration name. -func (client DscConfigurationClient) Delete(ctx context.Context, automationAccountName string, configurationName string) (result autorest.Response, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// configurationName is the configuration name. +func (client DscConfigurationClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName 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.DscConfigurationClient", "Delete") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscConfigurationClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, automationAccountName, configurationName) + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, configurationName) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Delete", nil, "Failure preparing request") return @@ -157,11 +159,11 @@ func (client DscConfigurationClient) Delete(ctx context.Context, automationAccou } // DeletePreparer prepares the Delete request. -func (client DscConfigurationClient) DeletePreparer(ctx context.Context, automationAccountName string, configurationName string) (*http.Request, error) { +func (client DscConfigurationClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "configurationName": autorest.Encode("path", configurationName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -199,15 +201,16 @@ func (client DscConfigurationClient) DeleteResponder(resp *http.Response) (resul // Get retrieve the configuration identified by configuration name. // -// automationAccountName is the automation account name. configurationName is the configuration name. -func (client DscConfigurationClient) Get(ctx context.Context, automationAccountName string, configurationName string) (result DscConfiguration, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// configurationName is the configuration name. +func (client DscConfigurationClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (result DscConfiguration, 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.DscConfigurationClient", "Get") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscConfigurationClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, automationAccountName, configurationName) + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, configurationName) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Get", nil, "Failure preparing request") return @@ -229,11 +232,11 @@ func (client DscConfigurationClient) Get(ctx context.Context, automationAccountN } // GetPreparer prepares the Get request. -func (client DscConfigurationClient) GetPreparer(ctx context.Context, automationAccountName string, configurationName string) (*http.Request, error) { +func (client DscConfigurationClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "configurationName": autorest.Encode("path", configurationName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -272,15 +275,16 @@ func (client DscConfigurationClient) GetResponder(resp *http.Response) (result D // GetContent retrieve the configuration script identified by configuration name. // -// automationAccountName is the automation account name. configurationName is the configuration name. -func (client DscConfigurationClient) GetContent(ctx context.Context, automationAccountName string, configurationName string) (result ReadCloser, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// configurationName is the configuration name. +func (client DscConfigurationClient) GetContent(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (result String, 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.DscConfigurationClient", "GetContent") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscConfigurationClient", "GetContent", err.Error()) } - req, err := client.GetContentPreparer(ctx, automationAccountName, configurationName) + req, err := client.GetContentPreparer(ctx, resourceGroupName, automationAccountName, configurationName) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "GetContent", nil, "Failure preparing request") return @@ -302,11 +306,11 @@ func (client DscConfigurationClient) GetContent(ctx context.Context, automationA } // GetContentPreparer prepares the GetContent request. -func (client DscConfigurationClient) GetContentPreparer(ctx context.Context, automationAccountName string, configurationName string) (*http.Request, error) { +func (client DscConfigurationClient) GetContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "configurationName": autorest.Encode("path", configurationName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -332,28 +336,29 @@ func (client DscConfigurationClient) GetContentSender(req *http.Request) (*http. // GetContentResponder handles the response to the GetContent request. The method always // closes the http.Response Body. -func (client DscConfigurationClient) GetContentResponder(resp *http.Response) (result ReadCloser, err error) { - result.Value = &resp.Body +func (client DscConfigurationClient) GetContentResponder(resp *http.Response) (result String, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK)) + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // ListByAutomationAccount retrieve a list of configurations. // -// automationAccountName is the automation account name. -func (client DscConfigurationClient) ListByAutomationAccount(ctx context.Context, automationAccountName string) (result DscConfigurationListResultPage, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +func (client DscConfigurationClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result DscConfigurationListResultPage, 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.DscConfigurationClient", "ListByAutomationAccount") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscConfigurationClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName) + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -375,10 +380,10 @@ func (client DscConfigurationClient) ListByAutomationAccount(ctx context.Context } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client DscConfigurationClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string) (*http.Request, error) { +func (client DscConfigurationClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -437,7 +442,86 @@ func (client DscConfigurationClient) listByAutomationAccountNextResults(lastResu } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client DscConfigurationClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string) (result DscConfigurationListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, automationAccountName) +func (client DscConfigurationClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result DscConfigurationListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) + return +} + +// Update create the configuration identified by configuration name. +// +// automationAccountName is the automation account name. configurationName is the create or update parameters for +// configuration. parameters is the create or update parameters for configuration. +func (client DscConfigurationClient) Update(ctx context.Context, automationAccountName string, configurationName string, parameters *DscConfigurationUpdateParameters) (result DscConfiguration, 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.NewError("automation.DscConfigurationClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, automationAccountName, configurationName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client DscConfigurationClient) UpdatePreparer(ctx context.Context, automationAccountName string, configurationName string, parameters *DscConfigurationUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "configurationName": autorest.Encode("path", configurationName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + 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.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if parameters != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(parameters)) + } + 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 DscConfigurationClient) 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 DscConfigurationClient) UpdateResponder(resp *http.Response) (result DscConfiguration, 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/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..a51206bccabe 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 @@ -31,26 +31,27 @@ type DscNodeClient struct { } // NewDscNodeClient creates an instance of the DscNodeClient client. -func NewDscNodeClient(subscriptionID string, resourceGroupName string) DscNodeClient { - return NewDscNodeClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) +func NewDscNodeClient(subscriptionID string) DscNodeClient { + return NewDscNodeClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewDscNodeClientWithBaseURI creates an instance of the DscNodeClient client. -func NewDscNodeClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) DscNodeClient { - return DscNodeClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} +func NewDscNodeClientWithBaseURI(baseURI string, subscriptionID string) DscNodeClient { + return DscNodeClient{NewWithBaseURI(baseURI, subscriptionID)} } // Delete delete the dsc node identified by node id. // -// automationAccountName is automation account name. nodeID is the node id. -func (client DscNodeClient) Delete(ctx context.Context, automationAccountName string, nodeID string) (result DscNode, err error) { +// resourceGroupName is the resource group name. automationAccountName is automation account name. nodeID is the +// node id. +func (client DscNodeClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string) (result DscNode, 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.DscNodeClient", "Delete") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscNodeClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, automationAccountName, nodeID) + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, nodeID) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Delete", nil, "Failure preparing request") return @@ -72,11 +73,11 @@ func (client DscNodeClient) Delete(ctx context.Context, automationAccountName st } // DeletePreparer prepares the Delete request. -func (client DscNodeClient) DeletePreparer(ctx context.Context, automationAccountName string, nodeID string) (*http.Request, error) { +func (client DscNodeClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "nodeId": autorest.Encode("path", nodeID), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -115,15 +116,16 @@ func (client DscNodeClient) DeleteResponder(resp *http.Response) (result DscNode // Get retrieve the dsc node identified by node id. // -// automationAccountName is the automation account name. nodeID is the node id. -func (client DscNodeClient) Get(ctx context.Context, automationAccountName string, nodeID string) (result DscNode, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. nodeID is +// the node id. +func (client DscNodeClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string) (result DscNode, 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.DscNodeClient", "Get") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscNodeClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, automationAccountName, nodeID) + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, nodeID) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Get", nil, "Failure preparing request") return @@ -145,11 +147,11 @@ func (client DscNodeClient) Get(ctx context.Context, automationAccountName strin } // GetPreparer prepares the Get request. -func (client DscNodeClient) GetPreparer(ctx context.Context, automationAccountName string, nodeID string) (*http.Request, error) { +func (client DscNodeClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "nodeId": autorest.Encode("path", nodeID), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -188,16 +190,17 @@ func (client DscNodeClient) GetResponder(resp *http.Response) (result DscNode, e // ListByAutomationAccount retrieve a list of dsc nodes. // -// automationAccountName is the automation account name. filter is the filter to apply on the operation. -func (client DscNodeClient) ListByAutomationAccount(ctx context.Context, automationAccountName string, filter string) (result DscNodeListResultPage, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. filter is +// the filter to apply on the operation. +func (client DscNodeClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result DscNodeListResultPage, 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.DscNodeClient", "ListByAutomationAccount") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscNodeClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName, filter) + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -219,10 +222,10 @@ func (client DscNodeClient) ListByAutomationAccount(ctx context.Context, automat } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client DscNodeClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string, filter string) (*http.Request, error) { +func (client DscNodeClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -284,23 +287,23 @@ func (client DscNodeClient) listByAutomationAccountNextResults(lastResults DscNo } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client DscNodeClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string, filter string) (result DscNodeListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, automationAccountName, filter) +func (client DscNodeClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result DscNodeListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) return } // Update update the dsc node. // -// automationAccountName is the automation account name. nodeID is parameters supplied to the update dsc node. -// parameters is parameters supplied to the update dsc node. -func (client DscNodeClient) Update(ctx context.Context, automationAccountName string, nodeID string, parameters DscNodeUpdateParameters) (result DscNode, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. nodeID is +// parameters supplied to the update dsc node. parameters is parameters supplied to the update dsc node. +func (client DscNodeClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, parameters DscNodeUpdateParameters) (result DscNode, 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.DscNodeClient", "Update") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscNodeClient", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, automationAccountName, nodeID, parameters) + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, nodeID, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Update", nil, "Failure preparing request") return @@ -322,11 +325,11 @@ func (client DscNodeClient) Update(ctx context.Context, automationAccountName st } // UpdatePreparer prepares the Update request. -func (client DscNodeClient) UpdatePreparer(ctx context.Context, automationAccountName string, nodeID string, parameters DscNodeUpdateParameters) (*http.Request, error) { +func (client DscNodeClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, parameters DscNodeUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "nodeId": autorest.Encode("path", nodeID), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -336,7 +339,7 @@ func (client DscNodeClient) UpdatePreparer(ctx context.Context, automationAccoun } 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.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}", pathParameters), 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..e2684c9b1552 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 @@ -31,23 +31,24 @@ type DscNodeConfigurationClient struct { } // NewDscNodeConfigurationClient creates an instance of the DscNodeConfigurationClient client. -func NewDscNodeConfigurationClient(subscriptionID string, resourceGroupName string) DscNodeConfigurationClient { - return NewDscNodeConfigurationClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) +func NewDscNodeConfigurationClient(subscriptionID string) DscNodeConfigurationClient { + return NewDscNodeConfigurationClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewDscNodeConfigurationClientWithBaseURI creates an instance of the DscNodeConfigurationClient client. -func NewDscNodeConfigurationClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) DscNodeConfigurationClient { - return DscNodeConfigurationClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} +func NewDscNodeConfigurationClientWithBaseURI(baseURI string, subscriptionID string) DscNodeConfigurationClient { + return DscNodeConfigurationClient{NewWithBaseURI(baseURI, subscriptionID)} } // 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. -func (client DscNodeConfigurationClient) CreateOrUpdate(ctx context.Context, automationAccountName string, nodeConfigurationName string, parameters DscNodeConfigurationCreateOrUpdateParameters) (result DscNodeConfiguration, err error) { +// resourceGroupName is the resource group 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. +func (client DscNodeConfigurationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string, parameters DscNodeConfigurationCreateOrUpdateParameters) (result DscNodeConfiguration, 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: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Source", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.Source.Hash", Name: validation.Null, Rule: false, @@ -57,10 +58,10 @@ 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) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, nodeConfigurationName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -82,11 +83,11 @@ func (client DscNodeConfigurationClient) CreateOrUpdate(ctx context.Context, aut } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DscNodeConfigurationClient) CreateOrUpdatePreparer(ctx context.Context, automationAccountName string, nodeConfigurationName string, parameters DscNodeConfigurationCreateOrUpdateParameters) (*http.Request, error) { +func (client DscNodeConfigurationClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string, parameters DscNodeConfigurationCreateOrUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "nodeConfigurationName": autorest.Encode("path", nodeConfigurationName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -96,7 +97,7 @@ func (client DscNodeConfigurationClient) CreateOrUpdatePreparer(ctx context.Cont } 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.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}", pathParameters), @@ -118,7 +119,7 @@ func (client DscNodeConfigurationClient) CreateOrUpdateResponder(resp *http.Resp err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} @@ -127,15 +128,16 @@ func (client DscNodeConfigurationClient) CreateOrUpdateResponder(resp *http.Resp // Delete delete the Dsc node configurations by node configuration. // -// automationAccountName is the automation account name. nodeConfigurationName is the Dsc node configuration name. -func (client DscNodeConfigurationClient) Delete(ctx context.Context, automationAccountName string, nodeConfigurationName string) (result autorest.Response, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// nodeConfigurationName is the Dsc node configuration name. +func (client DscNodeConfigurationClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName 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.DscNodeConfigurationClient", "Delete") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscNodeConfigurationClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, automationAccountName, nodeConfigurationName) + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, nodeConfigurationName) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "Delete", nil, "Failure preparing request") return @@ -157,11 +159,11 @@ func (client DscNodeConfigurationClient) Delete(ctx context.Context, automationA } // DeletePreparer prepares the Delete request. -func (client DscNodeConfigurationClient) DeletePreparer(ctx context.Context, automationAccountName string, nodeConfigurationName string) (*http.Request, error) { +func (client DscNodeConfigurationClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "nodeConfigurationName": autorest.Encode("path", nodeConfigurationName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -199,15 +201,16 @@ func (client DscNodeConfigurationClient) DeleteResponder(resp *http.Response) (r // Get retrieve the Dsc node configurations by node configuration. // -// automationAccountName is the automation account name. nodeConfigurationName is the Dsc node configuration name. -func (client DscNodeConfigurationClient) Get(ctx context.Context, automationAccountName string, nodeConfigurationName string) (result DscNodeConfiguration, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// nodeConfigurationName is the Dsc node configuration name. +func (client DscNodeConfigurationClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string) (result DscNodeConfiguration, 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.DscNodeConfigurationClient", "Get") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscNodeConfigurationClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, automationAccountName, nodeConfigurationName) + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, nodeConfigurationName) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "Get", nil, "Failure preparing request") return @@ -229,11 +232,11 @@ func (client DscNodeConfigurationClient) Get(ctx context.Context, automationAcco } // GetPreparer prepares the Get request. -func (client DscNodeConfigurationClient) GetPreparer(ctx context.Context, automationAccountName string, nodeConfigurationName string) (*http.Request, error) { +func (client DscNodeConfigurationClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "nodeConfigurationName": autorest.Encode("path", nodeConfigurationName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -272,16 +275,17 @@ func (client DscNodeConfigurationClient) GetResponder(resp *http.Response) (resu // ListByAutomationAccount retrieve a list of dsc node configurations. // -// automationAccountName is the automation account name. filter is the filter to apply on the operation. -func (client DscNodeConfigurationClient) ListByAutomationAccount(ctx context.Context, automationAccountName string, filter string) (result DscNodeConfigurationListResultPage, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. filter is +// the filter to apply on the operation. +func (client DscNodeConfigurationClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result DscNodeConfigurationListResultPage, 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.DscNodeConfigurationClient", "ListByAutomationAccount") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscNodeConfigurationClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName, filter) + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -303,10 +307,10 @@ func (client DscNodeConfigurationClient) ListByAutomationAccount(ctx context.Con } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client DscNodeConfigurationClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string, filter string) (*http.Request, error) { +func (client DscNodeConfigurationClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -368,7 +372,7 @@ func (client DscNodeConfigurationClient) listByAutomationAccountNextResults(last } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client DscNodeConfigurationClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string, filter string) (result DscNodeConfigurationListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, automationAccountName, filter) +func (client DscNodeConfigurationClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result DscNodeConfigurationListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) return } 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..756ad090d914 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 @@ -31,27 +31,27 @@ type FieldsClient struct { } // NewFieldsClient creates an instance of the FieldsClient client. -func NewFieldsClient(subscriptionID string, resourceGroupName string) FieldsClient { - return NewFieldsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) +func NewFieldsClient(subscriptionID string) FieldsClient { + return NewFieldsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewFieldsClientWithBaseURI creates an instance of the FieldsClient client. -func NewFieldsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) FieldsClient { - return FieldsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} +func NewFieldsClientWithBaseURI(baseURI string, subscriptionID string) FieldsClient { + return FieldsClient{NewWithBaseURI(baseURI, subscriptionID)} } // ListByType retrieve a list of fields of a given type identified by module name. // -// automationAccountName is the automation account name. moduleName is the name of module. typeName is the name of -// type. -func (client FieldsClient) ListByType(ctx context.Context, automationAccountName string, moduleName string, typeName string) (result TypeFieldListResult, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. moduleName +// is the name of module. typeName is the name of type. +func (client FieldsClient) ListByType(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, typeName string) (result TypeFieldListResult, 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.FieldsClient", "ListByType") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.FieldsClient", "ListByType", err.Error()) } - req, err := client.ListByTypePreparer(ctx, automationAccountName, moduleName, typeName) + req, err := client.ListByTypePreparer(ctx, resourceGroupName, automationAccountName, moduleName, typeName) if err != nil { err = autorest.NewErrorWithError(err, "automation.FieldsClient", "ListByType", nil, "Failure preparing request") return @@ -73,11 +73,11 @@ func (client FieldsClient) ListByType(ctx context.Context, automationAccountName } // ListByTypePreparer prepares the ListByType request. -func (client FieldsClient) ListByTypePreparer(ctx context.Context, automationAccountName string, moduleName string, typeName string) (*http.Request, error) { +func (client FieldsClient) ListByTypePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, typeName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "moduleName": autorest.Encode("path", moduleName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "typeName": autorest.Encode("path", 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..d480a44178ce 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 @@ -31,27 +31,27 @@ type HybridRunbookWorkerGroupClient struct { } // NewHybridRunbookWorkerGroupClient creates an instance of the HybridRunbookWorkerGroupClient client. -func NewHybridRunbookWorkerGroupClient(subscriptionID string, resourceGroupName string) HybridRunbookWorkerGroupClient { - return NewHybridRunbookWorkerGroupClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) +func NewHybridRunbookWorkerGroupClient(subscriptionID string) HybridRunbookWorkerGroupClient { + return NewHybridRunbookWorkerGroupClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewHybridRunbookWorkerGroupClientWithBaseURI creates an instance of the HybridRunbookWorkerGroupClient client. -func NewHybridRunbookWorkerGroupClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) HybridRunbookWorkerGroupClient { - return HybridRunbookWorkerGroupClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} +func NewHybridRunbookWorkerGroupClientWithBaseURI(baseURI string, subscriptionID string) HybridRunbookWorkerGroupClient { + return HybridRunbookWorkerGroupClient{NewWithBaseURI(baseURI, subscriptionID)} } // Delete delete a hybrid runbook worker group. // -// 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) { +// resourceGroupName is the resource group name. automationAccountName is automation account name. +// hybridRunbookWorkerGroupName is the hybrid runbook worker group name +func (client HybridRunbookWorkerGroupClient) Delete(ctx context.Context, resourceGroupName string, 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") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.HybridRunbookWorkerGroupClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, automationAccountName, hybridRunbookWorkerGroupName) + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName) if err != nil { err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Delete", nil, "Failure preparing request") return @@ -73,11 +73,11 @@ func (client HybridRunbookWorkerGroupClient) Delete(ctx context.Context, automat } // DeletePreparer prepares the Delete request. -func (client HybridRunbookWorkerGroupClient) DeletePreparer(ctx context.Context, automationAccountName string, hybridRunbookWorkerGroupName string) (*http.Request, error) { +func (client HybridRunbookWorkerGroupClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "hybridRunbookWorkerGroupName": autorest.Encode("path", hybridRunbookWorkerGroupName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -115,16 +115,16 @@ func (client HybridRunbookWorkerGroupClient) DeleteResponder(resp *http.Response // Get retrieve a hybrid runbook worker group. // -// automationAccountName is the automation account name. hybridRunbookWorkerGroupName is the hybrid runbook worker -// group name -func (client HybridRunbookWorkerGroupClient) Get(ctx context.Context, automationAccountName string, hybridRunbookWorkerGroupName string) (result HybridRunbookWorkerGroup, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// hybridRunbookWorkerGroupName is the hybrid runbook worker group name +func (client HybridRunbookWorkerGroupClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string) (result HybridRunbookWorkerGroup, 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", "Get") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.HybridRunbookWorkerGroupClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, automationAccountName, hybridRunbookWorkerGroupName) + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName) if err != nil { err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Get", nil, "Failure preparing request") return @@ -146,11 +146,11 @@ func (client HybridRunbookWorkerGroupClient) Get(ctx context.Context, automation } // GetPreparer prepares the Get request. -func (client HybridRunbookWorkerGroupClient) GetPreparer(ctx context.Context, automationAccountName string, hybridRunbookWorkerGroupName string) (*http.Request, error) { +func (client HybridRunbookWorkerGroupClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "hybridRunbookWorkerGroupName": autorest.Encode("path", hybridRunbookWorkerGroupName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -189,16 +189,16 @@ func (client HybridRunbookWorkerGroupClient) GetResponder(resp *http.Response) ( // ListByAutomationAccount retrieve a list of hybrid runbook worker groups. // -// automationAccountName is the automation account name. -func (client HybridRunbookWorkerGroupClient) ListByAutomationAccount(ctx context.Context, automationAccountName string) (result HybridRunbookWorkerGroupsListResultPage, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +func (client HybridRunbookWorkerGroupClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result HybridRunbookWorkerGroupsListResultPage, 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", "ListByAutomationAccount") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.HybridRunbookWorkerGroupClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName) + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) if err != nil { err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -220,10 +220,10 @@ func (client HybridRunbookWorkerGroupClient) ListByAutomationAccount(ctx context } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client HybridRunbookWorkerGroupClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string) (*http.Request, error) { +func (client HybridRunbookWorkerGroupClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -282,23 +282,24 @@ func (client HybridRunbookWorkerGroupClient) listByAutomationAccountNextResults( } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client HybridRunbookWorkerGroupClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string) (result HybridRunbookWorkerGroupsListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, automationAccountName) +func (client HybridRunbookWorkerGroupClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result HybridRunbookWorkerGroupsListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) return } // Update update a hybrid runbook worker group. // -// automationAccountName is the automation account name. hybridRunbookWorkerGroupName is the hybrid runbook worker -// group name parameters is the hybrid runbook worker group -func (client HybridRunbookWorkerGroupClient) Update(ctx context.Context, automationAccountName string, hybridRunbookWorkerGroupName string, parameters HybridRunbookWorkerGroupUpdateParameters) (result HybridRunbookWorkerGroup, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// hybridRunbookWorkerGroupName is the hybrid runbook worker group name parameters is the hybrid runbook worker +// group +func (client HybridRunbookWorkerGroupClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string, parameters HybridRunbookWorkerGroupUpdateParameters) (result HybridRunbookWorkerGroup, 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", "Update") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.HybridRunbookWorkerGroupClient", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, automationAccountName, hybridRunbookWorkerGroupName, parameters) + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Update", nil, "Failure preparing request") return @@ -320,11 +321,11 @@ func (client HybridRunbookWorkerGroupClient) Update(ctx context.Context, automat } // UpdatePreparer prepares the Update request. -func (client HybridRunbookWorkerGroupClient) UpdatePreparer(ctx context.Context, automationAccountName string, hybridRunbookWorkerGroupName string, parameters HybridRunbookWorkerGroupUpdateParameters) (*http.Request, error) { +func (client HybridRunbookWorkerGroupClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string, parameters HybridRunbookWorkerGroupUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "hybridRunbookWorkerGroupName": autorest.Encode("path", hybridRunbookWorkerGroupName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -334,7 +335,7 @@ func (client HybridRunbookWorkerGroupClient) UpdatePreparer(ctx context.Context, } 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.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}", pathParameters), 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..72cd180f957b 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 @@ -32,30 +32,30 @@ type JobClient struct { } // NewJobClient creates an instance of the JobClient client. -func NewJobClient(subscriptionID string, resourceGroupName string) JobClient { - return NewJobClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) +func NewJobClient(subscriptionID string) JobClient { + return NewJobClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewJobClientWithBaseURI creates an instance of the JobClient client. -func NewJobClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) JobClient { - return JobClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} +func NewJobClientWithBaseURI(baseURI string, subscriptionID string) JobClient { + return JobClient{NewWithBaseURI(baseURI, subscriptionID)} } // 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. -func (client JobClient) Create(ctx context.Context, automationAccountName string, jobID uuid.UUID, parameters JobCreateParameters) (result Job, err error) { +// resourceGroupName is the resource group name. 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, resourceGroupName string, automationAccountName string, jobID uuid.UUID, parameters JobCreateParameters) (result Job, 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: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {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) + req, err := client.CreatePreparer(ctx, resourceGroupName, automationAccountName, jobID, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.JobClient", "Create", nil, "Failure preparing request") return @@ -77,11 +77,11 @@ func (client JobClient) Create(ctx context.Context, automationAccountName string } // CreatePreparer prepares the Create request. -func (client JobClient) CreatePreparer(ctx context.Context, automationAccountName string, jobID uuid.UUID, parameters JobCreateParameters) (*http.Request, error) { +func (client JobClient) CreatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID, parameters JobCreateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "jobId": autorest.Encode("path", jobID), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -91,7 +91,7 @@ func (client JobClient) CreatePreparer(ctx context.Context, automationAccountNam } 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.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}", pathParameters), @@ -122,15 +122,16 @@ func (client JobClient) CreateResponder(resp *http.Response) (result Job, err er // Get retrieve the job identified by job id. // -// automationAccountName is the automation account name. jobID is the job id. -func (client JobClient) Get(ctx context.Context, automationAccountName string, jobID uuid.UUID) (result Job, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. jobID is the +// job id. +func (client JobClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (result Job, 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.JobClient", "Get") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, automationAccountName, jobID) + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, jobID) if err != nil { err = autorest.NewErrorWithError(err, "automation.JobClient", "Get", nil, "Failure preparing request") return @@ -152,11 +153,11 @@ func (client JobClient) Get(ctx context.Context, automationAccountName string, j } // GetPreparer prepares the Get request. -func (client JobClient) GetPreparer(ctx context.Context, automationAccountName string, jobID uuid.UUID) (*http.Request, error) { +func (client JobClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "jobId": autorest.Encode("path", jobID), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -195,15 +196,16 @@ func (client JobClient) GetResponder(resp *http.Response) (result Job, err error // GetOutput retrieve the job output identified by job id. // -// automationAccountName is the automation account name. jobID is the job id. -func (client JobClient) GetOutput(ctx context.Context, automationAccountName string, jobID string) (result ReadCloser, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. jobID is the +// job id. +func (client JobClient) GetOutput(ctx context.Context, resourceGroupName string, automationAccountName string, jobID string) (result ReadCloser, 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.JobClient", "GetOutput") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobClient", "GetOutput", err.Error()) } - req, err := client.GetOutputPreparer(ctx, automationAccountName, jobID) + req, err := client.GetOutputPreparer(ctx, resourceGroupName, automationAccountName, jobID) if err != nil { err = autorest.NewErrorWithError(err, "automation.JobClient", "GetOutput", nil, "Failure preparing request") return @@ -225,11 +227,11 @@ func (client JobClient) GetOutput(ctx context.Context, automationAccountName str } // GetOutputPreparer prepares the GetOutput request. -func (client JobClient) GetOutputPreparer(ctx context.Context, automationAccountName string, jobID string) (*http.Request, error) { +func (client JobClient) GetOutputPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "jobId": autorest.Encode("path", jobID), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -267,15 +269,16 @@ func (client JobClient) GetOutputResponder(resp *http.Response) (result ReadClos // GetRunbookContent retrieve the runbook content of the job identified by job id. // -// automationAccountName is the automation account name. jobID is the job id. -func (client JobClient) GetRunbookContent(ctx context.Context, automationAccountName string, jobID string) (result ReadCloser, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. jobID is the +// job id. +func (client JobClient) GetRunbookContent(ctx context.Context, resourceGroupName string, automationAccountName string, jobID string) (result ReadCloser, 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.JobClient", "GetRunbookContent") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobClient", "GetRunbookContent", err.Error()) } - req, err := client.GetRunbookContentPreparer(ctx, automationAccountName, jobID) + req, err := client.GetRunbookContentPreparer(ctx, resourceGroupName, automationAccountName, jobID) if err != nil { err = autorest.NewErrorWithError(err, "automation.JobClient", "GetRunbookContent", nil, "Failure preparing request") return @@ -297,11 +300,11 @@ func (client JobClient) GetRunbookContent(ctx context.Context, automationAccount } // GetRunbookContentPreparer prepares the GetRunbookContent request. -func (client JobClient) GetRunbookContentPreparer(ctx context.Context, automationAccountName string, jobID string) (*http.Request, error) { +func (client JobClient) GetRunbookContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "jobId": autorest.Encode("path", jobID), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -339,16 +342,17 @@ func (client JobClient) GetRunbookContentResponder(resp *http.Response) (result // ListByAutomationAccount retrieve a list of jobs. // -// automationAccountName is the automation account name. filter is the filter to apply on the operation. -func (client JobClient) ListByAutomationAccount(ctx context.Context, automationAccountName string, filter string) (result JobListResultPage, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. filter is +// the filter to apply on the operation. +func (client JobClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result JobListResultPage, 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.JobClient", "ListByAutomationAccount") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName, filter) + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) if err != nil { err = autorest.NewErrorWithError(err, "automation.JobClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -370,10 +374,10 @@ func (client JobClient) ListByAutomationAccount(ctx context.Context, automationA } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client JobClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string, filter string) (*http.Request, error) { +func (client JobClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -435,22 +439,23 @@ func (client JobClient) listByAutomationAccountNextResults(lastResults JobListRe } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string, filter string) (result JobListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, automationAccountName, filter) +func (client JobClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result JobListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) return } // Resume resume the job identified by jobId. // -// automationAccountName is the automation account name. jobID is the job id. -func (client JobClient) Resume(ctx context.Context, automationAccountName string, jobID uuid.UUID) (result autorest.Response, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. jobID is the +// job id. +func (client JobClient) Resume(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (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.JobClient", "Resume") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobClient", "Resume", err.Error()) } - req, err := client.ResumePreparer(ctx, automationAccountName, jobID) + req, err := client.ResumePreparer(ctx, resourceGroupName, automationAccountName, jobID) if err != nil { err = autorest.NewErrorWithError(err, "automation.JobClient", "Resume", nil, "Failure preparing request") return @@ -472,11 +477,11 @@ func (client JobClient) Resume(ctx context.Context, automationAccountName string } // ResumePreparer prepares the Resume request. -func (client JobClient) ResumePreparer(ctx context.Context, automationAccountName string, jobID uuid.UUID) (*http.Request, error) { +func (client JobClient) ResumePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "jobId": autorest.Encode("path", jobID), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -514,15 +519,16 @@ func (client JobClient) ResumeResponder(resp *http.Response) (result autorest.Re // Stop stop the job identified by jobId. // -// automationAccountName is the automation account name. jobID is the job id. -func (client JobClient) Stop(ctx context.Context, automationAccountName string, jobID uuid.UUID) (result autorest.Response, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. jobID is the +// job id. +func (client JobClient) Stop(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (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.JobClient", "Stop") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobClient", "Stop", err.Error()) } - req, err := client.StopPreparer(ctx, automationAccountName, jobID) + req, err := client.StopPreparer(ctx, resourceGroupName, automationAccountName, jobID) if err != nil { err = autorest.NewErrorWithError(err, "automation.JobClient", "Stop", nil, "Failure preparing request") return @@ -544,11 +550,11 @@ func (client JobClient) Stop(ctx context.Context, automationAccountName string, } // StopPreparer prepares the Stop request. -func (client JobClient) StopPreparer(ctx context.Context, automationAccountName string, jobID uuid.UUID) (*http.Request, error) { +func (client JobClient) StopPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "jobId": autorest.Encode("path", jobID), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -586,15 +592,16 @@ func (client JobClient) StopResponder(resp *http.Response) (result autorest.Resp // Suspend suspend the job identified by jobId. // -// automationAccountName is the automation account name. jobID is the job id. -func (client JobClient) Suspend(ctx context.Context, automationAccountName string, jobID uuid.UUID) (result autorest.Response, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. jobID is the +// job id. +func (client JobClient) Suspend(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (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.JobClient", "Suspend") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobClient", "Suspend", err.Error()) } - req, err := client.SuspendPreparer(ctx, automationAccountName, jobID) + req, err := client.SuspendPreparer(ctx, resourceGroupName, automationAccountName, jobID) if err != nil { err = autorest.NewErrorWithError(err, "automation.JobClient", "Suspend", nil, "Failure preparing request") return @@ -616,11 +623,11 @@ func (client JobClient) Suspend(ctx context.Context, automationAccountName strin } // SuspendPreparer prepares the Suspend request. -func (client JobClient) SuspendPreparer(ctx context.Context, automationAccountName string, jobID uuid.UUID) (*http.Request, error) { +func (client JobClient) SuspendPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "jobId": autorest.Encode("path", jobID), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } 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..fdcd16cb4515 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 @@ -32,32 +32,33 @@ type JobScheduleClient struct { } // NewJobScheduleClient creates an instance of the JobScheduleClient client. -func NewJobScheduleClient(subscriptionID string, resourceGroupName string) JobScheduleClient { - return NewJobScheduleClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) +func NewJobScheduleClient(subscriptionID string) JobScheduleClient { + return NewJobScheduleClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewJobScheduleClientWithBaseURI creates an instance of the JobScheduleClient client. -func NewJobScheduleClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) JobScheduleClient { - return JobScheduleClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} +func NewJobScheduleClientWithBaseURI(baseURI string, subscriptionID string) JobScheduleClient { + return JobScheduleClient{NewWithBaseURI(baseURI, subscriptionID)} } // Create create a job schedule. // -// automationAccountName is the automation account name. jobScheduleID is the job schedule name. parameters is the -// parameters supplied to the create job schedule operation. -func (client JobScheduleClient) Create(ctx context.Context, automationAccountName string, jobScheduleID uuid.UUID, parameters JobScheduleCreateParameters) (result JobSchedule, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// jobScheduleID is the job schedule name. parameters is the parameters supplied to the create job schedule +// operation. +func (client JobScheduleClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID, parameters JobScheduleCreateParameters) (result JobSchedule, 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: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.JobScheduleCreateProperties", Name: validation.Null, Rule: true, 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) + req, err := client.CreatePreparer(ctx, resourceGroupName, automationAccountName, jobScheduleID, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Create", nil, "Failure preparing request") return @@ -79,11 +80,11 @@ func (client JobScheduleClient) Create(ctx context.Context, automationAccountNam } // CreatePreparer prepares the Create request. -func (client JobScheduleClient) CreatePreparer(ctx context.Context, automationAccountName string, jobScheduleID uuid.UUID, parameters JobScheduleCreateParameters) (*http.Request, error) { +func (client JobScheduleClient) CreatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID, parameters JobScheduleCreateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "jobScheduleId": autorest.Encode("path", jobScheduleID), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -93,7 +94,7 @@ func (client JobScheduleClient) CreatePreparer(ctx context.Context, automationAc } 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.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}", pathParameters), @@ -124,15 +125,16 @@ func (client JobScheduleClient) CreateResponder(resp *http.Response) (result Job // Delete delete the job schedule identified by job schedule name. // -// automationAccountName is the automation account name. jobScheduleID is the job schedule name. -func (client JobScheduleClient) Delete(ctx context.Context, automationAccountName string, jobScheduleID uuid.UUID) (result autorest.Response, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// jobScheduleID is the job schedule name. +func (client JobScheduleClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID) (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.JobScheduleClient", "Delete") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobScheduleClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, automationAccountName, jobScheduleID) + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, jobScheduleID) if err != nil { err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Delete", nil, "Failure preparing request") return @@ -154,11 +156,11 @@ func (client JobScheduleClient) Delete(ctx context.Context, automationAccountNam } // DeletePreparer prepares the Delete request. -func (client JobScheduleClient) DeletePreparer(ctx context.Context, automationAccountName string, jobScheduleID uuid.UUID) (*http.Request, error) { +func (client JobScheduleClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "jobScheduleId": autorest.Encode("path", jobScheduleID), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -196,15 +198,16 @@ func (client JobScheduleClient) DeleteResponder(resp *http.Response) (result aut // Get retrieve the job schedule identified by job schedule name. // -// automationAccountName is the automation account name. jobScheduleID is the job schedule name. -func (client JobScheduleClient) Get(ctx context.Context, automationAccountName string, jobScheduleID uuid.UUID) (result JobSchedule, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +// jobScheduleID is the job schedule name. +func (client JobScheduleClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID) (result JobSchedule, 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.JobScheduleClient", "Get") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobScheduleClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, automationAccountName, jobScheduleID) + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, jobScheduleID) if err != nil { err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Get", nil, "Failure preparing request") return @@ -226,11 +229,11 @@ func (client JobScheduleClient) Get(ctx context.Context, automationAccountName s } // GetPreparer prepares the Get request. -func (client JobScheduleClient) GetPreparer(ctx context.Context, automationAccountName string, jobScheduleID uuid.UUID) (*http.Request, error) { +func (client JobScheduleClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "jobScheduleId": autorest.Encode("path", jobScheduleID), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -269,16 +272,16 @@ func (client JobScheduleClient) GetResponder(resp *http.Response) (result JobSch // ListByAutomationAccount retrieve a list of job schedules. // -// automationAccountName is the automation account name. -func (client JobScheduleClient) ListByAutomationAccount(ctx context.Context, automationAccountName string) (result JobScheduleListResultPage, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +func (client JobScheduleClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result JobScheduleListResultPage, 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.JobScheduleClient", "ListByAutomationAccount") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobScheduleClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName) + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) if err != nil { err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -300,10 +303,10 @@ func (client JobScheduleClient) ListByAutomationAccount(ctx context.Context, aut } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client JobScheduleClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string) (*http.Request, error) { +func (client JobScheduleClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -362,7 +365,7 @@ func (client JobScheduleClient) listByAutomationAccountNextResults(lastResults J } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobScheduleClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string) (result JobScheduleListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, automationAccountName) +func (client JobScheduleClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result JobScheduleListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) return } 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..71d0b27fbbe3 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 @@ -31,26 +31,27 @@ type JobStreamClient struct { } // NewJobStreamClient creates an instance of the JobStreamClient client. -func NewJobStreamClient(subscriptionID string, resourceGroupName string) JobStreamClient { - return NewJobStreamClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) +func NewJobStreamClient(subscriptionID string) JobStreamClient { + return NewJobStreamClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewJobStreamClientWithBaseURI creates an instance of the JobStreamClient client. -func NewJobStreamClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) JobStreamClient { - return JobStreamClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} +func NewJobStreamClientWithBaseURI(baseURI string, subscriptionID string) JobStreamClient { + return JobStreamClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get retrieve the job stream identified by job stream id. // -// automationAccountName is the automation account name. jobID is the job id. jobStreamID is the job stream id. -func (client JobStreamClient) Get(ctx context.Context, automationAccountName string, jobID string, jobStreamID string) (result JobStream, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. jobID is the +// job id. jobStreamID is the job stream id. +func (client JobStreamClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, jobID 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.JobStreamClient", "Get") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobStreamClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, automationAccountName, jobID, jobStreamID) + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, jobID, jobStreamID) if err != nil { err = autorest.NewErrorWithError(err, "automation.JobStreamClient", "Get", nil, "Failure preparing request") return @@ -72,12 +73,12 @@ func (client JobStreamClient) Get(ctx context.Context, automationAccountName str } // GetPreparer prepares the Get request. -func (client JobStreamClient) GetPreparer(ctx context.Context, automationAccountName string, jobID string, jobStreamID string) (*http.Request, error) { +func (client JobStreamClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobID string, jobStreamID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "jobId": autorest.Encode("path", jobID), "jobStreamId": autorest.Encode("path", jobStreamID), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -116,17 +117,17 @@ func (client JobStreamClient) GetResponder(resp *http.Response) (result JobStrea // ListByJob retrieve a list of jobs streams identified by job id. // -// automationAccountName is the automation account name. jobID is the job Id. filter is the filter to apply on the -// operation. -func (client JobStreamClient) ListByJob(ctx context.Context, automationAccountName string, jobID string, filter string) (result JobStreamListResultPage, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. jobID is the +// job Id. filter is the filter to apply on the operation. +func (client JobStreamClient) ListByJob(ctx context.Context, resourceGroupName string, automationAccountName string, jobID 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.JobStreamClient", "ListByJob") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobStreamClient", "ListByJob", err.Error()) } result.fn = client.listByJobNextResults - req, err := client.ListByJobPreparer(ctx, automationAccountName, jobID, filter) + req, err := client.ListByJobPreparer(ctx, resourceGroupName, automationAccountName, jobID, filter) if err != nil { err = autorest.NewErrorWithError(err, "automation.JobStreamClient", "ListByJob", nil, "Failure preparing request") return @@ -148,11 +149,11 @@ func (client JobStreamClient) ListByJob(ctx context.Context, automationAccountNa } // ListByJobPreparer prepares the ListByJob request. -func (client JobStreamClient) ListByJobPreparer(ctx context.Context, automationAccountName string, jobID string, filter string) (*http.Request, error) { +func (client JobStreamClient) ListByJobPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobID string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "jobId": autorest.Encode("path", jobID), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -214,7 +215,7 @@ func (client JobStreamClient) listByJobNextResults(lastResults JobStreamListResu } // ListByJobComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobStreamClient) ListByJobComplete(ctx context.Context, automationAccountName string, jobID string, filter string) (result JobStreamListResultIterator, err error) { - result.page, err = client.ListByJob(ctx, automationAccountName, jobID, filter) +func (client JobStreamClient) ListByJobComplete(ctx context.Context, resourceGroupName string, automationAccountName string, jobID string, filter string) (result JobStreamListResultIterator, err error) { + result.page, err = client.ListByJob(ctx, resourceGroupName, automationAccountName, jobID, filter) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/keys.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/keys.go new file mode 100644 index 000000000000..88018fecd17a --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/keys.go @@ -0,0 +1,113 @@ +package automation + +// 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" +) + +// KeysClient is the automation Client +type KeysClient struct { + BaseClient +} + +// NewKeysClient creates an instance of the KeysClient client. +func NewKeysClient(subscriptionID string, resourceGroupName string) KeysClient { + return NewKeysClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) +} + +// NewKeysClientWithBaseURI creates an instance of the KeysClient client. +func NewKeysClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) KeysClient { + return KeysClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} +} + +// ListByAutomationAccount retrieve the automation keys for an account. +// +// automationAccountName is the automation account name. +func (client KeysClient) ListByAutomationAccount(ctx context.Context, automationAccountName string) (result KeyListResult, 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.NewError("automation.KeysClient", "ListByAutomationAccount", err.Error()) + } + + req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.KeysClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.KeysClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.KeysClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client KeysClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/listKeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client KeysClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client KeysClient) ListByAutomationAccountResponder(resp *http.Response) (result KeyListResult, 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/automation/mgmt/2015-10-31/automation/linkedworkspace.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/linkedworkspace.go new file mode 100644 index 000000000000..07bd7f664551 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/linkedworkspace.go @@ -0,0 +1,113 @@ +package automation + +// 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" +) + +// LinkedWorkspaceClient is the automation Client +type LinkedWorkspaceClient struct { + BaseClient +} + +// NewLinkedWorkspaceClient creates an instance of the LinkedWorkspaceClient client. +func NewLinkedWorkspaceClient(subscriptionID string) LinkedWorkspaceClient { + return NewLinkedWorkspaceClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewLinkedWorkspaceClientWithBaseURI creates an instance of the LinkedWorkspaceClient client. +func NewLinkedWorkspaceClientWithBaseURI(baseURI string, subscriptionID string) LinkedWorkspaceClient { + return LinkedWorkspaceClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get retrieve the linked workspace for the account id. +// +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +func (client LinkedWorkspaceClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string) (result LinkedWorkspace, 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.NewError("automation.LinkedWorkspaceClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.LinkedWorkspaceClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.LinkedWorkspaceClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.LinkedWorkspaceClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client LinkedWorkspaceClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/linkedWorkspace", 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 LinkedWorkspaceClient) 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 LinkedWorkspaceClient) GetResponder(resp *http.Response) (result LinkedWorkspace, 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/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..240df47a9a14 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 @@ -40,16 +40,26 @@ const ( Unavailable AccountState = "Unavailable" ) +// PossibleAccountStateValues returns an array of possible values for the AccountState const type. +func PossibleAccountStateValues() []AccountState { + return []AccountState{Ok, Suspended, Unavailable} +} + // AgentRegistrationKeyName enumerates the values for agent registration key name. type AgentRegistrationKeyName string const ( // Primary ... - Primary AgentRegistrationKeyName = "Primary" + Primary AgentRegistrationKeyName = "primary" // Secondary ... - Secondary AgentRegistrationKeyName = "Secondary" + Secondary AgentRegistrationKeyName = "secondary" ) +// PossibleAgentRegistrationKeyNameValues returns an array of possible values for the AgentRegistrationKeyName const type. +func PossibleAgentRegistrationKeyNameValues() []AgentRegistrationKeyName { + return []AgentRegistrationKeyName{Primary, Secondary} +} + // ContentSourceType enumerates the values for content source type. type ContentSourceType string @@ -60,6 +70,11 @@ const ( URI ContentSourceType = "uri" ) +// PossibleContentSourceTypeValues returns an array of possible values for the ContentSourceType const type. +func PossibleContentSourceTypeValues() []ContentSourceType { + return []ContentSourceType{EmbeddedContent, URI} +} + // DscConfigurationProvisioningState enumerates the values for dsc configuration provisioning state. type DscConfigurationProvisioningState string @@ -68,6 +83,11 @@ const ( Succeeded DscConfigurationProvisioningState = "Succeeded" ) +// PossibleDscConfigurationProvisioningStateValues returns an array of possible values for the DscConfigurationProvisioningState const type. +func PossibleDscConfigurationProvisioningStateValues() []DscConfigurationProvisioningState { + return []DscConfigurationProvisioningState{Succeeded} +} + // DscConfigurationState enumerates the values for dsc configuration state. type DscConfigurationState string @@ -80,6 +100,11 @@ const ( DscConfigurationStatePublished DscConfigurationState = "Published" ) +// PossibleDscConfigurationStateValues returns an array of possible values for the DscConfigurationState const type. +func PossibleDscConfigurationStateValues() []DscConfigurationState { + return []DscConfigurationState{DscConfigurationStateEdit, DscConfigurationStateNew, DscConfigurationStatePublished} +} + // HTTPStatusCode enumerates the values for http status code. type HTTPStatusCode string @@ -180,6 +205,30 @@ const ( UseProxy HTTPStatusCode = "UseProxy" ) +// PossibleHTTPStatusCodeValues returns an array of possible values for the HTTPStatusCode const type. +func PossibleHTTPStatusCodeValues() []HTTPStatusCode { + return []HTTPStatusCode{Accepted, Ambiguous, BadGateway, BadRequest, Conflict, Continue, Created, ExpectationFailed, Forbidden, Found, GatewayTimeout, Gone, HTTPVersionNotSupported, InternalServerError, LengthRequired, MethodNotAllowed, Moved, MovedPermanently, MultipleChoices, NoContent, NonAuthoritativeInformation, NotAcceptable, NotFound, NotImplemented, NotModified, OK, PartialContent, PaymentRequired, PreconditionFailed, ProxyAuthenticationRequired, Redirect, RedirectKeepVerb, RedirectMethod, RequestedRangeNotSatisfiable, RequestEntityTooLarge, RequestTimeout, RequestURITooLong, ResetContent, SeeOther, ServiceUnavailable, SwitchingProtocols, TemporaryRedirect, Unauthorized, UnsupportedMediaType, Unused, UpgradeRequired, UseProxy} +} + +// JobProvisioningState enumerates the values for job provisioning state. +type JobProvisioningState string + +const ( + // JobProvisioningStateFailed ... + JobProvisioningStateFailed JobProvisioningState = "Failed" + // JobProvisioningStateProcessing ... + JobProvisioningStateProcessing JobProvisioningState = "Processing" + // JobProvisioningStateSucceeded ... + JobProvisioningStateSucceeded JobProvisioningState = "Succeeded" + // JobProvisioningStateSuspended ... + JobProvisioningStateSuspended JobProvisioningState = "Suspended" +) + +// PossibleJobProvisioningStateValues returns an array of possible values for the JobProvisioningState const type. +func PossibleJobProvisioningStateValues() []JobProvisioningState { + return []JobProvisioningState{JobProvisioningStateFailed, JobProvisioningStateProcessing, JobProvisioningStateSucceeded, JobProvisioningStateSuspended} +} + // JobStatus enumerates the values for job status. type JobStatus string @@ -212,6 +261,11 @@ const ( JobStatusSuspending JobStatus = "Suspending" ) +// PossibleJobStatusValues returns an array of possible values for the JobStatus const type. +func PossibleJobStatusValues() []JobStatus { + return []JobStatus{JobStatusActivating, JobStatusBlocked, JobStatusCompleted, JobStatusDisconnected, JobStatusFailed, JobStatusNew, JobStatusRemoving, JobStatusResuming, JobStatusRunning, JobStatusStopped, JobStatusStopping, JobStatusSuspended, JobStatusSuspending} +} + // JobStreamType enumerates the values for job stream type. type JobStreamType string @@ -232,6 +286,39 @@ const ( Warning JobStreamType = "Warning" ) +// PossibleJobStreamTypeValues returns an array of possible values for the JobStreamType const type. +func PossibleJobStreamTypeValues() []JobStreamType { + return []JobStreamType{Any, Debug, Error, Output, Progress, Verbose, Warning} +} + +// KeyName enumerates the values for key name. +type KeyName string + +const ( + // KeyNamePrimary ... + KeyNamePrimary KeyName = "primary" + // KeyNameSecondary ... + KeyNameSecondary KeyName = "secondary" +) + +// PossibleKeyNameValues returns an array of possible values for the KeyName const type. +func PossibleKeyNameValues() []KeyName { + return []KeyName{KeyNamePrimary, KeyNameSecondary} +} + +// KeyPermissions enumerates the values for key permissions. +type KeyPermissions string + +const ( + // Full ... + Full KeyPermissions = "Full" +) + +// PossibleKeyPermissionsValues returns an array of possible values for the KeyPermissions const type. +func PossibleKeyPermissionsValues() []KeyPermissions { + return []KeyPermissions{Full} +} + // ModuleProvisioningState enumerates the values for module provisioning state. type ModuleProvisioningState string @@ -270,6 +357,11 @@ const ( ModuleProvisioningStateUpdating ModuleProvisioningState = "Updating" ) +// PossibleModuleProvisioningStateValues returns an array of possible values for the ModuleProvisioningState const type. +func PossibleModuleProvisioningStateValues() []ModuleProvisioningState { + return []ModuleProvisioningState{ModuleProvisioningStateActivitiesStored, ModuleProvisioningStateCancelled, ModuleProvisioningStateConnectionTypeImported, ModuleProvisioningStateContentDownloaded, ModuleProvisioningStateContentRetrieved, ModuleProvisioningStateContentStored, ModuleProvisioningStateContentValidated, ModuleProvisioningStateCreated, ModuleProvisioningStateCreating, ModuleProvisioningStateFailed, ModuleProvisioningStateModuleDataStored, ModuleProvisioningStateModuleImportRunbookComplete, ModuleProvisioningStateRunningImportModuleRunbook, ModuleProvisioningStateStartingImportModuleRunbook, ModuleProvisioningStateSucceeded, ModuleProvisioningStateUpdating} +} + // RunbookProvisioningState enumerates the values for runbook provisioning state. type RunbookProvisioningState string @@ -278,6 +370,11 @@ const ( RunbookProvisioningStateSucceeded RunbookProvisioningState = "Succeeded" ) +// PossibleRunbookProvisioningStateValues returns an array of possible values for the RunbookProvisioningState const type. +func PossibleRunbookProvisioningStateValues() []RunbookProvisioningState { + return []RunbookProvisioningState{RunbookProvisioningStateSucceeded} +} + // RunbookState enumerates the values for runbook state. type RunbookState string @@ -290,6 +387,11 @@ const ( RunbookStatePublished RunbookState = "Published" ) +// PossibleRunbookStateValues returns an array of possible values for the RunbookState const type. +func PossibleRunbookStateValues() []RunbookState { + return []RunbookState{RunbookStateEdit, RunbookStateNew, RunbookStatePublished} +} + // RunbookTypeEnum enumerates the values for runbook type enum. type RunbookTypeEnum string @@ -308,6 +410,11 @@ const ( Script RunbookTypeEnum = "Script" ) +// PossibleRunbookTypeEnumValues returns an array of possible values for the RunbookTypeEnum const type. +func PossibleRunbookTypeEnumValues() []RunbookTypeEnum { + return []RunbookTypeEnum{Graph, GraphPowerShell, GraphPowerShellWorkflow, PowerShell, PowerShellWorkflow, Script} +} + // ScheduleDay enumerates the values for schedule day. type ScheduleDay string @@ -328,6 +435,11 @@ const ( Wednesday ScheduleDay = "Wednesday" ) +// PossibleScheduleDayValues returns an array of possible values for the ScheduleDay const type. +func PossibleScheduleDayValues() []ScheduleDay { + return []ScheduleDay{Friday, Monday, Saturday, Sunday, Thursday, Tuesday, Wednesday} +} + // ScheduleFrequency enumerates the values for schedule frequency. type ScheduleFrequency string @@ -344,6 +456,11 @@ const ( Week ScheduleFrequency = "Week" ) +// PossibleScheduleFrequencyValues returns an array of possible values for the ScheduleFrequency const type. +func PossibleScheduleFrequencyValues() []ScheduleFrequency { + return []ScheduleFrequency{Day, Hour, Month, OneTime, Week} +} + // SkuNameEnum enumerates the values for sku name enum. type SkuNameEnum string @@ -354,9 +471,18 @@ const ( Free SkuNameEnum = "Free" ) +// PossibleSkuNameEnumValues returns an array of possible values for the SkuNameEnum const type. +func PossibleSkuNameEnumValues() []SkuNameEnum { + return []SkuNameEnum{Basic, Free} +} + // 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 +492,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 +609,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 +637,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 +814,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 +842,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 @@ -724,6 +903,21 @@ type Activity struct { *ActivityProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for Activity. +func (a Activity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.ID != nil { + objectMap["id"] = a.ID + } + if a.Name != nil { + objectMap["name"] = a.Name + } + if a.ActivityProperties != nil { + objectMap["properties"] = a.ActivityProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for Activity struct. func (a *Activity) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -731,36 +925,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 @@ -961,14 +1155,32 @@ type AgentRegistrationKeys struct { // AgentRegistrationRegenerateKeyParameter the parameters supplied to the regenerate keys operation. type AgentRegistrationRegenerateKeyParameter struct { - // KeyName - Gets or sets the agent registration key name - Primary or Secondary. Possible values include: 'Primary', 'Secondary' + // KeyName - Gets or sets the agent registration key name - primary or secondary. Possible values include: 'Primary', 'Secondary' KeyName AgentRegistrationKeyName `json:"keyName,omitempty"` // Name - Gets or sets the name of the resource. Name *string `json:"name,omitempty"` // 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{}) + if arrkp.KeyName != "" { + 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,10 +1190,30 @@ 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"` } +// MarshalJSON is the custom marshaler for Certificate. +func (c Certificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.ID != nil { + objectMap["id"] = c.ID + } + if c.Name != nil { + objectMap["name"] = c.Name + } + if c.Type != nil { + objectMap["type"] = c.Type + } + if c.CertificateProperties != nil { + objectMap["properties"] = c.CertificateProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for Certificate struct. func (c *Certificate) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -989,36 +1221,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 @@ -1033,6 +1274,18 @@ type CertificateCreateOrUpdateParameters struct { *CertificateCreateOrUpdateProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for CertificateCreateOrUpdateParameters. +func (ccoup CertificateCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ccoup.Name != nil { + objectMap["name"] = ccoup.Name + } + if ccoup.CertificateCreateOrUpdateProperties != nil { + objectMap["properties"] = ccoup.CertificateCreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for CertificateCreateOrUpdateParameters struct. func (ccoup *CertificateCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -1040,26 +1293,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 @@ -1203,6 +1457,18 @@ type CertificateUpdateParameters struct { *CertificateUpdateProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for CertificateUpdateParameters. +func (cup CertificateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cup.Name != nil { + objectMap["name"] = cup.Name + } + if cup.CertificateUpdateProperties != nil { + objectMap["properties"] = cup.CertificateUpdateProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for CertificateUpdateParameters struct. func (cup *CertificateUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -1210,26 +1476,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,10 +1515,30 @@ 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"` } +// MarshalJSON is the custom marshaler for Connection. +func (c Connection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.ID != nil { + objectMap["id"] = c.ID + } + if c.Name != nil { + objectMap["name"] = c.Name + } + if c.Type != nil { + objectMap["type"] = c.Type + } + if c.ConnectionProperties != nil { + objectMap["properties"] = c.ConnectionProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for Connection struct. func (c *Connection) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -1259,36 +1546,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 @@ -1302,6 +1598,18 @@ type ConnectionCreateOrUpdateParameters struct { *ConnectionCreateOrUpdateProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for ConnectionCreateOrUpdateParameters. +func (ccoup ConnectionCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ccoup.Name != nil { + objectMap["name"] = ccoup.Name + } + if ccoup.ConnectionCreateOrUpdateProperties != nil { + objectMap["properties"] = ccoup.ConnectionCreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for ConnectionCreateOrUpdateParameters struct. func (ccoup *ConnectionCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -1309,26 +1617,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 +1650,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 +1775,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 +1784,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,10 +1812,30 @@ 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"` } +// MarshalJSON is the custom marshaler for ConnectionType. +func (ct ConnectionType) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ct.ID != nil { + objectMap["id"] = ct.ID + } + if ct.Name != nil { + objectMap["name"] = ct.Name + } + if ct.Type != nil { + objectMap["type"] = ct.Type + } + if ct.ConnectionTypeProperties != nil { + objectMap["properties"] = ct.ConnectionTypeProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for ConnectionType struct. func (ct *ConnectionType) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -1478,36 +1843,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 +1893,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"` @@ -1527,6 +1902,18 @@ type ConnectionTypeCreateOrUpdateParameters struct { *ConnectionTypeCreateOrUpdateProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for ConnectionTypeCreateOrUpdateParameters. +func (ctcoup ConnectionTypeCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ctcoup.Name != nil { + objectMap["name"] = ctcoup.Name + } + if ctcoup.ConnectionTypeCreateOrUpdateProperties != nil { + objectMap["properties"] = ctcoup.ConnectionTypeCreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for ConnectionTypeCreateOrUpdateParameters struct. func (ctcoup *ConnectionTypeCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -1534,26 +1921,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 + 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.Name = &name - } - - v = m["properties"] - if v != nil { - var properties ConnectionTypeCreateOrUpdateProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - ctcoup.ConnectionTypeCreateOrUpdateProperties = &properties } return nil @@ -1564,7 +1952,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 +2074,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 +2083,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. @@ -1691,6 +2112,18 @@ type ConnectionUpdateParameters struct { *ConnectionUpdateProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for ConnectionUpdateParameters. +func (cup ConnectionUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cup.Name != nil { + objectMap["name"] = cup.Name + } + if cup.ConnectionUpdateProperties != nil { + objectMap["properties"] = cup.ConnectionUpdateProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for ConnectionUpdateParameters struct. func (cup *ConnectionUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -1698,26 +2131,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 +2162,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,10 +2214,30 @@ 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"` } +// MarshalJSON is the custom marshaler for Credential. +func (c Credential) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.ID != nil { + objectMap["id"] = c.ID + } + if c.Name != nil { + objectMap["name"] = c.Name + } + if c.Type != nil { + objectMap["type"] = c.Type + } + if c.CredentialProperties != nil { + objectMap["properties"] = c.CredentialProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for Credential struct. func (c *Credential) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -1779,36 +2245,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 @@ -1822,6 +2297,18 @@ type CredentialCreateOrUpdateParameters struct { *CredentialCreateOrUpdateProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for CredentialCreateOrUpdateParameters. +func (ccoup CredentialCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ccoup.Name != nil { + objectMap["name"] = ccoup.Name + } + if ccoup.CredentialCreateOrUpdateProperties != nil { + objectMap["properties"] = ccoup.CredentialCreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for CredentialCreateOrUpdateParameters struct. func (ccoup *CredentialCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -1829,26 +2316,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 @@ -1986,6 +2474,18 @@ type CredentialUpdateParameters struct { *CredentialUpdateProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for CredentialUpdateParameters. +func (cup CredentialUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cup.Name != nil { + objectMap["name"] = cup.Name + } + if cup.CredentialUpdateProperties != nil { + objectMap["properties"] = cup.CredentialUpdateProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for CredentialUpdateParameters struct. func (cup *CredentialUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -1993,26 +2493,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 @@ -2031,10 +2532,32 @@ type CredentialUpdateProperties struct { // DscCompilationJob definition of the Dsc Compilation job. type DscCompilationJob struct { autorest.Response `json:"-"` - // ID - Gets the id of the resource. - ID *string `json:"id,omitempty"` // DscCompilationJobProperties - Gets or sets the properties of the Dsc Compilation job. *DscCompilationJobProperties `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"` +} + +// MarshalJSON is the custom marshaler for DscCompilationJob. +func (dcj DscCompilationJob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcj.DscCompilationJobProperties != nil { + objectMap["properties"] = dcj.DscCompilationJobProperties + } + if dcj.ID != nil { + objectMap["id"] = dcj.ID + } + if dcj.Name != nil { + objectMap["name"] = dcj.Name + } + if dcj.Type != nil { + objectMap["type"] = dcj.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for DscCompilationJob struct. @@ -2044,26 +2567,45 @@ 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 "properties": + if v != nil { + var dscCompilationJobProperties DscCompilationJobProperties + err = json.Unmarshal(*v, &dscCompilationJobProperties) + if err != nil { + return err + } + dcj.DscCompilationJobProperties = &dscCompilationJobProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dcj.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dcj.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dcj.Type = &typeVar + } } - dcj.DscCompilationJobProperties = &properties } return nil @@ -2078,7 +2620,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 +2648,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 +2697,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:"-"` @@ -2255,6 +2829,10 @@ type DscCompilationJobProperties struct { JobID *uuid.UUID `json:"jobId,omitempty"` // CreationTime - Gets the creation time of the job. CreationTime *date.Time `json:"creationTime,omitempty"` + // ProvisioningState - The current provisioning state of the job. + ProvisioningState *JobProvisioningStateProperty `json:"provisioningState,omitempty"` + // RunOn - Gets or sets the runOn which specifies the group name where the job is to be executed. + RunOn *string `json:"runOn,omitempty"` // Status - Gets or sets the status of the job. Possible values include: 'JobStatusNew', 'JobStatusActivating', 'JobStatusRunning', 'JobStatusCompleted', 'JobStatusFailed', 'JobStatusStopped', 'JobStatusBlocked', 'JobStatusSuspended', 'JobStatusDisconnected', 'JobStatusSuspending', 'JobStatusStopping', 'JobStatusResuming', 'JobStatusRemoving' Status JobStatus `json:"status,omitempty"` // StatusDetails - Gets or sets the status details of the job. @@ -2270,12 +2848,64 @@ 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"` +} + +// 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 + } + if dcjp.ProvisioningState != nil { + objectMap["provisioningState"] = dcjp.ProvisioningState + } + if dcjp.RunOn != nil { + objectMap["runOn"] = dcjp.RunOn + } + if dcjp.Status != "" { + 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 @@ -2285,90 +2915,109 @@ type DscConfiguration struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - // 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"` + 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 +3029,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 +3039,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 +3067,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 +3120,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 +3267,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 +3282,106 @@ 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{}) + if dcp.ProvisioningState != "" { + 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 + } + if dcp.State != "" { + 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) +} + +// DscConfigurationUpdateParameters the parameters supplied to the create or update configuration operation. +type DscConfigurationUpdateParameters struct { + // DscConfigurationCreateOrUpdateProperties - Gets or sets configuration create or update properties. + *DscConfigurationCreateOrUpdateProperties `json:"properties,omitempty"` + // Name - Gets or sets name of the resource. + Name *string `json:"name,omitempty"` + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DscConfigurationUpdateParameters. +func (dcup DscConfigurationUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcup.DscConfigurationCreateOrUpdateProperties != nil { + objectMap["properties"] = dcup.DscConfigurationCreateOrUpdateProperties + } + if dcup.Name != nil { + objectMap["name"] = dcup.Name + } + if dcup.Tags != nil { + objectMap["tags"] = dcup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DscConfigurationUpdateParameters struct. +func (dcup *DscConfigurationUpdateParameters) 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 dscConfigurationCreateOrUpdateProperties DscConfigurationCreateOrUpdateProperties + err = json.Unmarshal(*v, &dscConfigurationCreateOrUpdateProperties) + if err != nil { + return err + } + dcup.DscConfigurationCreateOrUpdateProperties = &dscConfigurationCreateOrUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dcup.Name = &name + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dcup.Tags = tags + } + } + } + + return nil +} + // DscMetaConfiguration definition of the DSC Meta Configuration. type DscMetaConfiguration struct { // ConfigurationModeFrequencyMins - Gets or sets the ConfigurationModeFrequencyMins value of the meta configuration. @@ -2615,16 +3403,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,21 +3421,29 @@ 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"` } // DscNodeConfiguration definition of the dsc node configuration. type DscNodeConfiguration struct { autorest.Response `json:"-"` - // Name - Gets or sets the node configuration name. - Name *string `json:"name,omitempty"` // LastModifiedTime - Gets or sets the last modified time. LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` // CreationTime - Gets or sets creation time. CreationTime *date.Time `json:"creationTime,omitempty"` // Configuration - Gets or sets the configuration of the node. Configuration *DscConfigurationAssociationProperty `json:"configuration,omitempty"` - // ID - Gets or sets the id of the resource. + // ID - Resource Id ID *string `json:"id,omitempty"` + // Name - Resource name + Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` } // DscNodeConfigurationAssociationProperty the dsc nodeconfiguration property associated with the entity. @@ -3243,39 +4029,52 @@ type HybridRunbookWorkerGroupUpdateParameters struct { // Job definition of the job. type Job struct { autorest.Response `json:"-"` - // ID - Gets or sets the id of the resource. + // ID - Id of the resource. ID *string `json:"id,omitempty"` - // JobProperties - Gets or sets the properties of the job. + // JobProperties - The properties of the job. *JobProperties `json:"properties,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for Job struct. -func (j *Job) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage +// MarshalJSON is the custom marshaler for Job. +func (j Job) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if j.ID != nil { + objectMap["id"] = j.ID + } + if j.JobProperties != nil { + objectMap["properties"] = j.JobProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Job struct. +func (j *Job) 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 - } - 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 @@ -3285,12 +4084,15 @@ func (j *Job) UnmarshalJSON(body []byte) error { type JobCreateParameters struct { // JobCreateProperties - Gets or sets the list of job properties. *JobCreateProperties `json:"properties,omitempty"` - // Name - Gets or sets name of the resource. - Name *string `json:"name,omitempty"` - // 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"` +} + +// 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 + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for JobCreateParameters struct. @@ -3300,46 +4102,18 @@ 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 + } } - jcp.Tags = &tags } return nil @@ -3350,11 +4124,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,18 +4273,96 @@ 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"` + // ProvisioningState - The provisioning state of a resource. + ProvisioningState *JobProvisioningStateProperty `json:"provisioningState,omitempty"` +} + +// 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 + } + if jp.Status != "" { + 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 + } + if jp.ProvisioningState != nil { + objectMap["provisioningState"] = jp.ProvisioningState + } + return json.Marshal(objectMap) +} + +// JobProvisioningStateProperty the provisioning state property. +type JobProvisioningStateProperty struct { + // ProvisioningState - The provisioning state of the resource. Possible values include: 'JobProvisioningStateFailed', 'JobProvisioningStateSucceeded', 'JobProvisioningStateSuspended', 'JobProvisioningStateProcessing' + ProvisioningState JobProvisioningState `json:"provisioningState,omitempty"` } // 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"` } +// MarshalJSON is the custom marshaler for JobSchedule. +func (js JobSchedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if js.ID != nil { + objectMap["id"] = js.ID + } + if js.Name != nil { + objectMap["name"] = js.Name + } + if js.Type != nil { + objectMap["type"] = js.Type + } + if js.JobScheduleProperties != nil { + objectMap["properties"] = js.JobScheduleProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for JobSchedule struct. func (js *JobSchedule) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -3503,26 +4370,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 @@ -3534,6 +4420,15 @@ type JobScheduleCreateParameters struct { *JobScheduleCreateProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for JobScheduleCreateParameters. +func (jscp JobScheduleCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jscp.JobScheduleCreateProperties != nil { + objectMap["properties"] = jscp.JobScheduleCreateProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for JobScheduleCreateParameters struct. func (jscp *JobScheduleCreateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -3541,16 +4436,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 +4462,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 +4596,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. @@ -3693,6 +4629,18 @@ type JobStream struct { *JobStreamProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for JobStream. +func (js JobStream) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if js.ID != nil { + objectMap["id"] = js.ID + } + if js.JobStreamProperties != nil { + objectMap["properties"] = js.JobStreamProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for JobStream struct. func (js *JobStream) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -3700,26 +4648,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 +4789,64 @@ 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 + } + if jsp.StreamType != "" { + 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) +} + +// Key automation key which is used to register a DSC Node +type Key struct { + // KeyName - Automation key name. Possible values include: 'KeyNamePrimary', 'KeyNameSecondary' + KeyName KeyName `json:"keyName,omitempty"` + // Permissions - Automation key permissions. Possible values include: 'Full' + Permissions KeyPermissions `json:"permissions,omitempty"` + // Value - Value of the Automation Key used for registration. + Value *string `json:"value,omitempty"` +} + +// KeyListResult ... +type KeyListResult struct { + autorest.Response `json:"-"` + // Value - Lists the automation keys. + Value *[]Key `json:"value,omitempty"` +} + +// LinkedWorkspace definition of the linked workspace. +type LinkedWorkspace struct { + autorest.Response `json:"-"` + // ID - Gets the id of the linked workspace. + ID *string `json:"id,omitempty"` } // 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 +4856,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,7 +4973,25 @@ 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"` +} + +// 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. @@ -3963,46 +5001,45 @@ func (mcoup *ModuleCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { 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 +5194,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 +5222,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 - } - 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 + 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.Tags = &tags } return nil @@ -4243,6 +5297,16 @@ type OperationListResult struct { Value *[]Operation `json:"value,omitempty"` } +// ProxyResource the Resource definition. +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"` +} + // ReadCloser ... type ReadCloser struct { autorest.Response `json:"-"` @@ -4260,7 +5324,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 +5357,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 +5370,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 +5515,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 +5543,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 - } - 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 + 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.Tags = &tags } return nil @@ -4492,71 +5617,129 @@ 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"` } -// RunbookDraftCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type RunbookDraftCreateOrUpdateFuture struct { +// 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) +} + +// RunbookDraftPublishFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type RunbookDraftPublishFuture 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 RunbookDraftCreateOrUpdateFuture) Result(client RunbookDraftClient) (ar autorest.Response, err error) { +func (future RunbookDraftPublishFuture) Result(client RunbookDraftClient) (ar autorest.Response, err error) { 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 ar, autorest.NewError("automation.RunbookDraftCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("automation.RunbookDraftPublishFuture") } if future.PollingMethod() == azure.PollingLocation { - ar, err = client.CreateOrUpdateResponder(future.Response()) + ar, 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 } - ar, err = client.CreateOrUpdateResponder(resp) + ar, err = client.PublishResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftPublishFuture", "Result", resp, "Failure responding to request") + } return } -// RunbookDraftPublishFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type RunbookDraftPublishFuture struct { +// RunbookDraftReplaceContentFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type RunbookDraftReplaceContentFuture 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 RunbookDraftPublishFuture) Result(client RunbookDraftClient) (r Runbook, err error) { +func (future RunbookDraftReplaceContentFuture) Result(client RunbookDraftClient) (ar autorest.Response, err error) { var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftReplaceContentFuture", "Result", future.Response(), "Polling failure") return } if !done { - return r, autorest.NewError("automation.RunbookDraftPublishFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("automation.RunbookDraftReplaceContentFuture") } if future.PollingMethod() == azure.PollingLocation { - r, err = client.PublishResponder(future.Response()) + ar, err = client.ReplaceContentResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftReplaceContentFuture", "Result", future.Response(), "Failure responding to request") + } return } + var req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.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.RunbookDraftReplaceContentFuture", "Result", resp, "Failure sending request") return } - r, err = client.PublishResponder(resp) + ar, err = client.ReplaceContentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftReplaceContentFuture", "Result", resp, "Failure responding to request") + } return } @@ -4699,7 +5882,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 +5899,57 @@ 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{}) + if rp.RunbookType != "" { + objectMap["runbookType"] = rp.RunbookType + } + if rp.PublishContentLink != nil { + objectMap["publishContentLink"] = rp.PublishContentLink + } + if rp.State != "" { + 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 + } + if rp.ProvisioningState != "" { + 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 +5959,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 +5987,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,14 +6046,34 @@ 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"` } +// MarshalJSON is the custom marshaler for Schedule. +func (s Schedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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.ScheduleProperties != nil { + objectMap["properties"] = s.ScheduleProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for Schedule struct. func (s *Schedule) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -4810,36 +6081,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 - } - 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 + 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.ScheduleProperties = &properties } return nil @@ -4859,6 +6139,18 @@ type ScheduleCreateOrUpdateParameters struct { *ScheduleCreateOrUpdateProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for ScheduleCreateOrUpdateParameters. +func (scoup ScheduleCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scoup.Name != nil { + objectMap["name"] = scoup.Name + } + if scoup.ScheduleCreateOrUpdateProperties != nil { + objectMap["properties"] = scoup.ScheduleCreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for ScheduleCreateOrUpdateParameters struct. func (scoup *ScheduleCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -4866,26 +6158,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 - } - scoup.Name = &name - } - - v = m["properties"] - if v != nil { - var properties ScheduleCreateOrUpdateProperties - 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 + } + 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.ScheduleCreateOrUpdateProperties = &properties } return nil @@ -4900,7 +6193,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 +6321,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. @@ -5051,6 +6344,18 @@ type ScheduleUpdateParameters struct { *ScheduleUpdateProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for ScheduleUpdateParameters. +func (sup ScheduleUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sup.Name != nil { + objectMap["name"] = sup.Name + } + if sup.ScheduleUpdateProperties != nil { + objectMap["properties"] = sup.ScheduleUpdateProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for ScheduleUpdateParameters struct. func (sup *ScheduleUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -5058,26 +6363,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 @@ -5091,6 +6397,12 @@ type ScheduleUpdateProperties struct { IsEnabled *bool `json:"isEnabled,omitempty"` } +// SetObject ... +type SetObject struct { + autorest.Response `json:"-"` + Value interface{} `json:"value,omitempty"` +} + // Sku the account SKU. type Sku struct { // Name - Gets or sets the SKU name of the account. Possible values include: 'Free', 'Basic' @@ -5156,19 +6468,70 @@ 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"` + // LogActivityTrace - The activity-level tracing options of the runbook. + LogActivityTrace *int32 `json:"logActivityTrace,omitempty"` +} + +// 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 + } + if tj.LogActivityTrace != nil { + objectMap["logActivityTrace"] = tj.LogActivityTrace + } + return json.Marshal(objectMap) } // TestJobCreateParameters the parameters supplied to the create test job operation. 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.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,14 +6581,34 @@ 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"` } +// MarshalJSON is the custom marshaler for Variable. +func (vVar Variable) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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.VariableProperties != nil { + objectMap["properties"] = vVar.VariableProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for Variable struct. func (vVar *Variable) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -5233,36 +6616,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 @@ -5276,6 +6668,18 @@ type VariableCreateOrUpdateParameters struct { *VariableCreateOrUpdateProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for VariableCreateOrUpdateParameters. +func (vcoup VariableCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vcoup.Name != nil { + objectMap["name"] = vcoup.Name + } + if vcoup.VariableCreateOrUpdateProperties != nil { + objectMap["properties"] = vcoup.VariableCreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for VariableCreateOrUpdateParameters struct. func (vcoup *VariableCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -5283,26 +6687,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 - } - vcoup.Name = &name - } - - v = m["properties"] - if v != nil { - var properties VariableCreateOrUpdateProperties - 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 + } + 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.VariableCreateOrUpdateProperties = &properties } return nil @@ -5442,6 +6847,18 @@ type VariableUpdateParameters struct { *VariableUpdateProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for VariableUpdateParameters. +func (vup VariableUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vup.Name != nil { + objectMap["name"] = vup.Name + } + if vup.VariableUpdateProperties != nil { + objectMap["properties"] = vup.VariableUpdateProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for VariableUpdateParameters struct. func (vup *VariableUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -5449,26 +6866,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 @@ -5485,14 +6903,34 @@ type VariableUpdateProperties struct { // Webhook definition of the webhook type. type Webhook 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 webhook. + // Name - Gets the name of the webhook. Name *string `json:"name,omitempty"` + // Type - Gets the type of the resource. + Type *string `json:"type,omitempty"` // WebhookProperties - Gets or sets the webhook properties. *WebhookProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for Webhook. +func (w Webhook) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if w.ID != nil { + objectMap["id"] = w.ID + } + if w.Name != nil { + objectMap["name"] = w.Name + } + if w.Type != nil { + objectMap["type"] = w.Type + } + if w.WebhookProperties != nil { + objectMap["properties"] = w.WebhookProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for Webhook struct. func (w *Webhook) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -5500,36 +6938,45 @@ 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 - } - w.Name = &name - } - - v = m["properties"] - if v != nil { - var properties WebhookProperties - 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 + } + 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 "properties": + if v != nil { + var webhookProperties WebhookProperties + err = json.Unmarshal(*v, &webhookProperties) + if err != nil { + return err + } + w.WebhookProperties = &webhookProperties + } } - w.WebhookProperties = &properties } return nil @@ -5543,6 +6990,18 @@ type WebhookCreateOrUpdateParameters struct { *WebhookCreateOrUpdateProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for WebhookCreateOrUpdateParameters. +func (wcoup WebhookCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wcoup.Name != nil { + objectMap["name"] = wcoup.Name + } + if wcoup.WebhookCreateOrUpdateProperties != nil { + objectMap["properties"] = wcoup.WebhookCreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for WebhookCreateOrUpdateParameters struct. func (wcoup *WebhookCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -5550,26 +7009,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 - } - wcoup.Name = &name - } - - v = m["properties"] - if v != nil { - var properties WebhookCreateOrUpdateProperties - 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 + } + 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.WebhookCreateOrUpdateProperties = &properties } return nil @@ -5584,13 +7044,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 +7188,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 +7201,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. @@ -5725,6 +7245,18 @@ type WebhookUpdateParameters struct { *WebhookUpdateProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for WebhookUpdateParameters. +func (wup WebhookUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wup.Name != nil { + objectMap["name"] = wup.Name + } + if wup.WebhookUpdateProperties != nil { + objectMap["properties"] = wup.WebhookUpdateProperties + } + 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 @@ -5732,26 +7264,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 - } - wup.Name = &name - } - - v = m["properties"] - if v != nil { - var properties WebhookUpdateProperties - 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 + } + 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.WebhookUpdateProperties = &properties } return nil @@ -5764,7 +7297,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..929cc72ca68b 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 @@ -31,23 +31,23 @@ type ModuleClient struct { } // NewModuleClient creates an instance of the ModuleClient client. -func NewModuleClient(subscriptionID string, resourceGroupName string) ModuleClient { - return NewModuleClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) +func NewModuleClient(subscriptionID string) ModuleClient { + return NewModuleClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewModuleClientWithBaseURI creates an instance of the ModuleClient client. -func NewModuleClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) ModuleClient { - return ModuleClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} +func NewModuleClientWithBaseURI(baseURI string, subscriptionID string) ModuleClient { + return ModuleClient{NewWithBaseURI(baseURI, subscriptionID)} } // 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. -func (client ModuleClient) CreateOrUpdate(ctx context.Context, automationAccountName string, moduleName string, parameters ModuleCreateOrUpdateParameters) (result Module, err error) { +// resourceGroupName is the resource group name. 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, resourceGroupName string, automationAccountName string, moduleName string, parameters ModuleCreateOrUpdateParameters) (result Module, 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: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.ModuleCreateOrUpdateProperties", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.ModuleCreateOrUpdateProperties.ContentLink", Name: validation.Null, Rule: true, @@ -57,10 +57,10 @@ 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) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, moduleName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.ModuleClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -82,11 +82,11 @@ func (client ModuleClient) CreateOrUpdate(ctx context.Context, automationAccount } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ModuleClient) CreateOrUpdatePreparer(ctx context.Context, automationAccountName string, moduleName string, parameters ModuleCreateOrUpdateParameters) (*http.Request, error) { +func (client ModuleClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, parameters ModuleCreateOrUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "moduleName": autorest.Encode("path", moduleName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -96,7 +96,7 @@ func (client ModuleClient) CreateOrUpdatePreparer(ctx context.Context, automatio } 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.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}", pathParameters), @@ -127,15 +127,16 @@ func (client ModuleClient) CreateOrUpdateResponder(resp *http.Response) (result // Delete delete the module by name. // -// automationAccountName is the automation account name. moduleName is the module name. -func (client ModuleClient) Delete(ctx context.Context, automationAccountName string, moduleName string) (result autorest.Response, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. moduleName +// is the module name. +func (client ModuleClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName 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.ModuleClient", "Delete") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ModuleClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, automationAccountName, moduleName) + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, moduleName) if err != nil { err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Delete", nil, "Failure preparing request") return @@ -157,11 +158,11 @@ func (client ModuleClient) Delete(ctx context.Context, automationAccountName str } // DeletePreparer prepares the Delete request. -func (client ModuleClient) DeletePreparer(ctx context.Context, automationAccountName string, moduleName string) (*http.Request, error) { +func (client ModuleClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "moduleName": autorest.Encode("path", moduleName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -199,15 +200,16 @@ func (client ModuleClient) DeleteResponder(resp *http.Response) (result autorest // Get retrieve the module identified by module name. // -// automationAccountName is the automation account name. moduleName is the module name. -func (client ModuleClient) Get(ctx context.Context, automationAccountName string, moduleName string) (result Module, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. moduleName +// is the module name. +func (client ModuleClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (result Module, 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.ModuleClient", "Get") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ModuleClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, automationAccountName, moduleName) + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, moduleName) if err != nil { err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Get", nil, "Failure preparing request") return @@ -229,11 +231,11 @@ func (client ModuleClient) Get(ctx context.Context, automationAccountName string } // GetPreparer prepares the Get request. -func (client ModuleClient) GetPreparer(ctx context.Context, automationAccountName string, moduleName string) (*http.Request, error) { +func (client ModuleClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "moduleName": autorest.Encode("path", moduleName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -272,16 +274,16 @@ func (client ModuleClient) GetResponder(resp *http.Response) (result Module, err // ListByAutomationAccount retrieve a list of modules. // -// automationAccountName is the automation account name. -func (client ModuleClient) ListByAutomationAccount(ctx context.Context, automationAccountName string) (result ModuleListResultPage, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +func (client ModuleClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result ModuleListResultPage, 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.ModuleClient", "ListByAutomationAccount") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ModuleClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName) + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) if err != nil { err = autorest.NewErrorWithError(err, "automation.ModuleClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -303,10 +305,10 @@ func (client ModuleClient) ListByAutomationAccount(ctx context.Context, automati } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client ModuleClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string) (*http.Request, error) { +func (client ModuleClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -365,23 +367,23 @@ func (client ModuleClient) listByAutomationAccountNextResults(lastResults Module } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client ModuleClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string) (result ModuleListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, automationAccountName) +func (client ModuleClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result ModuleListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) return } // Update update the module identified by module name. // -// automationAccountName is the automation account name. moduleName is the name of module. parameters is the update -// parameters for module. -func (client ModuleClient) Update(ctx context.Context, automationAccountName string, moduleName string, parameters ModuleUpdateParameters) (result Module, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. moduleName +// is the name of module. parameters is the update parameters for module. +func (client ModuleClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, parameters ModuleUpdateParameters) (result Module, 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.ModuleClient", "Update") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ModuleClient", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, automationAccountName, moduleName, parameters) + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, moduleName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Update", nil, "Failure preparing request") return @@ -403,11 +405,11 @@ func (client ModuleClient) Update(ctx context.Context, automationAccountName str } // UpdatePreparer prepares the Update request. -func (client ModuleClient) UpdatePreparer(ctx context.Context, automationAccountName string, moduleName string, parameters ModuleUpdateParameters) (*http.Request, error) { +func (client ModuleClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, parameters ModuleUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "moduleName": autorest.Encode("path", moduleName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -417,7 +419,7 @@ func (client ModuleClient) UpdatePreparer(ctx context.Context, automationAccount } 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.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}", pathParameters), 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..2cdc9b7ee487 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 @@ -31,26 +31,27 @@ type NodeReportsClient struct { } // NewNodeReportsClient creates an instance of the NodeReportsClient client. -func NewNodeReportsClient(subscriptionID string, resourceGroupName string) NodeReportsClient { - return NewNodeReportsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) +func NewNodeReportsClient(subscriptionID string) NodeReportsClient { + return NewNodeReportsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewNodeReportsClientWithBaseURI creates an instance of the NodeReportsClient client. -func NewNodeReportsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) NodeReportsClient { - return NodeReportsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} +func NewNodeReportsClientWithBaseURI(baseURI string, subscriptionID string) NodeReportsClient { + return NodeReportsClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get retrieve the Dsc node report data by node id and report id. // -// automationAccountName is the automation account name. nodeID is the Dsc node id. reportID is the report id. -func (client NodeReportsClient) Get(ctx context.Context, automationAccountName string, nodeID string, reportID string) (result DscNodeReport, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. nodeID is +// the Dsc node id. reportID is the report id. +func (client NodeReportsClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, reportID string) (result DscNodeReport, 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.NodeReportsClient", "Get") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.NodeReportsClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, automationAccountName, nodeID, reportID) + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, nodeID, reportID) if err != nil { err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "Get", nil, "Failure preparing request") return @@ -72,12 +73,12 @@ func (client NodeReportsClient) Get(ctx context.Context, automationAccountName s } // GetPreparer prepares the Get request. -func (client NodeReportsClient) GetPreparer(ctx context.Context, automationAccountName string, nodeID string, reportID string) (*http.Request, error) { +func (client NodeReportsClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, reportID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "nodeId": autorest.Encode("path", nodeID), "reportId": autorest.Encode("path", reportID), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -116,15 +117,16 @@ func (client NodeReportsClient) GetResponder(resp *http.Response) (result DscNod // GetContent retrieve the Dsc node reports by node id and report id. // -// automationAccountName is the automation account name. nodeID is the Dsc node id. reportID is the report id. -func (client NodeReportsClient) GetContent(ctx context.Context, automationAccountName string, nodeID string, reportID string) (result ReadCloser, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. nodeID is +// the Dsc node id. reportID is the report id. +func (client NodeReportsClient) GetContent(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, reportID string) (result SetObject, 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.NodeReportsClient", "GetContent") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.NodeReportsClient", "GetContent", err.Error()) } - req, err := client.GetContentPreparer(ctx, automationAccountName, nodeID, reportID) + req, err := client.GetContentPreparer(ctx, resourceGroupName, automationAccountName, nodeID, reportID) if err != nil { err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "GetContent", nil, "Failure preparing request") return @@ -146,12 +148,12 @@ func (client NodeReportsClient) GetContent(ctx context.Context, automationAccoun } // GetContentPreparer prepares the GetContent request. -func (client NodeReportsClient) GetContentPreparer(ctx context.Context, automationAccountName string, nodeID string, reportID string) (*http.Request, error) { +func (client NodeReportsClient) GetContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, reportID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "nodeId": autorest.Encode("path", nodeID), "reportId": autorest.Encode("path", reportID), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -177,29 +179,30 @@ func (client NodeReportsClient) GetContentSender(req *http.Request) (*http.Respo // GetContentResponder handles the response to the GetContent request. The method always // closes the http.Response Body. -func (client NodeReportsClient) GetContentResponder(resp *http.Response) (result ReadCloser, err error) { - result.Value = &resp.Body +func (client NodeReportsClient) GetContentResponder(resp *http.Response) (result SetObject, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK)) + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // ListByNode retrieve the Dsc node report list by node id. // -// automationAccountName is the automation account name. nodeID is the parameters supplied to the list operation. -// filter is the filter to apply on the operation. -func (client NodeReportsClient) ListByNode(ctx context.Context, automationAccountName string, nodeID string, filter string) (result DscNodeReportListResultPage, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. nodeID is +// the parameters supplied to the list operation. filter is the filter to apply on the operation. +func (client NodeReportsClient) ListByNode(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, filter string) (result DscNodeReportListResultPage, 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.NodeReportsClient", "ListByNode") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.NodeReportsClient", "ListByNode", err.Error()) } result.fn = client.listByNodeNextResults - req, err := client.ListByNodePreparer(ctx, automationAccountName, nodeID, filter) + req, err := client.ListByNodePreparer(ctx, resourceGroupName, automationAccountName, nodeID, filter) if err != nil { err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "ListByNode", nil, "Failure preparing request") return @@ -221,11 +224,11 @@ func (client NodeReportsClient) ListByNode(ctx context.Context, automationAccoun } // ListByNodePreparer prepares the ListByNode request. -func (client NodeReportsClient) ListByNodePreparer(ctx context.Context, automationAccountName string, nodeID string, filter string) (*http.Request, error) { +func (client NodeReportsClient) ListByNodePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "nodeId": autorest.Encode("path", nodeID), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -287,7 +290,7 @@ func (client NodeReportsClient) listByNodeNextResults(lastResults DscNodeReportL } // ListByNodeComplete enumerates all values, automatically crossing page boundaries as required. -func (client NodeReportsClient) ListByNodeComplete(ctx context.Context, automationAccountName string, nodeID string, filter string) (result DscNodeReportListResultIterator, err error) { - result.page, err = client.ListByNode(ctx, automationAccountName, nodeID, filter) +func (client NodeReportsClient) ListByNodeComplete(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, filter string) (result DscNodeReportListResultIterator, err error) { + result.page, err = client.ListByNode(ctx, resourceGroupName, automationAccountName, nodeID, filter) return } 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..80f1cb735be0 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 @@ -31,27 +31,27 @@ type ObjectDataTypesClient struct { } // NewObjectDataTypesClient creates an instance of the ObjectDataTypesClient client. -func NewObjectDataTypesClient(subscriptionID string, resourceGroupName string) ObjectDataTypesClient { - return NewObjectDataTypesClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) +func NewObjectDataTypesClient(subscriptionID string) ObjectDataTypesClient { + return NewObjectDataTypesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewObjectDataTypesClientWithBaseURI creates an instance of the ObjectDataTypesClient client. -func NewObjectDataTypesClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) ObjectDataTypesClient { - return ObjectDataTypesClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} +func NewObjectDataTypesClientWithBaseURI(baseURI string, subscriptionID string) ObjectDataTypesClient { + return ObjectDataTypesClient{NewWithBaseURI(baseURI, subscriptionID)} } // ListFieldsByModuleAndType retrieve a list of fields of a given type identified by module name. // -// automationAccountName is the automation account name. moduleName is the name of module. typeName is the name of -// type. -func (client ObjectDataTypesClient) ListFieldsByModuleAndType(ctx context.Context, automationAccountName string, moduleName string, typeName string) (result TypeFieldListResult, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. moduleName +// is the name of module. typeName is the name of type. +func (client ObjectDataTypesClient) ListFieldsByModuleAndType(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, typeName string) (result TypeFieldListResult, 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.ObjectDataTypesClient", "ListFieldsByModuleAndType") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ObjectDataTypesClient", "ListFieldsByModuleAndType", err.Error()) } - req, err := client.ListFieldsByModuleAndTypePreparer(ctx, automationAccountName, moduleName, typeName) + req, err := client.ListFieldsByModuleAndTypePreparer(ctx, resourceGroupName, automationAccountName, moduleName, typeName) if err != nil { err = autorest.NewErrorWithError(err, "automation.ObjectDataTypesClient", "ListFieldsByModuleAndType", nil, "Failure preparing request") return @@ -73,11 +73,11 @@ func (client ObjectDataTypesClient) ListFieldsByModuleAndType(ctx context.Contex } // ListFieldsByModuleAndTypePreparer prepares the ListFieldsByModuleAndType request. -func (client ObjectDataTypesClient) ListFieldsByModuleAndTypePreparer(ctx context.Context, automationAccountName string, moduleName string, typeName string) (*http.Request, error) { +func (client ObjectDataTypesClient) ListFieldsByModuleAndTypePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, typeName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "moduleName": autorest.Encode("path", moduleName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "typeName": autorest.Encode("path", typeName), } @@ -117,15 +117,16 @@ func (client ObjectDataTypesClient) ListFieldsByModuleAndTypeResponder(resp *htt // ListFieldsByType retrieve a list of fields of a given type across all accessible modules. // -// automationAccountName is the automation account name. typeName is the name of type. -func (client ObjectDataTypesClient) ListFieldsByType(ctx context.Context, automationAccountName string, typeName string) (result TypeFieldListResult, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. typeName is +// the name of type. +func (client ObjectDataTypesClient) ListFieldsByType(ctx context.Context, resourceGroupName string, automationAccountName string, typeName string) (result TypeFieldListResult, 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.ObjectDataTypesClient", "ListFieldsByType") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ObjectDataTypesClient", "ListFieldsByType", err.Error()) } - req, err := client.ListFieldsByTypePreparer(ctx, automationAccountName, typeName) + req, err := client.ListFieldsByTypePreparer(ctx, resourceGroupName, automationAccountName, typeName) if err != nil { err = autorest.NewErrorWithError(err, "automation.ObjectDataTypesClient", "ListFieldsByType", nil, "Failure preparing request") return @@ -147,10 +148,10 @@ func (client ObjectDataTypesClient) ListFieldsByType(ctx context.Context, automa } // ListFieldsByTypePreparer prepares the ListFieldsByType request. -func (client ObjectDataTypesClient) ListFieldsByTypePreparer(ctx context.Context, automationAccountName string, typeName string) (*http.Request, error) { +func (client ObjectDataTypesClient) ListFieldsByTypePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, typeName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "typeName": autorest.Encode("path", typeName), } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/operations.go index facdcde19b97..b731c2d30ea0 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/operations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/operations.go @@ -30,13 +30,13 @@ type OperationsClient struct { } // NewOperationsClient creates an instance of the OperationsClient client. -func NewOperationsClient(subscriptionID string, resourceGroupName string) OperationsClient { - return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewOperationsClientWithBaseURI creates an instance of the OperationsClient client. -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) OperationsClient { - return OperationsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} } // List lists all of the available Automation REST API operations. 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..fc316a1d7c9a 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 @@ -31,23 +31,24 @@ type RunbookClient struct { } // NewRunbookClient creates an instance of the RunbookClient client. -func NewRunbookClient(subscriptionID string, resourceGroupName string) RunbookClient { - return NewRunbookClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) +func NewRunbookClient(subscriptionID string) RunbookClient { + return NewRunbookClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewRunbookClientWithBaseURI creates an instance of the RunbookClient client. -func NewRunbookClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) RunbookClient { - return RunbookClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} +func NewRunbookClientWithBaseURI(baseURI string, subscriptionID string) RunbookClient { + return RunbookClient{NewWithBaseURI(baseURI, subscriptionID)} } // 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. -func (client RunbookClient) CreateOrUpdate(ctx context.Context, automationAccountName string, runbookName string, parameters RunbookCreateOrUpdateParameters) (result autorest.Response, err error) { +// resourceGroupName is the resource group 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. +func (client RunbookClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters RunbookCreateOrUpdateParameters) (result Runbook, 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: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties.Draft", Name: validation.Null, Rule: false, @@ -65,10 +66,10 @@ 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) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, runbookName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.RunbookClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -76,7 +77,7 @@ func (client RunbookClient) CreateOrUpdate(ctx context.Context, automationAccoun resp, err := client.CreateOrUpdateSender(req) if err != nil { - result.Response = resp + result.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "automation.RunbookClient", "CreateOrUpdate", resp, "Failure sending request") return } @@ -90,10 +91,10 @@ func (client RunbookClient) CreateOrUpdate(ctx context.Context, automationAccoun } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client RunbookClient) CreateOrUpdatePreparer(ctx context.Context, automationAccountName string, runbookName string, parameters RunbookCreateOrUpdateParameters) (*http.Request, error) { +func (client RunbookClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters RunbookCreateOrUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -104,7 +105,7 @@ func (client RunbookClient) CreateOrUpdatePreparer(ctx context.Context, automati } 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.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}", pathParameters), @@ -122,27 +123,29 @@ func (client RunbookClient) CreateOrUpdateSender(req *http.Request) (*http.Respo // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. -func (client RunbookClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) { +func (client RunbookClient) CreateOrUpdateResponder(resp *http.Response) (result Runbook, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusBadRequest), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) - result.Response = resp + result.Response = autorest.Response{Response: resp} return } // Delete delete the runbook by name. // -// automationAccountName is the automation account name. runbookName is the runbook name. -func (client RunbookClient) Delete(ctx context.Context, automationAccountName string, runbookName string) (result autorest.Response, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName +// is the runbook name. +func (client RunbookClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName 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.RunbookClient", "Delete") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, automationAccountName, runbookName) + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, runbookName) if err != nil { err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Delete", nil, "Failure preparing request") return @@ -164,10 +167,10 @@ func (client RunbookClient) Delete(ctx context.Context, automationAccountName st } // DeletePreparer prepares the Delete request. -func (client RunbookClient) DeletePreparer(ctx context.Context, automationAccountName string, runbookName string) (*http.Request, error) { +func (client RunbookClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -198,7 +201,7 @@ func (client RunbookClient) DeleteResponder(resp *http.Response) (result autores err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return @@ -206,15 +209,16 @@ func (client RunbookClient) DeleteResponder(resp *http.Response) (result autores // Get retrieve the runbook identified by runbook name. // -// automationAccountName is the automation account name. runbookName is the runbook name. -func (client RunbookClient) Get(ctx context.Context, automationAccountName string, runbookName string) (result Runbook, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName +// is the runbook name. +func (client RunbookClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result Runbook, 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.RunbookClient", "Get") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, automationAccountName, runbookName) + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, runbookName) if err != nil { err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Get", nil, "Failure preparing request") return @@ -236,10 +240,10 @@ func (client RunbookClient) Get(ctx context.Context, automationAccountName strin } // GetPreparer prepares the Get request. -func (client RunbookClient) GetPreparer(ctx context.Context, automationAccountName string, runbookName string) (*http.Request, error) { +func (client RunbookClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -279,15 +283,16 @@ func (client RunbookClient) GetResponder(resp *http.Response) (result Runbook, e // GetContent retrieve the content of runbook identified by runbook name. // -// automationAccountName is the automation account name. runbookName is the runbook name. -func (client RunbookClient) GetContent(ctx context.Context, automationAccountName string, runbookName string) (result ReadCloser, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName +// is the runbook name. +func (client RunbookClient) GetContent(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result String, 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.RunbookClient", "GetContent") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookClient", "GetContent", err.Error()) } - req, err := client.GetContentPreparer(ctx, automationAccountName, runbookName) + req, err := client.GetContentPreparer(ctx, resourceGroupName, automationAccountName, runbookName) if err != nil { err = autorest.NewErrorWithError(err, "automation.RunbookClient", "GetContent", nil, "Failure preparing request") return @@ -309,10 +314,10 @@ func (client RunbookClient) GetContent(ctx context.Context, automationAccountNam } // GetContentPreparer prepares the GetContent request. -func (client RunbookClient) GetContentPreparer(ctx context.Context, automationAccountName string, runbookName string) (*http.Request, error) { +func (client RunbookClient) GetContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -339,28 +344,29 @@ func (client RunbookClient) GetContentSender(req *http.Request) (*http.Response, // GetContentResponder handles the response to the GetContent request. The method always // closes the http.Response Body. -func (client RunbookClient) GetContentResponder(resp *http.Response) (result ReadCloser, err error) { - result.Value = &resp.Body +func (client RunbookClient) GetContentResponder(resp *http.Response) (result String, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK)) + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // ListByAutomationAccount retrieve a list of runbooks. // -// automationAccountName is the automation account name. -func (client RunbookClient) ListByAutomationAccount(ctx context.Context, automationAccountName string) (result RunbookListResultPage, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +func (client RunbookClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result RunbookListResultPage, 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.RunbookClient", "ListByAutomationAccount") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName) + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) if err != nil { err = autorest.NewErrorWithError(err, "automation.RunbookClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -382,10 +388,10 @@ func (client RunbookClient) ListByAutomationAccount(ctx context.Context, automat } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client RunbookClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string) (*http.Request, error) { +func (client RunbookClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -444,23 +450,23 @@ func (client RunbookClient) listByAutomationAccountNextResults(lastResults Runbo } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client RunbookClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string) (result RunbookListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, automationAccountName) +func (client RunbookClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result RunbookListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) return } // Update update the runbook identified by runbook name. // -// automationAccountName is the automation account name. runbookName is the runbook name. parameters is the update -// parameters for runbook. -func (client RunbookClient) Update(ctx context.Context, automationAccountName string, runbookName string, parameters RunbookUpdateParameters) (result Runbook, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName +// is the runbook name. parameters is the update parameters for runbook. +func (client RunbookClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters RunbookUpdateParameters) (result Runbook, 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.RunbookClient", "Update") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookClient", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, automationAccountName, runbookName, parameters) + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, runbookName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Update", nil, "Failure preparing request") return @@ -482,10 +488,10 @@ func (client RunbookClient) Update(ctx context.Context, automationAccountName st } // UpdatePreparer prepares the Update request. -func (client RunbookClient) UpdatePreparer(ctx context.Context, automationAccountName string, runbookName string, parameters RunbookUpdateParameters) (*http.Request, error) { +func (client RunbookClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters RunbookUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -496,7 +502,7 @@ func (client RunbookClient) UpdatePreparer(ctx context.Context, automationAccoun } 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.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}", pathParameters), 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..b1bcf9e2ef5c 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 @@ -22,7 +22,6 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/validation" - "io" "net/http" ) @@ -32,47 +31,52 @@ type RunbookDraftClient struct { } // NewRunbookDraftClient creates an instance of the RunbookDraftClient client. -func NewRunbookDraftClient(subscriptionID string, resourceGroupName string) RunbookDraftClient { - return NewRunbookDraftClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) +func NewRunbookDraftClient(subscriptionID string) RunbookDraftClient { + return NewRunbookDraftClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewRunbookDraftClientWithBaseURI creates an instance of the RunbookDraftClient client. -func NewRunbookDraftClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) RunbookDraftClient { - return RunbookDraftClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} +func NewRunbookDraftClientWithBaseURI(baseURI string, subscriptionID string) RunbookDraftClient { + return RunbookDraftClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate updates the runbook draft with runbookStream as its content. +// Get retrieve the runbook draft identified by runbook name. // -// 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) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName +// is the runbook name. +func (client RunbookDraftClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result RunbookDraft, 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") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookDraftClient", "Get", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, automationAccountName, runbookName, runbookContent) + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, runbookName) if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "CreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Get", nil, "Failure preparing request") return } - result, err = client.CreateOrUpdateSender(req) + resp, err := client.GetSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "CreateOrUpdate", result.Response(), "Failure sending request") + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Get", resp, "Failure sending request") return } + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Get", resp, "Failure responding to request") + } + return } -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client RunbookDraftClient) CreateOrUpdatePreparer(ctx context.Context, automationAccountName string, runbookName string, runbookContent io.ReadCloser) (*http.Request, error) { +// GetPreparer prepares the Get request. +func (client RunbookDraftClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -83,77 +87,70 @@ func (client RunbookDraftClient) CreateOrUpdatePreparer(ctx context.Context, aut } preparer := autorest.CreatePreparer( - autorest.AsPut(), + autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content", pathParameters), - autorest.WithFile(runbookContent), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. -func (client RunbookDraftClient) CreateOrUpdateSender(req *http.Request) (future RunbookDraftCreateOrUpdateFuture, 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 +func (client RunbookDraftClient) GetSender(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 +// GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client RunbookDraftClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) { +func (client RunbookDraftClient) GetResponder(resp *http.Response) (result RunbookDraft, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) - result.Response = resp + result.Response = autorest.Response{Response: resp} return } -// Get retrieve the runbook draft identified by runbook name. +// GetContent retrieve the content of runbook draft identified by runbook name. // -// automationAccountName is the automation account name. runbookName is the runbook name. -func (client RunbookDraftClient) Get(ctx context.Context, automationAccountName string, runbookName string) (result RunbookDraft, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName +// is the runbook name. +func (client RunbookDraftClient) GetContent(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result String, 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", "Get") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookDraftClient", "GetContent", err.Error()) } - req, err := client.GetPreparer(ctx, automationAccountName, runbookName) + req, err := client.GetContentPreparer(ctx, resourceGroupName, automationAccountName, runbookName) if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "GetContent", nil, "Failure preparing request") return } - resp, err := client.GetSender(req) + resp, err := client.GetContentSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "GetContent", resp, "Failure sending request") return } - result, err = client.GetResponder(resp) + result, err = client.GetContentResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "GetContent", resp, "Failure responding to request") } return } -// GetPreparer prepares the Get request. -func (client RunbookDraftClient) GetPreparer(ctx context.Context, automationAccountName string, runbookName string) (*http.Request, error) { +// GetContentPreparer prepares the GetContent request. +func (client RunbookDraftClient) GetContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -166,67 +163,62 @@ func (client RunbookDraftClient) GetPreparer(ctx context.Context, automationAcco preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetSender sends the Get request. The method will close the +// GetContentSender sends the GetContent request. The method will close the // http.Response Body if it receives an error. -func (client RunbookDraftClient) GetSender(req *http.Request) (*http.Response, error) { +func (client RunbookDraftClient) GetContentSender(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 +// GetContentResponder handles the response to the GetContent request. The method always // closes the http.Response Body. -func (client RunbookDraftClient) GetResponder(resp *http.Response) (result RunbookDraft, err error) { +func (client RunbookDraftClient) GetContentResponder(resp *http.Response) (result String, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// GetContent retrieve the content of runbook draft identified by runbook name. +// Publish publish runbook draft. // -// automationAccountName is the automation account name. runbookName is the runbook name. -func (client RunbookDraftClient) GetContent(ctx context.Context, automationAccountName string, runbookName string) (result ReadCloser, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName +// is the parameters supplied to the publish runbook operation. +func (client RunbookDraftClient) Publish(ctx context.Context, resourceGroupName string, 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", "GetContent") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookDraftClient", "Publish", err.Error()) } - req, err := client.GetContentPreparer(ctx, automationAccountName, runbookName) + req, err := client.PublishPreparer(ctx, resourceGroupName, automationAccountName, runbookName) if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "GetContent", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Publish", nil, "Failure preparing request") return } - resp, err := client.GetContentSender(req) + result, err = client.PublishSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "GetContent", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Publish", result.Response(), "Failure sending request") return } - result, err = client.GetContentResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "GetContent", resp, "Failure responding to request") - } - return } -// GetContentPreparer prepares the GetContent request. -func (client RunbookDraftClient) GetContentPreparer(ctx context.Context, automationAccountName string, runbookName string) (*http.Request, error) { +// PublishPreparer prepares the Publish request. +func (client RunbookDraftClient) PublishPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -237,63 +229,71 @@ func (client RunbookDraftClient) GetContentPreparer(ctx context.Context, automat } preparer := autorest.CreatePreparer( - autorest.AsGet(), + autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/publish", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetContentSender sends the GetContent request. The method will close the +// PublishSender sends the Publish request. The method will close the // http.Response Body if it receives an error. -func (client RunbookDraftClient) GetContentSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) +func (client RunbookDraftClient) PublishSender(req *http.Request) (future RunbookDraftPublishFuture, 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 } -// GetContentResponder handles the response to the GetContent request. The method always +// PublishResponder handles the response to the Publish request. The method always // closes the http.Response Body. -func (client RunbookDraftClient) GetContentResponder(resp *http.Response) (result ReadCloser, err error) { - result.Value = &resp.Body +func (client RunbookDraftClient) PublishResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK)) - result.Response = autorest.Response{Response: resp} + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp return } -// Publish publish runbook draft. +// ReplaceContent replaces the runbook draft content. // -// 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) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName +// is the runbook name. runbookContent is the runbook draft content. +func (client RunbookDraftClient) ReplaceContent(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, runbookContent string) (result RunbookDraftReplaceContentFuture, 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") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookDraftClient", "ReplaceContent", err.Error()) } - req, err := client.PublishPreparer(ctx, automationAccountName, runbookName) + req, err := client.ReplaceContentPreparer(ctx, resourceGroupName, automationAccountName, runbookName, runbookContent) if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Publish", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "ReplaceContent", nil, "Failure preparing request") return } - result, err = client.PublishSender(req) + result, err = client.ReplaceContentSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Publish", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "ReplaceContent", result.Response(), "Failure sending request") return } return } -// PublishPreparer prepares the Publish request. -func (client RunbookDraftClient) PublishPreparer(ctx context.Context, automationAccountName string, runbookName string) (*http.Request, error) { +// ReplaceContentPreparer prepares the ReplaceContent request. +func (client RunbookDraftClient) ReplaceContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, runbookContent string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -304,16 +304,18 @@ func (client RunbookDraftClient) PublishPreparer(ctx context.Context, automation } preparer := autorest.CreatePreparer( - autorest.AsPost(), + autorest.AsContentType("text/powershell"), + autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/publish", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content", pathParameters), + autorest.WithJSON(runbookContent), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// PublishSender sends the Publish request. The method will close the +// ReplaceContentSender sends the ReplaceContent request. The method will close the // http.Response Body if it receives an error. -func (client RunbookDraftClient) PublishSender(req *http.Request) (future RunbookDraftPublishFuture, err error) { +func (client RunbookDraftClient) ReplaceContentSender(req *http.Request) (future RunbookDraftReplaceContentFuture, err error) { sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) future.Future = azure.NewFuture(req) future.req = req @@ -326,30 +328,30 @@ func (client RunbookDraftClient) PublishSender(req *http.Request) (future Runboo return } -// PublishResponder handles the response to the Publish request. The method always +// ReplaceContentResponder handles the response to the ReplaceContent request. The method always // closes the http.Response Body. -func (client RunbookDraftClient) PublishResponder(resp *http.Response) (result Runbook, err error) { +func (client RunbookDraftClient) ReplaceContentResponder(resp *http.Response) (result autorest.Response, 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} + result.Response = resp return } -// UndoEdit retrieve the runbook identified by runbook name. +// UndoEdit undo draft edit to last known published state identified by runbook name. // -// automationAccountName is the automation account name. runbookName is the runbook name. -func (client RunbookDraftClient) UndoEdit(ctx context.Context, automationAccountName string, runbookName string) (result RunbookDraftUndoEditResult, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName +// is the runbook name. +func (client RunbookDraftClient) UndoEdit(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result RunbookDraftUndoEditResult, 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", "UndoEdit") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookDraftClient", "UndoEdit", err.Error()) } - req, err := client.UndoEditPreparer(ctx, automationAccountName, runbookName) + req, err := client.UndoEditPreparer(ctx, resourceGroupName, automationAccountName, runbookName) if err != nil { err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "UndoEdit", nil, "Failure preparing request") return @@ -371,10 +373,10 @@ func (client RunbookDraftClient) UndoEdit(ctx context.Context, automationAccount } // UndoEditPreparer prepares the UndoEdit request. -func (client RunbookDraftClient) UndoEditPreparer(ctx context.Context, automationAccountName string, runbookName string) (*http.Request, error) { +func (client RunbookDraftClient) UndoEditPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } 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..ee673e96001e 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 @@ -31,31 +31,31 @@ type ScheduleClient struct { } // NewScheduleClient creates an instance of the ScheduleClient client. -func NewScheduleClient(subscriptionID string, resourceGroupName string) ScheduleClient { - return NewScheduleClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) +func NewScheduleClient(subscriptionID string) ScheduleClient { + return NewScheduleClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewScheduleClientWithBaseURI creates an instance of the ScheduleClient client. -func NewScheduleClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) ScheduleClient { - return ScheduleClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} +func NewScheduleClientWithBaseURI(baseURI string, subscriptionID string) ScheduleClient { + return ScheduleClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate create a schedule. // -// automationAccountName is the automation account name. scheduleName is the schedule name. parameters is the -// parameters supplied to the create or update schedule operation. -func (client ScheduleClient) CreateOrUpdate(ctx context.Context, automationAccountName string, scheduleName string, parameters ScheduleCreateOrUpdateParameters) (result Schedule, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. scheduleName +// is the schedule name. parameters is the parameters supplied to the create or update schedule operation. +func (client ScheduleClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string, parameters ScheduleCreateOrUpdateParameters) (result Schedule, 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: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, 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) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, scheduleName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -77,10 +77,10 @@ func (client ScheduleClient) CreateOrUpdate(ctx context.Context, automationAccou } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ScheduleClient) CreateOrUpdatePreparer(ctx context.Context, automationAccountName string, scheduleName string, parameters ScheduleCreateOrUpdateParameters) (*http.Request, error) { +func (client ScheduleClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string, parameters ScheduleCreateOrUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "scheduleName": autorest.Encode("path", scheduleName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -91,7 +91,7 @@ func (client ScheduleClient) CreateOrUpdatePreparer(ctx context.Context, automat } 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.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}", pathParameters), @@ -122,15 +122,16 @@ func (client ScheduleClient) CreateOrUpdateResponder(resp *http.Response) (resul // Delete delete the schedule identified by schedule name. // -// automationAccountName is the automation account name. scheduleName is the schedule name. -func (client ScheduleClient) Delete(ctx context.Context, automationAccountName string, scheduleName string) (result autorest.Response, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. scheduleName +// is the schedule name. +func (client ScheduleClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName 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.ScheduleClient", "Delete") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ScheduleClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, automationAccountName, scheduleName) + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, scheduleName) if err != nil { err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Delete", nil, "Failure preparing request") return @@ -152,10 +153,10 @@ func (client ScheduleClient) Delete(ctx context.Context, automationAccountName s } // DeletePreparer prepares the Delete request. -func (client ScheduleClient) DeletePreparer(ctx context.Context, automationAccountName string, scheduleName string) (*http.Request, error) { +func (client ScheduleClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "scheduleName": autorest.Encode("path", scheduleName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -194,15 +195,16 @@ func (client ScheduleClient) DeleteResponder(resp *http.Response) (result autore // Get retrieve the schedule identified by schedule name. // -// automationAccountName is the automation account name. scheduleName is the schedule name. -func (client ScheduleClient) Get(ctx context.Context, automationAccountName string, scheduleName string) (result Schedule, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. scheduleName +// is the schedule name. +func (client ScheduleClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string) (result Schedule, 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.ScheduleClient", "Get") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ScheduleClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, automationAccountName, scheduleName) + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, scheduleName) if err != nil { err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Get", nil, "Failure preparing request") return @@ -224,10 +226,10 @@ func (client ScheduleClient) Get(ctx context.Context, automationAccountName stri } // GetPreparer prepares the Get request. -func (client ScheduleClient) GetPreparer(ctx context.Context, automationAccountName string, scheduleName string) (*http.Request, error) { +func (client ScheduleClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "scheduleName": autorest.Encode("path", scheduleName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -267,16 +269,16 @@ func (client ScheduleClient) GetResponder(resp *http.Response) (result Schedule, // ListByAutomationAccount retrieve a list of schedules. // -// automationAccountName is the automation account name. -func (client ScheduleClient) ListByAutomationAccount(ctx context.Context, automationAccountName string) (result ScheduleListResultPage, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +func (client ScheduleClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result ScheduleListResultPage, 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.ScheduleClient", "ListByAutomationAccount") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ScheduleClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName) + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) if err != nil { err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -298,10 +300,10 @@ func (client ScheduleClient) ListByAutomationAccount(ctx context.Context, automa } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client ScheduleClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string) (*http.Request, error) { +func (client ScheduleClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -360,23 +362,23 @@ func (client ScheduleClient) listByAutomationAccountNextResults(lastResults Sche } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client ScheduleClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string) (result ScheduleListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, automationAccountName) +func (client ScheduleClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result ScheduleListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) return } // Update update the schedule identified by schedule name. // -// automationAccountName is the automation account name. scheduleName is the schedule name. parameters is the -// parameters supplied to the update schedule operation. -func (client ScheduleClient) Update(ctx context.Context, automationAccountName string, scheduleName string, parameters ScheduleUpdateParameters) (result Schedule, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. scheduleName +// is the schedule name. parameters is the parameters supplied to the update schedule operation. +func (client ScheduleClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string, parameters ScheduleUpdateParameters) (result Schedule, 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.ScheduleClient", "Update") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ScheduleClient", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, automationAccountName, scheduleName, parameters) + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, scheduleName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Update", nil, "Failure preparing request") return @@ -398,10 +400,10 @@ func (client ScheduleClient) Update(ctx context.Context, automationAccountName s } // UpdatePreparer prepares the Update request. -func (client ScheduleClient) UpdatePreparer(ctx context.Context, automationAccountName string, scheduleName string, parameters ScheduleUpdateParameters) (*http.Request, error) { +func (client ScheduleClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string, parameters ScheduleUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "scheduleName": autorest.Encode("path", scheduleName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -412,7 +414,7 @@ func (client ScheduleClient) UpdatePreparer(ctx context.Context, automationAccou } 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.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}", pathParameters), 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..4ebfa7f129f5 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 @@ -31,24 +31,24 @@ type StatisticsClient struct { } // NewStatisticsClient creates an instance of the StatisticsClient client. -func NewStatisticsClient(subscriptionID string, resourceGroupName string) StatisticsClient { - return NewStatisticsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) +func NewStatisticsClient(subscriptionID string) StatisticsClient { + return NewStatisticsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewStatisticsClientWithBaseURI creates an instance of the StatisticsClient client. -func NewStatisticsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) StatisticsClient { - return StatisticsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} +func NewStatisticsClientWithBaseURI(baseURI string, subscriptionID string) StatisticsClient { + return StatisticsClient{NewWithBaseURI(baseURI, subscriptionID)} } // 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/testjob.go similarity index 55% rename from vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/testjobs.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/testjob.go index 17d11ca09edc..63af34493587 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/testjob.go @@ -25,60 +25,59 @@ import ( "net/http" ) -// TestJobsClient is the automation Client -type TestJobsClient struct { +// TestJobClient is the automation Client +type TestJobClient struct { BaseClient } -// NewTestJobsClient creates an instance of the TestJobsClient client. -func NewTestJobsClient(subscriptionID string, resourceGroupName string) TestJobsClient { - return NewTestJobsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) +// NewTestJobClient creates an instance of the TestJobClient client. +func NewTestJobClient(subscriptionID string) TestJobClient { + return NewTestJobClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewTestJobsClientWithBaseURI creates an instance of the TestJobsClient client. -func NewTestJobsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) TestJobsClient { - return TestJobsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} +// NewTestJobClientWithBaseURI creates an instance of the TestJobClient client. +func NewTestJobClientWithBaseURI(baseURI string, subscriptionID string) TestJobClient { + return TestJobClient{NewWithBaseURI(baseURI, subscriptionID)} } // 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. -func (client TestJobsClient) Create(ctx context.Context, automationAccountName string, runbookName string, parameters TestJobCreateParameters) (result TestJob, err error) { +// resourceGroupName is the resource group name. 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 TestJobClient) Create(ctx context.Context, resourceGroupName string, 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") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.TestJobClient", "Create", err.Error()) } - req, err := client.CreatePreparer(ctx, automationAccountName, runbookName, parameters) + req, err := client.CreatePreparer(ctx, resourceGroupName, automationAccountName, runbookName, parameters) if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobsClient", "Create", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Create", nil, "Failure preparing request") return } resp, err := client.CreateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.TestJobsClient", "Create", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Create", resp, "Failure sending request") return } result, err = client.CreateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobsClient", "Create", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Create", resp, "Failure responding to request") } return } // CreatePreparer prepares the Create request. -func (client TestJobsClient) CreatePreparer(ctx context.Context, automationAccountName string, runbookName string, parameters TestJobCreateParameters) (*http.Request, error) { +func (client TestJobClient) CreatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters TestJobCreateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -89,7 +88,7 @@ func (client TestJobsClient) CreatePreparer(ctx context.Context, automationAccou } 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.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob", pathParameters), @@ -100,14 +99,14 @@ func (client TestJobsClient) CreatePreparer(ctx context.Context, automationAccou // CreateSender sends the Create request. The method will close the // http.Response Body if it receives an error. -func (client TestJobsClient) CreateSender(req *http.Request) (*http.Response, error) { +func (client TestJobClient) CreateSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // CreateResponder handles the response to the Create request. The method always // closes the http.Response Body. -func (client TestJobsClient) CreateResponder(resp *http.Response) (result TestJob, err error) { +func (client TestJobClient) CreateResponder(resp *http.Response) (result TestJob, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -120,40 +119,41 @@ func (client TestJobsClient) CreateResponder(resp *http.Response) (result TestJo // Get retrieve the test job for the specified runbook. // -// automationAccountName is the automation account name. runbookName is the runbook name. -func (client TestJobsClient) Get(ctx context.Context, automationAccountName string, runbookName string) (result TestJob, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName +// is the runbook name. +func (client TestJobClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (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}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "automation.TestJobsClient", "Get") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.TestJobClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, automationAccountName, runbookName) + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, runbookName) if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobsClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.TestJobsClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobsClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. -func (client TestJobsClient) GetPreparer(ctx context.Context, automationAccountName string, runbookName string) (*http.Request, error) { +func (client TestJobClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -173,14 +173,14 @@ func (client TestJobsClient) GetPreparer(ctx context.Context, automationAccountN // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. -func (client TestJobsClient) GetSender(req *http.Request) (*http.Response, error) { +func (client TestJobClient) 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 TestJobsClient) GetResponder(resp *http.Response) (result TestJob, err error) { +func (client TestJobClient) GetResponder(resp *http.Response) (result TestJob, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -193,40 +193,41 @@ func (client TestJobsClient) GetResponder(resp *http.Response) (result TestJob, // Resume resume the test job. // -// automationAccountName is the automation account name. runbookName is the runbook name. -func (client TestJobsClient) Resume(ctx context.Context, automationAccountName string, runbookName string) (result autorest.Response, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName +// is the runbook name. +func (client TestJobClient) Resume(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName 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.TestJobsClient", "Resume") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.TestJobClient", "Resume", err.Error()) } - req, err := client.ResumePreparer(ctx, automationAccountName, runbookName) + req, err := client.ResumePreparer(ctx, resourceGroupName, automationAccountName, runbookName) if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobsClient", "Resume", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Resume", nil, "Failure preparing request") return } resp, err := client.ResumeSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "automation.TestJobsClient", "Resume", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Resume", resp, "Failure sending request") return } result, err = client.ResumeResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobsClient", "Resume", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Resume", resp, "Failure responding to request") } return } // ResumePreparer prepares the Resume request. -func (client TestJobsClient) ResumePreparer(ctx context.Context, automationAccountName string, runbookName string) (*http.Request, error) { +func (client TestJobClient) ResumePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -246,14 +247,14 @@ func (client TestJobsClient) ResumePreparer(ctx context.Context, automationAccou // ResumeSender sends the Resume request. The method will close the // http.Response Body if it receives an error. -func (client TestJobsClient) ResumeSender(req *http.Request) (*http.Response, error) { +func (client TestJobClient) ResumeSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // ResumeResponder handles the response to the Resume request. The method always // closes the http.Response Body. -func (client TestJobsClient) ResumeResponder(resp *http.Response) (result autorest.Response, err error) { +func (client TestJobClient) ResumeResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -265,40 +266,41 @@ func (client TestJobsClient) ResumeResponder(resp *http.Response) (result autore // Stop stop the test job. // -// automationAccountName is the automation account name. runbookName is the runbook name. -func (client TestJobsClient) Stop(ctx context.Context, automationAccountName string, runbookName string) (result autorest.Response, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName +// is the runbook name. +func (client TestJobClient) Stop(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName 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.TestJobsClient", "Stop") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.TestJobClient", "Stop", err.Error()) } - req, err := client.StopPreparer(ctx, automationAccountName, runbookName) + req, err := client.StopPreparer(ctx, resourceGroupName, automationAccountName, runbookName) if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobsClient", "Stop", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Stop", nil, "Failure preparing request") return } resp, err := client.StopSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "automation.TestJobsClient", "Stop", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Stop", resp, "Failure sending request") return } result, err = client.StopResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobsClient", "Stop", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Stop", resp, "Failure responding to request") } return } // StopPreparer prepares the Stop request. -func (client TestJobsClient) StopPreparer(ctx context.Context, automationAccountName string, runbookName string) (*http.Request, error) { +func (client TestJobClient) StopPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -318,14 +320,14 @@ func (client TestJobsClient) StopPreparer(ctx context.Context, automationAccount // StopSender sends the Stop request. The method will close the // http.Response Body if it receives an error. -func (client TestJobsClient) StopSender(req *http.Request) (*http.Response, error) { +func (client TestJobClient) StopSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // StopResponder handles the response to the Stop request. The method always // closes the http.Response Body. -func (client TestJobsClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { +func (client TestJobClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -337,40 +339,41 @@ func (client TestJobsClient) StopResponder(resp *http.Response) (result autorest // Suspend suspend the test job. // -// automationAccountName is the automation account name. runbookName is the runbook name. -func (client TestJobsClient) Suspend(ctx context.Context, automationAccountName string, runbookName string) (result autorest.Response, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName +// is the runbook name. +func (client TestJobClient) Suspend(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName 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.TestJobsClient", "Suspend") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.TestJobClient", "Suspend", err.Error()) } - req, err := client.SuspendPreparer(ctx, automationAccountName, runbookName) + req, err := client.SuspendPreparer(ctx, resourceGroupName, automationAccountName, runbookName) if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobsClient", "Suspend", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Suspend", nil, "Failure preparing request") return } resp, err := client.SuspendSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "automation.TestJobsClient", "Suspend", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Suspend", resp, "Failure sending request") return } result, err = client.SuspendResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobsClient", "Suspend", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Suspend", resp, "Failure responding to request") } return } // SuspendPreparer prepares the Suspend request. -func (client TestJobsClient) SuspendPreparer(ctx context.Context, automationAccountName string, runbookName string) (*http.Request, error) { +func (client TestJobClient) SuspendPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -390,14 +393,14 @@ func (client TestJobsClient) SuspendPreparer(ctx context.Context, automationAcco // SuspendSender sends the Suspend request. The method will close the // http.Response Body if it receives an error. -func (client TestJobsClient) SuspendSender(req *http.Request) (*http.Response, error) { +func (client TestJobClient) SuspendSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // SuspendResponder handles the response to the Suspend request. The method always // closes the http.Response Body. -func (client TestJobsClient) SuspendResponder(resp *http.Response) (result autorest.Response, err error) { +func (client TestJobClient) SuspendResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), 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..5c7f9707cb26 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 @@ -31,27 +31,27 @@ type TestJobStreamsClient struct { } // NewTestJobStreamsClient creates an instance of the TestJobStreamsClient client. -func NewTestJobStreamsClient(subscriptionID string, resourceGroupName string) TestJobStreamsClient { - return NewTestJobStreamsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) +func NewTestJobStreamsClient(subscriptionID string) TestJobStreamsClient { + return NewTestJobStreamsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewTestJobStreamsClientWithBaseURI creates an instance of the TestJobStreamsClient client. -func NewTestJobStreamsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) TestJobStreamsClient { - return TestJobStreamsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} +func NewTestJobStreamsClientWithBaseURI(baseURI string, subscriptionID string) TestJobStreamsClient { + return TestJobStreamsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Get retrieve a test job streams identified by runbook name and stream id. +// Get retrieve a test job stream of the test job identified by runbook name and 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) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName +// is the runbook name. jobStreamID is the job stream id. +func (client TestJobStreamsClient) Get(ctx context.Context, resourceGroupName string, 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") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.TestJobStreamsClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, automationAccountName, runbookName, jobStreamID) + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, runbookName, jobStreamID) if err != nil { err = autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "Get", nil, "Failure preparing request") return @@ -73,11 +73,11 @@ func (client TestJobStreamsClient) Get(ctx context.Context, automationAccountNam } // GetPreparer prepares the Get request. -func (client TestJobStreamsClient) GetPreparer(ctx context.Context, automationAccountName string, runbookName string, jobStreamID string) (*http.Request, error) { +func (client TestJobStreamsClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, jobStreamID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "jobStreamId": autorest.Encode("path", jobStreamID), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -117,17 +117,17 @@ 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. -func (client TestJobStreamsClient) ListByTestJob(ctx context.Context, automationAccountName string, runbookName string, filter string) (result JobStreamListResultPage, err error) { +// resourceGroupName is the resource group name. 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, resourceGroupName string, 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") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.TestJobStreamsClient", "ListByTestJob", err.Error()) } result.fn = client.listByTestJobNextResults - req, err := client.ListByTestJobPreparer(ctx, automationAccountName, runbookName, filter) + req, err := client.ListByTestJobPreparer(ctx, resourceGroupName, automationAccountName, runbookName, filter) if err != nil { err = autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "ListByTestJob", nil, "Failure preparing request") return @@ -149,10 +149,10 @@ func (client TestJobStreamsClient) ListByTestJob(ctx context.Context, automation } // ListByTestJobPreparer prepares the ListByTestJob request. -func (client TestJobStreamsClient) ListByTestJobPreparer(ctx context.Context, automationAccountName string, runbookName string, filter string) (*http.Request, error) { +func (client TestJobStreamsClient) ListByTestJobPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -215,7 +215,7 @@ func (client TestJobStreamsClient) listByTestJobNextResults(lastResults JobStrea } // ListByTestJobComplete enumerates all values, automatically crossing page boundaries as required. -func (client TestJobStreamsClient) ListByTestJobComplete(ctx context.Context, automationAccountName string, runbookName string, filter string) (result JobStreamListResultIterator, err error) { - result.page, err = client.ListByTestJob(ctx, automationAccountName, runbookName, filter) +func (client TestJobStreamsClient) ListByTestJobComplete(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, filter string) (result JobStreamListResultIterator, err error) { + result.page, err = client.ListByTestJob(ctx, resourceGroupName, automationAccountName, runbookName, filter) return } 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..9c8726a20aef 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 @@ -31,13 +31,13 @@ type UsagesClient struct { } // NewUsagesClient creates an instance of the UsagesClient client. -func NewUsagesClient(subscriptionID string, resourceGroupName string) UsagesClient { - return NewUsagesClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) +func NewUsagesClient(subscriptionID string) UsagesClient { + return NewUsagesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewUsagesClientWithBaseURI creates an instance of the UsagesClient client. -func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) UsagesClient { - return UsagesClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} +func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string) UsagesClient { + return UsagesClient{NewWithBaseURI(baseURI, subscriptionID)} } // ListByAutomationAccount retrieve the usage for the account id. @@ -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..e957827d4a3f 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 @@ -31,30 +31,30 @@ type VariableClient struct { } // NewVariableClient creates an instance of the VariableClient client. -func NewVariableClient(subscriptionID string, resourceGroupName string) VariableClient { - return NewVariableClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) +func NewVariableClient(subscriptionID string) VariableClient { + return NewVariableClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewVariableClientWithBaseURI creates an instance of the VariableClient client. -func NewVariableClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) VariableClient { - return VariableClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} +func NewVariableClientWithBaseURI(baseURI string, subscriptionID string) VariableClient { + return VariableClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate create a variable. // -// automationAccountName is the automation account name. variableName is the variable name. parameters is the -// parameters supplied to the create or update variable operation. -func (client VariableClient) CreateOrUpdate(ctx context.Context, automationAccountName string, variableName string, parameters VariableCreateOrUpdateParameters) (result Variable, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. variableName +// is the variable name. parameters is the parameters supplied to the create or update variable operation. +func (client VariableClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string, parameters VariableCreateOrUpdateParameters) (result Variable, 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: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {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) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, variableName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.VariableClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -76,10 +76,10 @@ func (client VariableClient) CreateOrUpdate(ctx context.Context, automationAccou } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VariableClient) CreateOrUpdatePreparer(ctx context.Context, automationAccountName string, variableName string, parameters VariableCreateOrUpdateParameters) (*http.Request, error) { +func (client VariableClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string, parameters VariableCreateOrUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "variableName": autorest.Encode("path", variableName), } @@ -90,7 +90,7 @@ func (client VariableClient) CreateOrUpdatePreparer(ctx context.Context, automat } 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.Automation/automationAccounts/{automationAccountName}/variables/{variableName}", pathParameters), @@ -121,15 +121,16 @@ func (client VariableClient) CreateOrUpdateResponder(resp *http.Response) (resul // Delete delete the variable. // -// automationAccountName is the automation account name. variableName is the name of variable. -func (client VariableClient) Delete(ctx context.Context, automationAccountName string, variableName string) (result autorest.Response, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. variableName +// is the name of variable. +func (client VariableClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, variableName 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.VariableClient", "Delete") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.VariableClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, automationAccountName, variableName) + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, variableName) if err != nil { err = autorest.NewErrorWithError(err, "automation.VariableClient", "Delete", nil, "Failure preparing request") return @@ -151,10 +152,10 @@ func (client VariableClient) Delete(ctx context.Context, automationAccountName s } // DeletePreparer prepares the Delete request. -func (client VariableClient) DeletePreparer(ctx context.Context, automationAccountName string, variableName string) (*http.Request, error) { +func (client VariableClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "variableName": autorest.Encode("path", variableName), } @@ -193,15 +194,16 @@ func (client VariableClient) DeleteResponder(resp *http.Response) (result autore // Get retrieve the variable identified by variable name. // -// automationAccountName is the automation account name. variableName is the name of variable. -func (client VariableClient) Get(ctx context.Context, automationAccountName string, variableName string) (result Variable, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. variableName +// is the name of variable. +func (client VariableClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string) (result Variable, 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.VariableClient", "Get") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.VariableClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, automationAccountName, variableName) + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, variableName) if err != nil { err = autorest.NewErrorWithError(err, "automation.VariableClient", "Get", nil, "Failure preparing request") return @@ -223,10 +225,10 @@ func (client VariableClient) Get(ctx context.Context, automationAccountName stri } // GetPreparer prepares the Get request. -func (client VariableClient) GetPreparer(ctx context.Context, automationAccountName string, variableName string) (*http.Request, error) { +func (client VariableClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "variableName": autorest.Encode("path", variableName), } @@ -266,16 +268,16 @@ func (client VariableClient) GetResponder(resp *http.Response) (result Variable, // ListByAutomationAccount retrieve a list of variables. // -// automationAccountName is the automation account name. -func (client VariableClient) ListByAutomationAccount(ctx context.Context, automationAccountName string) (result VariableListResultPage, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +func (client VariableClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result VariableListResultPage, 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.VariableClient", "ListByAutomationAccount") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.VariableClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName) + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) if err != nil { err = autorest.NewErrorWithError(err, "automation.VariableClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -297,10 +299,10 @@ func (client VariableClient) ListByAutomationAccount(ctx context.Context, automa } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client VariableClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string) (*http.Request, error) { +func (client VariableClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -359,23 +361,23 @@ func (client VariableClient) listByAutomationAccountNextResults(lastResults Vari } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client VariableClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string) (result VariableListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, automationAccountName) +func (client VariableClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result VariableListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) return } // Update update a variable. // -// automationAccountName is the automation account name. variableName is the variable name. parameters is the -// parameters supplied to the update variable operation. -func (client VariableClient) Update(ctx context.Context, automationAccountName string, variableName string, parameters VariableUpdateParameters) (result Variable, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. variableName +// is the variable name. parameters is the parameters supplied to the update variable operation. +func (client VariableClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string, parameters VariableUpdateParameters) (result Variable, 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.VariableClient", "Update") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.VariableClient", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, automationAccountName, variableName, parameters) + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, variableName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.VariableClient", "Update", nil, "Failure preparing request") return @@ -397,10 +399,10 @@ func (client VariableClient) Update(ctx context.Context, automationAccountName s } // UpdatePreparer prepares the Update request. -func (client VariableClient) UpdatePreparer(ctx context.Context, automationAccountName string, variableName string, parameters VariableUpdateParameters) (*http.Request, error) { +func (client VariableClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string, parameters VariableUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "variableName": autorest.Encode("path", variableName), } @@ -411,7 +413,7 @@ func (client VariableClient) UpdatePreparer(ctx context.Context, automationAccou } 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.Automation/automationAccounts/{automationAccountName}/variables/{variableName}", pathParameters), 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..e55131849aba 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 @@ -31,30 +31,30 @@ type WebhookClient struct { } // NewWebhookClient creates an instance of the WebhookClient client. -func NewWebhookClient(subscriptionID string, resourceGroupName string) WebhookClient { - return NewWebhookClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) +func NewWebhookClient(subscriptionID string) WebhookClient { + return NewWebhookClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewWebhookClientWithBaseURI creates an instance of the WebhookClient client. -func NewWebhookClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) WebhookClient { - return WebhookClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} +func NewWebhookClientWithBaseURI(baseURI string, subscriptionID string) WebhookClient { + return WebhookClient{NewWithBaseURI(baseURI, subscriptionID)} } // 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. -func (client WebhookClient) CreateOrUpdate(ctx context.Context, automationAccountName string, webhookName string, parameters WebhookCreateOrUpdateParameters) (result Webhook, err error) { +// resourceGroupName is the resource group name. 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, resourceGroupName string, automationAccountName string, webhookName string, parameters WebhookCreateOrUpdateParameters) (result Webhook, 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: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {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) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, webhookName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.WebhookClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -76,10 +76,10 @@ func (client WebhookClient) CreateOrUpdate(ctx context.Context, automationAccoun } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client WebhookClient) CreateOrUpdatePreparer(ctx context.Context, automationAccountName string, webhookName string, parameters WebhookCreateOrUpdateParameters) (*http.Request, error) { +func (client WebhookClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string, parameters WebhookCreateOrUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "webhookName": autorest.Encode("path", webhookName), } @@ -90,7 +90,7 @@ func (client WebhookClient) CreateOrUpdatePreparer(ctx context.Context, automati } 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.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}", pathParameters), @@ -121,15 +121,16 @@ func (client WebhookClient) CreateOrUpdateResponder(resp *http.Response) (result // Delete delete the webhook by name. // -// automationAccountName is the automation account name. webhookName is the webhook name. -func (client WebhookClient) Delete(ctx context.Context, automationAccountName string, webhookName string) (result autorest.Response, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. webhookName +// is the webhook name. +func (client WebhookClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName 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.WebhookClient", "Delete") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WebhookClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, automationAccountName, webhookName) + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, webhookName) if err != nil { err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Delete", nil, "Failure preparing request") return @@ -151,10 +152,10 @@ func (client WebhookClient) Delete(ctx context.Context, automationAccountName st } // DeletePreparer prepares the Delete request. -func (client WebhookClient) DeletePreparer(ctx context.Context, automationAccountName string, webhookName string) (*http.Request, error) { +func (client WebhookClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "webhookName": autorest.Encode("path", webhookName), } @@ -193,15 +194,15 @@ func (client WebhookClient) DeleteResponder(resp *http.Response) (result autores // GenerateURI generates a Uri for use in creating a webhook. // -// automationAccountName is the automation account name. -func (client WebhookClient) GenerateURI(ctx context.Context, automationAccountName string) (result String, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. +func (client WebhookClient) GenerateURI(ctx context.Context, resourceGroupName string, automationAccountName string) (result String, 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.WebhookClient", "GenerateURI") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WebhookClient", "GenerateURI", err.Error()) } - req, err := client.GenerateURIPreparer(ctx, automationAccountName) + req, err := client.GenerateURIPreparer(ctx, resourceGroupName, automationAccountName) if err != nil { err = autorest.NewErrorWithError(err, "automation.WebhookClient", "GenerateURI", nil, "Failure preparing request") return @@ -223,10 +224,10 @@ func (client WebhookClient) GenerateURI(ctx context.Context, automationAccountNa } // GenerateURIPreparer prepares the GenerateURI request. -func (client WebhookClient) GenerateURIPreparer(ctx context.Context, automationAccountName string) (*http.Request, error) { +func (client WebhookClient) GenerateURIPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -265,15 +266,16 @@ func (client WebhookClient) GenerateURIResponder(resp *http.Response) (result St // Get retrieve the webhook identified by webhook name. // -// automationAccountName is the automation account name. webhookName is the webhook name. -func (client WebhookClient) Get(ctx context.Context, automationAccountName string, webhookName string) (result Webhook, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. webhookName +// is the webhook name. +func (client WebhookClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string) (result Webhook, 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.WebhookClient", "Get") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WebhookClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, automationAccountName, webhookName) + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, webhookName) if err != nil { err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Get", nil, "Failure preparing request") return @@ -295,10 +297,10 @@ func (client WebhookClient) Get(ctx context.Context, automationAccountName strin } // GetPreparer prepares the Get request. -func (client WebhookClient) GetPreparer(ctx context.Context, automationAccountName string, webhookName string) (*http.Request, error) { +func (client WebhookClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "webhookName": autorest.Encode("path", webhookName), } @@ -338,16 +340,17 @@ func (client WebhookClient) GetResponder(resp *http.Response) (result Webhook, e // ListByAutomationAccount retrieve a list of webhooks. // -// automationAccountName is the automation account name. filter is the filter to apply on the operation. -func (client WebhookClient) ListByAutomationAccount(ctx context.Context, automationAccountName string, filter string) (result WebhookListResultPage, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. filter is +// the filter to apply on the operation. +func (client WebhookClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result WebhookListResultPage, 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.WebhookClient", "ListByAutomationAccount") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WebhookClient", "ListByAutomationAccount", err.Error()) } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName, filter) + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) if err != nil { err = autorest.NewErrorWithError(err, "automation.WebhookClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -369,10 +372,10 @@ func (client WebhookClient) ListByAutomationAccount(ctx context.Context, automat } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client WebhookClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string, filter string) (*http.Request, error) { +func (client WebhookClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -434,23 +437,23 @@ func (client WebhookClient) listByAutomationAccountNextResults(lastResults Webho } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client WebhookClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string, filter string) (result WebhookListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, automationAccountName, filter) +func (client WebhookClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result WebhookListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) return } // Update update the webhook identified by webhook name. // -// automationAccountName is the automation account name. webhookName is the webhook name. parameters is the update -// parameters for webhook. -func (client WebhookClient) Update(ctx context.Context, automationAccountName string, webhookName string, parameters WebhookUpdateParameters) (result Webhook, err error) { +// resourceGroupName is the resource group name. automationAccountName is the automation account name. webhookName +// is the webhook name. parameters is the update parameters for webhook. +func (client WebhookClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string, parameters WebhookUpdateParameters) (result Webhook, 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.WebhookClient", "Update") + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WebhookClient", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, automationAccountName, webhookName, parameters) + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, webhookName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Update", nil, "Failure preparing request") return @@ -472,10 +475,10 @@ func (client WebhookClient) Update(ctx context.Context, automationAccountName st } // UpdatePreparer prepares the Update request. -func (client WebhookClient) UpdatePreparer(ctx context.Context, automationAccountName string, webhookName string, parameters WebhookUpdateParameters) (*http.Request, error) { +func (client WebhookClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string, parameters WebhookUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "webhookName": autorest.Encode("path", webhookName), } @@ -486,7 +489,7 @@ func (client WebhookClient) UpdatePreparer(ctx context.Context, automationAccoun } 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.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}", pathParameters), 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..71684216b603 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) @@ -96,7 +96,7 @@ func (client BaseClient) CheckNameAvailabilityPreparer(ctx context.Context, chec } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPath("/providers/Microsoft.Cdn/checkNameAvailability"), @@ -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) @@ -170,7 +170,7 @@ func (client BaseClient) ValidateProbePreparer(ctx context.Context, validateProb } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/validateProbe", pathParameters), 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..72144d3a952d 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) @@ -90,7 +90,7 @@ func (client CustomDomainsClient) CreatePreparer(ctx context.Context, resourceGr } 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.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}", pathParameters), @@ -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..7f5f2db0764c 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) @@ -89,7 +89,7 @@ func (client EndpointsClient) CreatePreparer(ctx context.Context, resourceGroupN } 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.Cdn/profiles/{profileName}/endpoints/{endpointName}", pathParameters), @@ -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) @@ -538,7 +538,7 @@ func (client EndpointsClient) LoadContentPreparer(ctx context.Context, resourceG } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/load", pathParameters), @@ -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) @@ -622,7 +622,7 @@ func (client EndpointsClient) PurgeContentPreparer(ctx context.Context, resource } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/purge", pathParameters), @@ -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) @@ -862,7 +862,7 @@ func (client EndpointsClient) UpdatePreparer(ctx context.Context, resourceGroupN } 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.Cdn/profiles/{profileName}/endpoints/{endpointName}", pathParameters), @@ -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) @@ -951,7 +951,7 @@ func (client EndpointsClient) ValidateCustomDomainPreparer(ctx context.Context, } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/validateCustomDomain", pathParameters), 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..6c98c918c4d1 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 @@ -37,6 +37,11 @@ const ( Deleting CustomDomainResourceState = "Deleting" ) +// PossibleCustomDomainResourceStateValues returns an array of possible values for the CustomDomainResourceState const type. +func PossibleCustomDomainResourceStateValues() []CustomDomainResourceState { + return []CustomDomainResourceState{Active, Creating, Deleting} +} + // CustomHTTPSProvisioningState enumerates the values for custom https provisioning state. type CustomHTTPSProvisioningState string @@ -53,6 +58,11 @@ const ( Failed CustomHTTPSProvisioningState = "Failed" ) +// PossibleCustomHTTPSProvisioningStateValues returns an array of possible values for the CustomHTTPSProvisioningState const type. +func PossibleCustomHTTPSProvisioningStateValues() []CustomHTTPSProvisioningState { + return []CustomHTTPSProvisioningState{Disabled, Disabling, Enabled, Enabling, Failed} +} + // CustomHTTPSProvisioningSubstate enumerates the values for custom https provisioning substate. type CustomHTTPSProvisioningSubstate string @@ -79,6 +89,11 @@ const ( SubmittingDomainControlValidationRequest CustomHTTPSProvisioningSubstate = "SubmittingDomainControlValidationRequest" ) +// PossibleCustomHTTPSProvisioningSubstateValues returns an array of possible values for the CustomHTTPSProvisioningSubstate const type. +func PossibleCustomHTTPSProvisioningSubstateValues() []CustomHTTPSProvisioningSubstate { + return []CustomHTTPSProvisioningSubstate{CertificateDeleted, CertificateDeployed, DeletingCertificate, DeployingCertificate, DomainControlValidationRequestApproved, DomainControlValidationRequestRejected, DomainControlValidationRequestTimedOut, IssuingCertificate, PendingDomainControlValidationREquestApproval, SubmittingDomainControlValidationRequest} +} + // EndpointResourceState enumerates the values for endpoint resource state. type EndpointResourceState string @@ -97,6 +112,11 @@ const ( EndpointResourceStateStopping EndpointResourceState = "Stopping" ) +// PossibleEndpointResourceStateValues returns an array of possible values for the EndpointResourceState const type. +func PossibleEndpointResourceStateValues() []EndpointResourceState { + return []EndpointResourceState{EndpointResourceStateCreating, EndpointResourceStateDeleting, EndpointResourceStateRunning, EndpointResourceStateStarting, EndpointResourceStateStopped, EndpointResourceStateStopping} +} + // GeoFilterActions enumerates the values for geo filter actions. type GeoFilterActions string @@ -107,6 +127,11 @@ const ( Block GeoFilterActions = "Block" ) +// PossibleGeoFilterActionsValues returns an array of possible values for the GeoFilterActions const type. +func PossibleGeoFilterActionsValues() []GeoFilterActions { + return []GeoFilterActions{Allow, Block} +} + // OptimizationType enumerates the values for optimization type. type OptimizationType string @@ -123,6 +148,11 @@ const ( VideoOnDemandMediaStreaming OptimizationType = "VideoOnDemandMediaStreaming" ) +// PossibleOptimizationTypeValues returns an array of possible values for the OptimizationType const type. +func PossibleOptimizationTypeValues() []OptimizationType { + return []OptimizationType{DynamicSiteAcceleration, GeneralMediaStreaming, GeneralWebDelivery, LargeFileDownload, VideoOnDemandMediaStreaming} +} + // OriginResourceState enumerates the values for origin resource state. type OriginResourceState string @@ -135,6 +165,11 @@ const ( OriginResourceStateDeleting OriginResourceState = "Deleting" ) +// PossibleOriginResourceStateValues returns an array of possible values for the OriginResourceState const type. +func PossibleOriginResourceStateValues() []OriginResourceState { + return []OriginResourceState{OriginResourceStateActive, OriginResourceStateCreating, OriginResourceStateDeleting} +} + // ProfileResourceState enumerates the values for profile resource state. type ProfileResourceState string @@ -149,6 +184,11 @@ const ( ProfileResourceStateDisabled ProfileResourceState = "Disabled" ) +// PossibleProfileResourceStateValues returns an array of possible values for the ProfileResourceState const type. +func PossibleProfileResourceStateValues() []ProfileResourceState { + return []ProfileResourceState{ProfileResourceStateActive, ProfileResourceStateCreating, ProfileResourceStateDeleting, ProfileResourceStateDisabled} +} + // QueryStringCachingBehavior enumerates the values for query string caching behavior. type QueryStringCachingBehavior string @@ -163,6 +203,11 @@ const ( UseQueryString QueryStringCachingBehavior = "UseQueryString" ) +// PossibleQueryStringCachingBehaviorValues returns an array of possible values for the QueryStringCachingBehavior const type. +func PossibleQueryStringCachingBehaviorValues() []QueryStringCachingBehavior { + return []QueryStringCachingBehavior{BypassCaching, IgnoreQueryString, NotSet, UseQueryString} +} + // ResourceType enumerates the values for resource type. type ResourceType string @@ -171,6 +216,11 @@ const ( MicrosoftCdnProfilesEndpoints ResourceType = "Microsoft.Cdn/Profiles/Endpoints" ) +// PossibleResourceTypeValues returns an array of possible values for the ResourceType const type. +func PossibleResourceTypeValues() []ResourceType { + return []ResourceType{MicrosoftCdnProfilesEndpoints} +} + // SkuName enumerates the values for sku name. type SkuName string @@ -187,6 +237,11 @@ const ( StandardVerizon SkuName = "Standard_Verizon" ) +// PossibleSkuNameValues returns an array of possible values for the SkuName const type. +func PossibleSkuNameValues() []SkuName { + return []SkuName{CustomVerizon, PremiumVerizon, StandardAkamai, StandardChinaCdn, StandardVerizon} +} + // CheckNameAvailabilityInput input of CheckNameAvailability API. type CheckNameAvailabilityInput struct { // Name - The resource name to validate. @@ -214,17 +269,35 @@ 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"` +} + +// MarshalJSON is the custom marshaler for CustomDomain. +func (cd CustomDomain) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cd.CustomDomainProperties != nil { + objectMap["properties"] = cd.CustomDomainProperties + } + if cd.ID != nil { + objectMap["id"] = cd.ID + } + if cd.Name != nil { + objectMap["name"] = cd.Name + } + if cd.Type != nil { + objectMap["type"] = cd.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for CustomDomain struct. @@ -234,53 +307,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. @@ -387,6 +459,15 @@ type CustomDomainParameters struct { *CustomDomainPropertiesParameters `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for CustomDomainParameters. +func (cdp CustomDomainParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cdp.CustomDomainPropertiesParameters != nil { + objectMap["properties"] = cdp.CustomDomainPropertiesParameters + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for CustomDomainParameters struct. func (cdp *CustomDomainParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -394,16 +475,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 +526,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 +574,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 } @@ -500,6 +617,18 @@ type DeepCreatedOrigin struct { *DeepCreatedOriginProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for DeepCreatedOrigin. +func (dco DeepCreatedOrigin) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dco.Name != nil { + objectMap["name"] = dco.Name + } + if dco.DeepCreatedOriginProperties != nil { + objectMap["properties"] = dco.DeepCreatedOriginProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for DeepCreatedOrigin struct. func (dco *DeepCreatedOrigin) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -507,26 +636,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 + 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.Name = &name - } - - v = m["properties"] - if v != nil { - var properties DeepCreatedOriginProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - dco.DeepCreatedOriginProperties = &properties } return nil @@ -544,13 +674,31 @@ 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"` +} + +// MarshalJSON is the custom marshaler for EdgeNode. +func (en EdgeNode) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if en.EdgeNodeProperties != nil { + objectMap["properties"] = en.EdgeNodeProperties + } + if en.ID != nil { + objectMap["id"] = en.ID + } + if en.Name != nil { + objectMap["name"] = en.Name + } + if en.Type != nil { + objectMap["type"] = en.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for EdgeNode struct. @@ -560,46 +708,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 + 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.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 - } - en.Type = &typeVar } return nil @@ -611,8 +758,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 +862,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 +1077,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 +1105,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 +1143,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 +1191,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 +1239,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 +1288,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 +1336,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 +1384,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 +1432,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 +1494,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 + 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.Tags = &tags - } - - v = m["properties"] - if v != nil { - var properties EndpointPropertiesUpdateParameters - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - eup.EndpointPropertiesUpdateParameters = &properties } return nil @@ -1271,8 +1573,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 +1681,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 +1926,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 } @@ -1627,6 +1967,15 @@ type OriginUpdateParameters struct { *OriginPropertiesParameters `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for OriginUpdateParameters. +func (oup OriginUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if oup.OriginPropertiesParameters != nil { + objectMap["properties"] = oup.OriginPropertiesParameters + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for OriginUpdateParameters struct. func (oup *OriginUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -1634,16 +1983,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 +2004,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 +2247,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 +2295,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 +2343,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"` } -// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than required -// location and 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 type ProxyResource struct { // ID - Resource ID. ID *string `json:"id,omitempty"` @@ -2123,16 +2557,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..227b43f9af8a 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) @@ -270,7 +270,7 @@ func (client OriginsClient) UpdatePreparer(ctx context.Context, resourceGroupNam } 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.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}", pathParameters), 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..57531c889fa7 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) @@ -85,7 +85,7 @@ func (client ProfilesClient) CreatePreparer(ctx context.Context, resourceGroupNa } 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.Cdn/profiles/{profileName}", pathParameters), @@ -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) @@ -766,7 +766,7 @@ func (client ProfilesClient) UpdatePreparer(ctx context.Context, resourceGroupNa } 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.Cdn/profiles/{profileName}", pathParameters), 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/availabilitysets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/availabilitysets.go index f1f4cb5eb995..4cafe8d1e78b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/availabilitysets.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/availabilitysets.go @@ -79,7 +79,7 @@ func (client AvailabilitySetsClient) CreateOrUpdatePreparer(ctx context.Context, } 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.Compute/availabilitySets/{availabilitySetName}", pathParameters), @@ -371,3 +371,72 @@ func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Resp result.Response = autorest.Response{Response: resp} return } + +// Update update an availability set. +// +// resourceGroupName is the name of the resource group. availabilitySetName is the name of the availability set. +// parameters is parameters supplied to the Update Availability Set operation. +func (client AvailabilitySetsClient) Update(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySetUpdate) (result AvailabilitySet, err error) { + req, err := client.UpdatePreparer(ctx, resourceGroupName, availabilitySetName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client AvailabilitySetsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySetUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "availabilitySetName": autorest.Encode("path", availabilitySetName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", 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 AvailabilitySetsClient) 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 AvailabilitySetsClient) UpdateResponder(resp *http.Response) (result AvailabilitySet, 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/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..99f10b53a2fa 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) @@ -108,7 +107,7 @@ func (client ContainerServicesClient) CreateOrUpdatePreparer(ctx context.Context } 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.ContainerService/containerServices/{containerServiceName}", pathParameters), @@ -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..2ce6a54f516b 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) @@ -96,7 +97,7 @@ func (client DisksClient) CreateOrUpdatePreparer(ctx context.Context, resourceGr } 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.Compute/disks/{diskName}", pathParameters), @@ -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) @@ -313,7 +314,7 @@ func (client DisksClient) GrantAccessPreparer(ctx context.Context, resourceGroup } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess", pathParameters), @@ -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 { @@ -638,7 +640,7 @@ func (client DisksClient) UpdatePreparer(ctx context.Context, resourceGroupName } 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.Compute/disks/{diskName}", pathParameters), 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..5e8ff8d00eac 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) @@ -83,7 +83,7 @@ func (client ImagesClient) CreateOrUpdatePreparer(ctx context.Context, resourceG } 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.Compute/images/{imageName}", pathParameters), @@ -441,3 +441,74 @@ func (client ImagesClient) ListByResourceGroupComplete(ctx context.Context, reso result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) return } + +// Update update an image. +// +// resourceGroupName is the name of the resource group. imageName is the name of the image. parameters is +// parameters supplied to the Update Image operation. +func (client ImagesClient) Update(ctx context.Context, resourceGroupName string, imageName string, parameters ImageUpdate) (result ImagesUpdateFuture, err error) { + req, err := client.UpdatePreparer(ctx, resourceGroupName, imageName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ImagesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, imageName string, parameters ImageUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "imageName": autorest.Encode("path", imageName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}", 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 ImagesClient) UpdateSender(req *http.Request) (future ImagesUpdateFuture, 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)) + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ImagesClient) UpdateResponder(resp *http.Response) (result Image, 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/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..0be7ada9b934 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) @@ -80,7 +80,7 @@ func (client LogAnalyticsClient) ExportRequestRateByIntervalPreparer(ctx context } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getRequestRateByInterval", pathParameters), @@ -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) @@ -157,7 +157,7 @@ func (client LogAnalyticsClient) ExportThrottledRequestsPreparer(ctx context.Con } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getThrottledRequests", pathParameters), 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..f118190564b1 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" @@ -35,6 +36,11 @@ const ( Read AccessLevel = "Read" ) +// PossibleAccessLevelValues returns an array of possible values for the AccessLevel const type. +func PossibleAccessLevelValues() []AccessLevel { + return []AccessLevel{None, Read} +} + // CachingTypes enumerates the values for caching types. type CachingTypes string @@ -47,6 +53,11 @@ const ( CachingTypesReadWrite CachingTypes = "ReadWrite" ) +// PossibleCachingTypesValues returns an array of possible values for the CachingTypes const type. +func PossibleCachingTypesValues() []CachingTypes { + return []CachingTypes{CachingTypesNone, CachingTypesReadOnly, CachingTypesReadWrite} +} + // ComponentNames enumerates the values for component names. type ComponentNames string @@ -55,6 +66,11 @@ const ( MicrosoftWindowsShellSetup ComponentNames = "Microsoft-Windows-Shell-Setup" ) +// PossibleComponentNamesValues returns an array of possible values for the ComponentNames const type. +func PossibleComponentNamesValues() []ComponentNames { + return []ComponentNames{MicrosoftWindowsShellSetup} +} + // ContainerServiceOrchestratorTypes enumerates the values for container service orchestrator types. type ContainerServiceOrchestratorTypes string @@ -69,6 +85,11 @@ const ( Swarm ContainerServiceOrchestratorTypes = "Swarm" ) +// PossibleContainerServiceOrchestratorTypesValues returns an array of possible values for the ContainerServiceOrchestratorTypes const type. +func PossibleContainerServiceOrchestratorTypesValues() []ContainerServiceOrchestratorTypes { + return []ContainerServiceOrchestratorTypes{Custom, DCOS, Kubernetes, Swarm} +} + // ContainerServiceVMSizeTypes enumerates the values for container service vm size types. type ContainerServiceVMSizeTypes string @@ -169,6 +190,11 @@ const ( StandardGS5 ContainerServiceVMSizeTypes = "Standard_GS5" ) +// PossibleContainerServiceVMSizeTypesValues returns an array of possible values for the ContainerServiceVMSizeTypes const type. +func PossibleContainerServiceVMSizeTypesValues() []ContainerServiceVMSizeTypes { + return []ContainerServiceVMSizeTypes{StandardA0, StandardA1, StandardA10, StandardA11, StandardA2, StandardA3, StandardA4, StandardA5, StandardA6, StandardA7, StandardA8, StandardA9, StandardD1, StandardD11, StandardD11V2, StandardD12, StandardD12V2, StandardD13, StandardD13V2, StandardD14, StandardD14V2, StandardD1V2, StandardD2, StandardD2V2, StandardD3, StandardD3V2, StandardD4, StandardD4V2, StandardD5V2, StandardDS1, StandardDS11, StandardDS12, StandardDS13, StandardDS14, StandardDS2, StandardDS3, StandardDS4, StandardG1, StandardG2, StandardG3, StandardG4, StandardG5, StandardGS1, StandardGS2, StandardGS3, StandardGS4, StandardGS5} +} + // DiskCreateOption enumerates the values for disk create option. type DiskCreateOption string @@ -185,6 +211,11 @@ const ( Import DiskCreateOption = "Import" ) +// PossibleDiskCreateOptionValues returns an array of possible values for the DiskCreateOption const type. +func PossibleDiskCreateOptionValues() []DiskCreateOption { + return []DiskCreateOption{Attach, Copy, Empty, FromImage, Import} +} + // DiskCreateOptionTypes enumerates the values for disk create option types. type DiskCreateOptionTypes string @@ -197,6 +228,11 @@ const ( DiskCreateOptionTypesFromImage DiskCreateOptionTypes = "FromImage" ) +// PossibleDiskCreateOptionTypesValues returns an array of possible values for the DiskCreateOptionTypes const type. +func PossibleDiskCreateOptionTypesValues() []DiskCreateOptionTypes { + return []DiskCreateOptionTypes{DiskCreateOptionTypesAttach, DiskCreateOptionTypesEmpty, DiskCreateOptionTypesFromImage} +} + // InstanceViewTypes enumerates the values for instance view types. type InstanceViewTypes string @@ -205,6 +241,11 @@ const ( InstanceView InstanceViewTypes = "instanceView" ) +// PossibleInstanceViewTypesValues returns an array of possible values for the InstanceViewTypes const type. +func PossibleInstanceViewTypesValues() []InstanceViewTypes { + return []InstanceViewTypes{InstanceView} +} + // IntervalInMins enumerates the values for interval in mins. type IntervalInMins string @@ -219,6 +260,11 @@ const ( ThreeMins IntervalInMins = "ThreeMins" ) +// PossibleIntervalInMinsValues returns an array of possible values for the IntervalInMins const type. +func PossibleIntervalInMinsValues() []IntervalInMins { + return []IntervalInMins{FiveMins, SixtyMins, ThirtyMins, ThreeMins} +} + // IPVersion enumerates the values for ip version. type IPVersion string @@ -229,6 +275,11 @@ const ( IPv6 IPVersion = "IPv6" ) +// PossibleIPVersionValues returns an array of possible values for the IPVersion const type. +func PossibleIPVersionValues() []IPVersion { + return []IPVersion{IPv4, IPv6} +} + // MaintenanceOperationResultCodeTypes enumerates the values for maintenance operation result code types. type MaintenanceOperationResultCodeTypes string @@ -243,6 +294,11 @@ const ( MaintenanceOperationResultCodeTypesRetryLater MaintenanceOperationResultCodeTypes = "RetryLater" ) +// PossibleMaintenanceOperationResultCodeTypesValues returns an array of possible values for the MaintenanceOperationResultCodeTypes const type. +func PossibleMaintenanceOperationResultCodeTypesValues() []MaintenanceOperationResultCodeTypes { + return []MaintenanceOperationResultCodeTypes{MaintenanceOperationResultCodeTypesMaintenanceAborted, MaintenanceOperationResultCodeTypesMaintenanceCompleted, MaintenanceOperationResultCodeTypesNone, MaintenanceOperationResultCodeTypesRetryLater} +} + // OperatingSystemStateTypes enumerates the values for operating system state types. type OperatingSystemStateTypes string @@ -253,6 +309,11 @@ const ( Specialized OperatingSystemStateTypes = "Specialized" ) +// PossibleOperatingSystemStateTypesValues returns an array of possible values for the OperatingSystemStateTypes const type. +func PossibleOperatingSystemStateTypesValues() []OperatingSystemStateTypes { + return []OperatingSystemStateTypes{Generalized, Specialized} +} + // OperatingSystemTypes enumerates the values for operating system types. type OperatingSystemTypes string @@ -263,6 +324,11 @@ const ( Windows OperatingSystemTypes = "Windows" ) +// PossibleOperatingSystemTypesValues returns an array of possible values for the OperatingSystemTypes const type. +func PossibleOperatingSystemTypesValues() []OperatingSystemTypes { + return []OperatingSystemTypes{Linux, Windows} +} + // PassNames enumerates the values for pass names. type PassNames string @@ -271,6 +337,11 @@ const ( OobeSystem PassNames = "OobeSystem" ) +// PossiblePassNamesValues returns an array of possible values for the PassNames const type. +func PossiblePassNamesValues() []PassNames { + return []PassNames{OobeSystem} +} + // ProtocolTypes enumerates the values for protocol types. type ProtocolTypes string @@ -281,6 +352,11 @@ const ( HTTPS ProtocolTypes = "Https" ) +// PossibleProtocolTypesValues returns an array of possible values for the ProtocolTypes const type. +func PossibleProtocolTypesValues() []ProtocolTypes { + return []ProtocolTypes{HTTP, HTTPS} +} + // ResourceIdentityType enumerates the values for resource identity type. type ResourceIdentityType string @@ -295,6 +371,11 @@ const ( ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" ) +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{ResourceIdentityTypeNone, ResourceIdentityTypeSystemAssigned, ResourceIdentityTypeSystemAssignedUserAssigned, ResourceIdentityTypeUserAssigned} +} + // ResourceSkuCapacityScaleType enumerates the values for resource sku capacity scale type. type ResourceSkuCapacityScaleType string @@ -307,6 +388,11 @@ const ( ResourceSkuCapacityScaleTypeNone ResourceSkuCapacityScaleType = "None" ) +// PossibleResourceSkuCapacityScaleTypeValues returns an array of possible values for the ResourceSkuCapacityScaleType const type. +func PossibleResourceSkuCapacityScaleTypeValues() []ResourceSkuCapacityScaleType { + return []ResourceSkuCapacityScaleType{ResourceSkuCapacityScaleTypeAutomatic, ResourceSkuCapacityScaleTypeManual, ResourceSkuCapacityScaleTypeNone} +} + // ResourceSkuRestrictionsReasonCode enumerates the values for resource sku restrictions reason code. type ResourceSkuRestrictionsReasonCode string @@ -317,6 +403,11 @@ const ( QuotaID ResourceSkuRestrictionsReasonCode = "QuotaId" ) +// PossibleResourceSkuRestrictionsReasonCodeValues returns an array of possible values for the ResourceSkuRestrictionsReasonCode const type. +func PossibleResourceSkuRestrictionsReasonCodeValues() []ResourceSkuRestrictionsReasonCode { + return []ResourceSkuRestrictionsReasonCode{NotAvailableForSubscription, QuotaID} +} + // ResourceSkuRestrictionsType enumerates the values for resource sku restrictions type. type ResourceSkuRestrictionsType string @@ -327,6 +418,11 @@ const ( Zone ResourceSkuRestrictionsType = "Zone" ) +// PossibleResourceSkuRestrictionsTypeValues returns an array of possible values for the ResourceSkuRestrictionsType const type. +func PossibleResourceSkuRestrictionsTypeValues() []ResourceSkuRestrictionsType { + return []ResourceSkuRestrictionsType{Location, Zone} +} + // RollingUpgradeActionType enumerates the values for rolling upgrade action type. type RollingUpgradeActionType string @@ -337,6 +433,11 @@ const ( Start RollingUpgradeActionType = "Start" ) +// PossibleRollingUpgradeActionTypeValues returns an array of possible values for the RollingUpgradeActionType const type. +func PossibleRollingUpgradeActionTypeValues() []RollingUpgradeActionType { + return []RollingUpgradeActionType{Cancel, Start} +} + // RollingUpgradeStatusCode enumerates the values for rolling upgrade status code. type RollingUpgradeStatusCode string @@ -351,6 +452,11 @@ const ( RollingForward RollingUpgradeStatusCode = "RollingForward" ) +// PossibleRollingUpgradeStatusCodeValues returns an array of possible values for the RollingUpgradeStatusCode const type. +func PossibleRollingUpgradeStatusCodeValues() []RollingUpgradeStatusCode { + return []RollingUpgradeStatusCode{Cancelled, Completed, Faulted, RollingForward} +} + // SettingNames enumerates the values for setting names. type SettingNames string @@ -361,6 +467,11 @@ const ( FirstLogonCommands SettingNames = "FirstLogonCommands" ) +// PossibleSettingNamesValues returns an array of possible values for the SettingNames const type. +func PossibleSettingNamesValues() []SettingNames { + return []SettingNames{AutoLogon, FirstLogonCommands} +} + // StatusLevelTypes enumerates the values for status level types. type StatusLevelTypes string @@ -373,6 +484,11 @@ const ( Warning StatusLevelTypes = "Warning" ) +// PossibleStatusLevelTypesValues returns an array of possible values for the StatusLevelTypes const type. +func PossibleStatusLevelTypesValues() []StatusLevelTypes { + return []StatusLevelTypes{Error, Info, Warning} +} + // StorageAccountTypes enumerates the values for storage account types. type StorageAccountTypes string @@ -383,6 +499,11 @@ const ( StandardLRS StorageAccountTypes = "Standard_LRS" ) +// PossibleStorageAccountTypesValues returns an array of possible values for the StorageAccountTypes const type. +func PossibleStorageAccountTypesValues() []StorageAccountTypes { + return []StorageAccountTypes{PremiumLRS, StandardLRS} +} + // UpgradeMode enumerates the values for upgrade mode. type UpgradeMode string @@ -395,6 +516,11 @@ const ( Rolling UpgradeMode = "Rolling" ) +// PossibleUpgradeModeValues returns an array of possible values for the UpgradeMode const type. +func PossibleUpgradeModeValues() []UpgradeMode { + return []UpgradeMode{Automatic, Manual, Rolling} +} + // VirtualMachinePriorityTypes enumerates the values for virtual machine priority types. type VirtualMachinePriorityTypes string @@ -405,6 +531,11 @@ const ( Regular VirtualMachinePriorityTypes = "Regular" ) +// PossibleVirtualMachinePriorityTypesValues returns an array of possible values for the VirtualMachinePriorityTypes const type. +func PossibleVirtualMachinePriorityTypesValues() []VirtualMachinePriorityTypes { + return []VirtualMachinePriorityTypes{Low, Regular} +} + // VirtualMachineScaleSetSkuScaleType enumerates the values for virtual machine scale set sku scale type. type VirtualMachineScaleSetSkuScaleType string @@ -415,6 +546,11 @@ const ( VirtualMachineScaleSetSkuScaleTypeNone VirtualMachineScaleSetSkuScaleType = "None" ) +// PossibleVirtualMachineScaleSetSkuScaleTypeValues returns an array of possible values for the VirtualMachineScaleSetSkuScaleType const type. +func PossibleVirtualMachineScaleSetSkuScaleTypeValues() []VirtualMachineScaleSetSkuScaleType { + return []VirtualMachineScaleSetSkuScaleType{VirtualMachineScaleSetSkuScaleTypeAutomatic, VirtualMachineScaleSetSkuScaleTypeNone} +} + // VirtualMachineSizeTypes enumerates the values for virtual machine size types. type VirtualMachineSizeTypes string @@ -753,6 +889,11 @@ const ( VirtualMachineSizeTypesStandardNV6 VirtualMachineSizeTypes = "Standard_NV6" ) +// PossibleVirtualMachineSizeTypesValues returns an array of possible values for the VirtualMachineSizeTypes const type. +func PossibleVirtualMachineSizeTypesValues() []VirtualMachineSizeTypes { + return []VirtualMachineSizeTypes{VirtualMachineSizeTypesBasicA0, VirtualMachineSizeTypesBasicA1, VirtualMachineSizeTypesBasicA2, VirtualMachineSizeTypesBasicA3, VirtualMachineSizeTypesBasicA4, VirtualMachineSizeTypesStandardA0, VirtualMachineSizeTypesStandardA1, VirtualMachineSizeTypesStandardA10, VirtualMachineSizeTypesStandardA11, VirtualMachineSizeTypesStandardA1V2, VirtualMachineSizeTypesStandardA2, VirtualMachineSizeTypesStandardA2mV2, VirtualMachineSizeTypesStandardA2V2, VirtualMachineSizeTypesStandardA3, VirtualMachineSizeTypesStandardA4, VirtualMachineSizeTypesStandardA4mV2, VirtualMachineSizeTypesStandardA4V2, VirtualMachineSizeTypesStandardA5, VirtualMachineSizeTypesStandardA6, VirtualMachineSizeTypesStandardA7, VirtualMachineSizeTypesStandardA8, VirtualMachineSizeTypesStandardA8mV2, VirtualMachineSizeTypesStandardA8V2, VirtualMachineSizeTypesStandardA9, VirtualMachineSizeTypesStandardB1ms, VirtualMachineSizeTypesStandardB1s, VirtualMachineSizeTypesStandardB2ms, VirtualMachineSizeTypesStandardB2s, VirtualMachineSizeTypesStandardB4ms, VirtualMachineSizeTypesStandardB8ms, VirtualMachineSizeTypesStandardD1, VirtualMachineSizeTypesStandardD11, VirtualMachineSizeTypesStandardD11V2, VirtualMachineSizeTypesStandardD12, VirtualMachineSizeTypesStandardD12V2, VirtualMachineSizeTypesStandardD13, VirtualMachineSizeTypesStandardD13V2, VirtualMachineSizeTypesStandardD14, VirtualMachineSizeTypesStandardD14V2, VirtualMachineSizeTypesStandardD15V2, VirtualMachineSizeTypesStandardD16sV3, VirtualMachineSizeTypesStandardD16V3, VirtualMachineSizeTypesStandardD1V2, VirtualMachineSizeTypesStandardD2, VirtualMachineSizeTypesStandardD2sV3, VirtualMachineSizeTypesStandardD2V2, VirtualMachineSizeTypesStandardD2V3, VirtualMachineSizeTypesStandardD3, VirtualMachineSizeTypesStandardD32sV3, VirtualMachineSizeTypesStandardD32V3, VirtualMachineSizeTypesStandardD3V2, VirtualMachineSizeTypesStandardD4, VirtualMachineSizeTypesStandardD4sV3, VirtualMachineSizeTypesStandardD4V2, VirtualMachineSizeTypesStandardD4V3, VirtualMachineSizeTypesStandardD5V2, VirtualMachineSizeTypesStandardD64sV3, VirtualMachineSizeTypesStandardD64V3, VirtualMachineSizeTypesStandardD8sV3, VirtualMachineSizeTypesStandardD8V3, VirtualMachineSizeTypesStandardDS1, VirtualMachineSizeTypesStandardDS11, VirtualMachineSizeTypesStandardDS11V2, VirtualMachineSizeTypesStandardDS12, VirtualMachineSizeTypesStandardDS12V2, VirtualMachineSizeTypesStandardDS13, VirtualMachineSizeTypesStandardDS132V2, VirtualMachineSizeTypesStandardDS134V2, VirtualMachineSizeTypesStandardDS13V2, VirtualMachineSizeTypesStandardDS14, VirtualMachineSizeTypesStandardDS144V2, VirtualMachineSizeTypesStandardDS148V2, VirtualMachineSizeTypesStandardDS14V2, VirtualMachineSizeTypesStandardDS15V2, VirtualMachineSizeTypesStandardDS1V2, VirtualMachineSizeTypesStandardDS2, VirtualMachineSizeTypesStandardDS2V2, VirtualMachineSizeTypesStandardDS3, VirtualMachineSizeTypesStandardDS3V2, VirtualMachineSizeTypesStandardDS4, VirtualMachineSizeTypesStandardDS4V2, VirtualMachineSizeTypesStandardDS5V2, VirtualMachineSizeTypesStandardE16sV3, VirtualMachineSizeTypesStandardE16V3, VirtualMachineSizeTypesStandardE2sV3, VirtualMachineSizeTypesStandardE2V3, VirtualMachineSizeTypesStandardE3216V3, VirtualMachineSizeTypesStandardE328sV3, VirtualMachineSizeTypesStandardE32sV3, VirtualMachineSizeTypesStandardE32V3, VirtualMachineSizeTypesStandardE4sV3, VirtualMachineSizeTypesStandardE4V3, VirtualMachineSizeTypesStandardE6416sV3, VirtualMachineSizeTypesStandardE6432sV3, VirtualMachineSizeTypesStandardE64sV3, VirtualMachineSizeTypesStandardE64V3, VirtualMachineSizeTypesStandardE8sV3, VirtualMachineSizeTypesStandardE8V3, VirtualMachineSizeTypesStandardF1, VirtualMachineSizeTypesStandardF16, VirtualMachineSizeTypesStandardF16s, VirtualMachineSizeTypesStandardF16sV2, VirtualMachineSizeTypesStandardF1s, VirtualMachineSizeTypesStandardF2, VirtualMachineSizeTypesStandardF2s, VirtualMachineSizeTypesStandardF2sV2, VirtualMachineSizeTypesStandardF32sV2, VirtualMachineSizeTypesStandardF4, VirtualMachineSizeTypesStandardF4s, VirtualMachineSizeTypesStandardF4sV2, VirtualMachineSizeTypesStandardF64sV2, VirtualMachineSizeTypesStandardF72sV2, VirtualMachineSizeTypesStandardF8, VirtualMachineSizeTypesStandardF8s, VirtualMachineSizeTypesStandardF8sV2, VirtualMachineSizeTypesStandardG1, VirtualMachineSizeTypesStandardG2, VirtualMachineSizeTypesStandardG3, VirtualMachineSizeTypesStandardG4, VirtualMachineSizeTypesStandardG5, VirtualMachineSizeTypesStandardGS1, VirtualMachineSizeTypesStandardGS2, VirtualMachineSizeTypesStandardGS3, VirtualMachineSizeTypesStandardGS4, VirtualMachineSizeTypesStandardGS44, VirtualMachineSizeTypesStandardGS48, VirtualMachineSizeTypesStandardGS5, VirtualMachineSizeTypesStandardGS516, VirtualMachineSizeTypesStandardGS58, VirtualMachineSizeTypesStandardH16, VirtualMachineSizeTypesStandardH16m, VirtualMachineSizeTypesStandardH16mr, VirtualMachineSizeTypesStandardH16r, VirtualMachineSizeTypesStandardH8, VirtualMachineSizeTypesStandardH8m, VirtualMachineSizeTypesStandardL16s, VirtualMachineSizeTypesStandardL32s, VirtualMachineSizeTypesStandardL4s, VirtualMachineSizeTypesStandardL8s, VirtualMachineSizeTypesStandardM12832ms, VirtualMachineSizeTypesStandardM12864ms, VirtualMachineSizeTypesStandardM128ms, VirtualMachineSizeTypesStandardM128s, VirtualMachineSizeTypesStandardM6416ms, VirtualMachineSizeTypesStandardM6432ms, VirtualMachineSizeTypesStandardM64ms, VirtualMachineSizeTypesStandardM64s, VirtualMachineSizeTypesStandardNC12, VirtualMachineSizeTypesStandardNC12sV2, VirtualMachineSizeTypesStandardNC12sV3, VirtualMachineSizeTypesStandardNC24, VirtualMachineSizeTypesStandardNC24r, VirtualMachineSizeTypesStandardNC24rsV2, VirtualMachineSizeTypesStandardNC24rsV3, VirtualMachineSizeTypesStandardNC24sV2, VirtualMachineSizeTypesStandardNC24sV3, VirtualMachineSizeTypesStandardNC6, VirtualMachineSizeTypesStandardNC6sV2, VirtualMachineSizeTypesStandardNC6sV3, VirtualMachineSizeTypesStandardND12s, VirtualMachineSizeTypesStandardND24rs, VirtualMachineSizeTypesStandardND24s, VirtualMachineSizeTypesStandardND6s, VirtualMachineSizeTypesStandardNV12, VirtualMachineSizeTypesStandardNV24, VirtualMachineSizeTypesStandardNV6} +} + // AccessURI a disk access SAS uri. type AccessURI struct { autorest.Response `json:"-"` @@ -760,21 +901,87 @@ type AccessURI struct { *AccessURIOutput `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for AccessURI. +func (au AccessURI) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if au.AccessURIOutput != nil { + objectMap["properties"] = au.AccessURIOutput + } + return json.Marshal(objectMap) +} + +// 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"` } +// MarshalJSON is the custom marshaler for AccessURIOutput. +func (auo AccessURIOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if auo.AccessURIRaw != nil { + objectMap["output"] = auo.AccessURIRaw + } + return json.Marshal(objectMap) +} + +// 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 +1024,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 +1045,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 +1172,83 @@ 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. +// AvailabilitySetUpdate 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 +// 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. +type AvailabilitySetUpdate struct { + *AvailabilitySetProperties `json:"properties,omitempty"` + // Sku - Sku of the availability set + Sku *Sku `json:"sku,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for AvailabilitySetUpdate. +func (asu AvailabilitySetUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asu.AvailabilitySetProperties != nil { + objectMap["properties"] = asu.AvailabilitySetProperties + } + if asu.Sku != nil { + objectMap["sku"] = asu.Sku + } + if asu.Tags != nil { + objectMap["tags"] = asu.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AvailabilitySetUpdate struct. +func (asu *AvailabilitySetUpdate) 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 + } + asu.AvailabilitySetProperties = &availabilitySetProperties + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + asu.Sku = &sku + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + asu.Tags = tags + } + } + } + + return nil +} + +// 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 +1266,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 +1277,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 +1560,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 +1609,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 +1733,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 +1748,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 +2030,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 +2078,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 +2126,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 +2182,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 +2230,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. @@ -1577,7 +2361,7 @@ type GrantAccessData struct { // HardwareProfile specifies the hardware settings for the virtual machine. type HardwareProfile struct { - // VMSize - Specifies the size of the virtual machine. For more information about virtual machine sizes, see [Sizes for virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).

The available VM sizes depend on region and availability set. For a list of available sizes use these APIs:

[List all available virtual machine sizes in an availability set](virtualmachines-list-sizes-availability-set.md)

[List all available virtual machine sizes in a region](virtualmachines-list-sizes-region.md)

[List all available virtual machine sizes for resizing](virtualmachines-list-sizes-for-resizing.md). Possible values include: 'VirtualMachineSizeTypesBasicA0', 'VirtualMachineSizeTypesBasicA1', 'VirtualMachineSizeTypesBasicA2', 'VirtualMachineSizeTypesBasicA3', 'VirtualMachineSizeTypesBasicA4', 'VirtualMachineSizeTypesStandardA0', 'VirtualMachineSizeTypesStandardA1', 'VirtualMachineSizeTypesStandardA2', 'VirtualMachineSizeTypesStandardA3', 'VirtualMachineSizeTypesStandardA4', 'VirtualMachineSizeTypesStandardA5', 'VirtualMachineSizeTypesStandardA6', 'VirtualMachineSizeTypesStandardA7', 'VirtualMachineSizeTypesStandardA8', 'VirtualMachineSizeTypesStandardA9', 'VirtualMachineSizeTypesStandardA10', 'VirtualMachineSizeTypesStandardA11', 'VirtualMachineSizeTypesStandardA1V2', 'VirtualMachineSizeTypesStandardA2V2', 'VirtualMachineSizeTypesStandardA4V2', 'VirtualMachineSizeTypesStandardA8V2', 'VirtualMachineSizeTypesStandardA2mV2', 'VirtualMachineSizeTypesStandardA4mV2', 'VirtualMachineSizeTypesStandardA8mV2', 'VirtualMachineSizeTypesStandardB1s', 'VirtualMachineSizeTypesStandardB1ms', 'VirtualMachineSizeTypesStandardB2s', 'VirtualMachineSizeTypesStandardB2ms', 'VirtualMachineSizeTypesStandardB4ms', 'VirtualMachineSizeTypesStandardB8ms', 'VirtualMachineSizeTypesStandardD1', 'VirtualMachineSizeTypesStandardD2', 'VirtualMachineSizeTypesStandardD3', 'VirtualMachineSizeTypesStandardD4', 'VirtualMachineSizeTypesStandardD11', 'VirtualMachineSizeTypesStandardD12', 'VirtualMachineSizeTypesStandardD13', 'VirtualMachineSizeTypesStandardD14', 'VirtualMachineSizeTypesStandardD1V2', 'VirtualMachineSizeTypesStandardD2V2', 'VirtualMachineSizeTypesStandardD3V2', 'VirtualMachineSizeTypesStandardD4V2', 'VirtualMachineSizeTypesStandardD5V2', 'VirtualMachineSizeTypesStandardD2V3', 'VirtualMachineSizeTypesStandardD4V3', 'VirtualMachineSizeTypesStandardD8V3', 'VirtualMachineSizeTypesStandardD16V3', 'VirtualMachineSizeTypesStandardD32V3', 'VirtualMachineSizeTypesStandardD64V3', 'VirtualMachineSizeTypesStandardD2sV3', 'VirtualMachineSizeTypesStandardD4sV3', 'VirtualMachineSizeTypesStandardD8sV3', 'VirtualMachineSizeTypesStandardD16sV3', 'VirtualMachineSizeTypesStandardD32sV3', 'VirtualMachineSizeTypesStandardD64sV3', 'VirtualMachineSizeTypesStandardD11V2', 'VirtualMachineSizeTypesStandardD12V2', 'VirtualMachineSizeTypesStandardD13V2', 'VirtualMachineSizeTypesStandardD14V2', 'VirtualMachineSizeTypesStandardD15V2', 'VirtualMachineSizeTypesStandardDS1', 'VirtualMachineSizeTypesStandardDS2', 'VirtualMachineSizeTypesStandardDS3', 'VirtualMachineSizeTypesStandardDS4', 'VirtualMachineSizeTypesStandardDS11', 'VirtualMachineSizeTypesStandardDS12', 'VirtualMachineSizeTypesStandardDS13', 'VirtualMachineSizeTypesStandardDS14', 'VirtualMachineSizeTypesStandardDS1V2', 'VirtualMachineSizeTypesStandardDS2V2', 'VirtualMachineSizeTypesStandardDS3V2', 'VirtualMachineSizeTypesStandardDS4V2', 'VirtualMachineSizeTypesStandardDS5V2', 'VirtualMachineSizeTypesStandardDS11V2', 'VirtualMachineSizeTypesStandardDS12V2', 'VirtualMachineSizeTypesStandardDS13V2', 'VirtualMachineSizeTypesStandardDS14V2', 'VirtualMachineSizeTypesStandardDS15V2', 'VirtualMachineSizeTypesStandardDS134V2', 'VirtualMachineSizeTypesStandardDS132V2', 'VirtualMachineSizeTypesStandardDS148V2', 'VirtualMachineSizeTypesStandardDS144V2', 'VirtualMachineSizeTypesStandardE2V3', 'VirtualMachineSizeTypesStandardE4V3', 'VirtualMachineSizeTypesStandardE8V3', 'VirtualMachineSizeTypesStandardE16V3', 'VirtualMachineSizeTypesStandardE32V3', 'VirtualMachineSizeTypesStandardE64V3', 'VirtualMachineSizeTypesStandardE2sV3', 'VirtualMachineSizeTypesStandardE4sV3', 'VirtualMachineSizeTypesStandardE8sV3', 'VirtualMachineSizeTypesStandardE16sV3', 'VirtualMachineSizeTypesStandardE32sV3', 'VirtualMachineSizeTypesStandardE64sV3', 'VirtualMachineSizeTypesStandardE3216V3', 'VirtualMachineSizeTypesStandardE328sV3', 'VirtualMachineSizeTypesStandardE6432sV3', 'VirtualMachineSizeTypesStandardE6416sV3', 'VirtualMachineSizeTypesStandardF1', 'VirtualMachineSizeTypesStandardF2', 'VirtualMachineSizeTypesStandardF4', 'VirtualMachineSizeTypesStandardF8', 'VirtualMachineSizeTypesStandardF16', 'VirtualMachineSizeTypesStandardF1s', 'VirtualMachineSizeTypesStandardF2s', 'VirtualMachineSizeTypesStandardF4s', 'VirtualMachineSizeTypesStandardF8s', 'VirtualMachineSizeTypesStandardF16s', 'VirtualMachineSizeTypesStandardF2sV2', 'VirtualMachineSizeTypesStandardF4sV2', 'VirtualMachineSizeTypesStandardF8sV2', 'VirtualMachineSizeTypesStandardF16sV2', 'VirtualMachineSizeTypesStandardF32sV2', 'VirtualMachineSizeTypesStandardF64sV2', 'VirtualMachineSizeTypesStandardF72sV2', 'VirtualMachineSizeTypesStandardG1', 'VirtualMachineSizeTypesStandardG2', 'VirtualMachineSizeTypesStandardG3', 'VirtualMachineSizeTypesStandardG4', 'VirtualMachineSizeTypesStandardG5', 'VirtualMachineSizeTypesStandardGS1', 'VirtualMachineSizeTypesStandardGS2', 'VirtualMachineSizeTypesStandardGS3', 'VirtualMachineSizeTypesStandardGS4', 'VirtualMachineSizeTypesStandardGS5', 'VirtualMachineSizeTypesStandardGS48', 'VirtualMachineSizeTypesStandardGS44', 'VirtualMachineSizeTypesStandardGS516', 'VirtualMachineSizeTypesStandardGS58', 'VirtualMachineSizeTypesStandardH8', 'VirtualMachineSizeTypesStandardH16', 'VirtualMachineSizeTypesStandardH8m', 'VirtualMachineSizeTypesStandardH16m', 'VirtualMachineSizeTypesStandardH16r', 'VirtualMachineSizeTypesStandardH16mr', 'VirtualMachineSizeTypesStandardL4s', 'VirtualMachineSizeTypesStandardL8s', 'VirtualMachineSizeTypesStandardL16s', 'VirtualMachineSizeTypesStandardL32s', 'VirtualMachineSizeTypesStandardM64s', 'VirtualMachineSizeTypesStandardM64ms', 'VirtualMachineSizeTypesStandardM128s', 'VirtualMachineSizeTypesStandardM128ms', 'VirtualMachineSizeTypesStandardM6432ms', 'VirtualMachineSizeTypesStandardM6416ms', 'VirtualMachineSizeTypesStandardM12864ms', 'VirtualMachineSizeTypesStandardM12832ms', 'VirtualMachineSizeTypesStandardNC6', 'VirtualMachineSizeTypesStandardNC12', 'VirtualMachineSizeTypesStandardNC24', 'VirtualMachineSizeTypesStandardNC24r', 'VirtualMachineSizeTypesStandardNC6sV2', 'VirtualMachineSizeTypesStandardNC12sV2', 'VirtualMachineSizeTypesStandardNC24sV2', 'VirtualMachineSizeTypesStandardNC24rsV2', 'VirtualMachineSizeTypesStandardNC6sV3', 'VirtualMachineSizeTypesStandardNC12sV3', 'VirtualMachineSizeTypesStandardNC24sV3', 'VirtualMachineSizeTypesStandardNC24rsV3', 'VirtualMachineSizeTypesStandardND6s', 'VirtualMachineSizeTypesStandardND12s', 'VirtualMachineSizeTypesStandardND24s', 'VirtualMachineSizeTypesStandardND24rs', 'VirtualMachineSizeTypesStandardNV6', 'VirtualMachineSizeTypesStandardNV12', 'VirtualMachineSizeTypesStandardNV24' + // VMSize - Specifies the size of the virtual machine. For more information about virtual machine sizes, see [Sizes for virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).

The available VM sizes depend on region and availability set. For a list of available sizes use these APIs:

[List all available virtual machine sizes in an availability set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes)

[List all available virtual machine sizes in a region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list)

[List all available virtual machine sizes for resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). Possible values include: 'VirtualMachineSizeTypesBasicA0', 'VirtualMachineSizeTypesBasicA1', 'VirtualMachineSizeTypesBasicA2', 'VirtualMachineSizeTypesBasicA3', 'VirtualMachineSizeTypesBasicA4', 'VirtualMachineSizeTypesStandardA0', 'VirtualMachineSizeTypesStandardA1', 'VirtualMachineSizeTypesStandardA2', 'VirtualMachineSizeTypesStandardA3', 'VirtualMachineSizeTypesStandardA4', 'VirtualMachineSizeTypesStandardA5', 'VirtualMachineSizeTypesStandardA6', 'VirtualMachineSizeTypesStandardA7', 'VirtualMachineSizeTypesStandardA8', 'VirtualMachineSizeTypesStandardA9', 'VirtualMachineSizeTypesStandardA10', 'VirtualMachineSizeTypesStandardA11', 'VirtualMachineSizeTypesStandardA1V2', 'VirtualMachineSizeTypesStandardA2V2', 'VirtualMachineSizeTypesStandardA4V2', 'VirtualMachineSizeTypesStandardA8V2', 'VirtualMachineSizeTypesStandardA2mV2', 'VirtualMachineSizeTypesStandardA4mV2', 'VirtualMachineSizeTypesStandardA8mV2', 'VirtualMachineSizeTypesStandardB1s', 'VirtualMachineSizeTypesStandardB1ms', 'VirtualMachineSizeTypesStandardB2s', 'VirtualMachineSizeTypesStandardB2ms', 'VirtualMachineSizeTypesStandardB4ms', 'VirtualMachineSizeTypesStandardB8ms', 'VirtualMachineSizeTypesStandardD1', 'VirtualMachineSizeTypesStandardD2', 'VirtualMachineSizeTypesStandardD3', 'VirtualMachineSizeTypesStandardD4', 'VirtualMachineSizeTypesStandardD11', 'VirtualMachineSizeTypesStandardD12', 'VirtualMachineSizeTypesStandardD13', 'VirtualMachineSizeTypesStandardD14', 'VirtualMachineSizeTypesStandardD1V2', 'VirtualMachineSizeTypesStandardD2V2', 'VirtualMachineSizeTypesStandardD3V2', 'VirtualMachineSizeTypesStandardD4V2', 'VirtualMachineSizeTypesStandardD5V2', 'VirtualMachineSizeTypesStandardD2V3', 'VirtualMachineSizeTypesStandardD4V3', 'VirtualMachineSizeTypesStandardD8V3', 'VirtualMachineSizeTypesStandardD16V3', 'VirtualMachineSizeTypesStandardD32V3', 'VirtualMachineSizeTypesStandardD64V3', 'VirtualMachineSizeTypesStandardD2sV3', 'VirtualMachineSizeTypesStandardD4sV3', 'VirtualMachineSizeTypesStandardD8sV3', 'VirtualMachineSizeTypesStandardD16sV3', 'VirtualMachineSizeTypesStandardD32sV3', 'VirtualMachineSizeTypesStandardD64sV3', 'VirtualMachineSizeTypesStandardD11V2', 'VirtualMachineSizeTypesStandardD12V2', 'VirtualMachineSizeTypesStandardD13V2', 'VirtualMachineSizeTypesStandardD14V2', 'VirtualMachineSizeTypesStandardD15V2', 'VirtualMachineSizeTypesStandardDS1', 'VirtualMachineSizeTypesStandardDS2', 'VirtualMachineSizeTypesStandardDS3', 'VirtualMachineSizeTypesStandardDS4', 'VirtualMachineSizeTypesStandardDS11', 'VirtualMachineSizeTypesStandardDS12', 'VirtualMachineSizeTypesStandardDS13', 'VirtualMachineSizeTypesStandardDS14', 'VirtualMachineSizeTypesStandardDS1V2', 'VirtualMachineSizeTypesStandardDS2V2', 'VirtualMachineSizeTypesStandardDS3V2', 'VirtualMachineSizeTypesStandardDS4V2', 'VirtualMachineSizeTypesStandardDS5V2', 'VirtualMachineSizeTypesStandardDS11V2', 'VirtualMachineSizeTypesStandardDS12V2', 'VirtualMachineSizeTypesStandardDS13V2', 'VirtualMachineSizeTypesStandardDS14V2', 'VirtualMachineSizeTypesStandardDS15V2', 'VirtualMachineSizeTypesStandardDS134V2', 'VirtualMachineSizeTypesStandardDS132V2', 'VirtualMachineSizeTypesStandardDS148V2', 'VirtualMachineSizeTypesStandardDS144V2', 'VirtualMachineSizeTypesStandardE2V3', 'VirtualMachineSizeTypesStandardE4V3', 'VirtualMachineSizeTypesStandardE8V3', 'VirtualMachineSizeTypesStandardE16V3', 'VirtualMachineSizeTypesStandardE32V3', 'VirtualMachineSizeTypesStandardE64V3', 'VirtualMachineSizeTypesStandardE2sV3', 'VirtualMachineSizeTypesStandardE4sV3', 'VirtualMachineSizeTypesStandardE8sV3', 'VirtualMachineSizeTypesStandardE16sV3', 'VirtualMachineSizeTypesStandardE32sV3', 'VirtualMachineSizeTypesStandardE64sV3', 'VirtualMachineSizeTypesStandardE3216V3', 'VirtualMachineSizeTypesStandardE328sV3', 'VirtualMachineSizeTypesStandardE6432sV3', 'VirtualMachineSizeTypesStandardE6416sV3', 'VirtualMachineSizeTypesStandardF1', 'VirtualMachineSizeTypesStandardF2', 'VirtualMachineSizeTypesStandardF4', 'VirtualMachineSizeTypesStandardF8', 'VirtualMachineSizeTypesStandardF16', 'VirtualMachineSizeTypesStandardF1s', 'VirtualMachineSizeTypesStandardF2s', 'VirtualMachineSizeTypesStandardF4s', 'VirtualMachineSizeTypesStandardF8s', 'VirtualMachineSizeTypesStandardF16s', 'VirtualMachineSizeTypesStandardF2sV2', 'VirtualMachineSizeTypesStandardF4sV2', 'VirtualMachineSizeTypesStandardF8sV2', 'VirtualMachineSizeTypesStandardF16sV2', 'VirtualMachineSizeTypesStandardF32sV2', 'VirtualMachineSizeTypesStandardF64sV2', 'VirtualMachineSizeTypesStandardF72sV2', 'VirtualMachineSizeTypesStandardG1', 'VirtualMachineSizeTypesStandardG2', 'VirtualMachineSizeTypesStandardG3', 'VirtualMachineSizeTypesStandardG4', 'VirtualMachineSizeTypesStandardG5', 'VirtualMachineSizeTypesStandardGS1', 'VirtualMachineSizeTypesStandardGS2', 'VirtualMachineSizeTypesStandardGS3', 'VirtualMachineSizeTypesStandardGS4', 'VirtualMachineSizeTypesStandardGS5', 'VirtualMachineSizeTypesStandardGS48', 'VirtualMachineSizeTypesStandardGS44', 'VirtualMachineSizeTypesStandardGS516', 'VirtualMachineSizeTypesStandardGS58', 'VirtualMachineSizeTypesStandardH8', 'VirtualMachineSizeTypesStandardH16', 'VirtualMachineSizeTypesStandardH8m', 'VirtualMachineSizeTypesStandardH16m', 'VirtualMachineSizeTypesStandardH16r', 'VirtualMachineSizeTypesStandardH16mr', 'VirtualMachineSizeTypesStandardL4s', 'VirtualMachineSizeTypesStandardL8s', 'VirtualMachineSizeTypesStandardL16s', 'VirtualMachineSizeTypesStandardL32s', 'VirtualMachineSizeTypesStandardM64s', 'VirtualMachineSizeTypesStandardM64ms', 'VirtualMachineSizeTypesStandardM128s', 'VirtualMachineSizeTypesStandardM128ms', 'VirtualMachineSizeTypesStandardM6432ms', 'VirtualMachineSizeTypesStandardM6416ms', 'VirtualMachineSizeTypesStandardM12864ms', 'VirtualMachineSizeTypesStandardM12832ms', 'VirtualMachineSizeTypesStandardNC6', 'VirtualMachineSizeTypesStandardNC12', 'VirtualMachineSizeTypesStandardNC24', 'VirtualMachineSizeTypesStandardNC24r', 'VirtualMachineSizeTypesStandardNC6sV2', 'VirtualMachineSizeTypesStandardNC12sV2', 'VirtualMachineSizeTypesStandardNC24sV2', 'VirtualMachineSizeTypesStandardNC24rsV2', 'VirtualMachineSizeTypesStandardNC6sV3', 'VirtualMachineSizeTypesStandardNC12sV3', 'VirtualMachineSizeTypesStandardNC24sV3', 'VirtualMachineSizeTypesStandardNC24rsV3', 'VirtualMachineSizeTypesStandardND6s', 'VirtualMachineSizeTypesStandardND12s', 'VirtualMachineSizeTypesStandardND24s', 'VirtualMachineSizeTypesStandardND24rs', 'VirtualMachineSizeTypesStandardNV6', 'VirtualMachineSizeTypesStandardNV12', 'VirtualMachineSizeTypesStandardNV24' VMSize VirtualMachineSizeTypes `json:"vmSize,omitempty"` } @@ -1585,6 +2369,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 +2379,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 +2637,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 +2645,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 +2661,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 +2709,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 } @@ -1842,35 +2753,136 @@ type ImageStorageProfile struct { DataDisks *[]ImageDataDisk `json:"dataDisks,omitempty"` } -// InnerError inner error details. -type InnerError struct { - // Exceptiontype - The exception type. - Exceptiontype *string `json:"exceptiontype,omitempty"` - // Errordetail - The internal error message or exception dump. - Errordetail *string `json:"errordetail,omitempty"` -} - -// InstanceViewStatus instance view status. -type InstanceViewStatus struct { - // Code - The status code. - Code *string `json:"code,omitempty"` - // Level - The level code. Possible values include: 'Info', 'Warning', 'Error' - Level StatusLevelTypes `json:"level,omitempty"` - // DisplayStatus - The short localizable label for the status. - DisplayStatus *string `json:"displayStatus,omitempty"` - // Message - The detailed status message, including for alerts and error messages. - Message *string `json:"message,omitempty"` - // Time - The time of the status. - Time *date.Time `json:"time,omitempty"` +// ImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type ImagesUpdateFuture struct { + azure.Future + req *http.Request } -// 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"` - // KeyURL - Url pointing to a key or secret in KeyVault - KeyURL *string `json:"keyUrl,omitempty"` +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future ImagesUpdateFuture) Result(client ImagesClient) (i Image, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + return i, azure.NewAsyncOpIncompleteError("compute.ImagesUpdateFuture") + } + if future.PollingMethod() == azure.PollingLocation { + i, err = client.UpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "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, "compute.ImagesUpdateFuture", "Result", resp, "Failure sending request") + return + } + i, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", resp, "Failure responding to request") + } + return +} + +// ImageUpdate the source user image virtual hard disk. The virtual hard disk will be copied before being attached +// to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist. +type ImageUpdate struct { + *ImageProperties `json:"properties,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ImageUpdate. +func (iu ImageUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if iu.ImageProperties != nil { + objectMap["properties"] = iu.ImageProperties + } + if iu.Tags != nil { + objectMap["tags"] = iu.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ImageUpdate struct. +func (iu *ImageUpdate) 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 + } + iu.ImageProperties = &imageProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + iu.Tags = tags + } + } + } + + return nil +} + +// InnerError inner error details. +type InnerError struct { + // Exceptiontype - The exception type. + Exceptiontype *string `json:"exceptiontype,omitempty"` + // Errordetail - The internal error message or exception dump. + Errordetail *string `json:"errordetail,omitempty"` +} + +// InstanceViewStatus instance view status. +type InstanceViewStatus struct { + // Code - The status code. + Code *string `json:"code,omitempty"` + // Level - The level code. Possible values include: 'Info', 'Warning', 'Error' + Level StatusLevelTypes `json:"level,omitempty"` + // DisplayStatus - The short localizable label for the status. + DisplayStatus *string `json:"displayStatus,omitempty"` + // Message - The detailed status message, including for alerts and error messages. + Message *string `json:"message,omitempty"` + // Time - The time of the status. + 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 +type KeyVaultAndKeyReference struct { + // SourceVault - Resource id of the KeyVault containing the key or secret + SourceVault *SourceVault `json:"sourceVault,omitempty"` + // KeyURL - Url pointing to a key or secret in KeyVault + KeyURL *string `json:"keyUrl,omitempty"` } // KeyVaultAndSecretReference key Vault Secret Url and vault id of the encryption key @@ -2036,27 +3048,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 +3097,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 +3152,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 +3164,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 +3175,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 +3198,62 @@ 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"` +} + +// MarshalJSON is the custom marshaler for NetworkInterfaceReference. +func (nir NetworkInterfaceReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if nir.NetworkInterfaceReferenceProperties != nil { + objectMap["properties"] = nir.NetworkInterfaceReferenceProperties + } + if nir.ID != nil { + objectMap["id"] = nir.ID + } + return json.Marshal(objectMap) +} + +// 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. @@ -2177,6 +3268,13 @@ type NetworkProfile struct { NetworkInterfaces *[]NetworkInterfaceReference `json:"networkInterfaces,omitempty"` } +// OperationListResult the List Compute Operation operation response. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - The list of compute operations + Value *[]OperationValue `json:"value,omitempty"` +} + // OperationStatusResponse operation status response type OperationStatusResponse struct { autorest.Response `json:"-"` @@ -2192,6 +3290,84 @@ type OperationStatusResponse struct { Error *APIError `json:"error,omitempty"` } +// OperationValue describes the properties of a Compute Operation value. +type OperationValue struct { + // Origin - The origin of the compute operation. + Origin *string `json:"origin,omitempty"` + // Name - The name of the compute operation. + Name *string `json:"name,omitempty"` + *OperationValueDisplay `json:"display,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationValue. +func (ov OperationValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ov.Origin != nil { + objectMap["origin"] = ov.Origin + } + if ov.Name != nil { + objectMap["name"] = ov.Name + } + if ov.OperationValueDisplay != nil { + objectMap["display"] = ov.OperationValueDisplay + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OperationValue struct. +func (ov *OperationValue) 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 "origin": + if v != nil { + var origin string + err = json.Unmarshal(*v, &origin) + if err != nil { + return err + } + ov.Origin = &origin + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ov.Name = &name + } + case "display": + if v != nil { + var operationValueDisplay OperationValueDisplay + err = json.Unmarshal(*v, &operationValueDisplay) + if err != nil { + return err + } + ov.OperationValueDisplay = &operationValueDisplay + } + } + } + + return nil +} + +// OperationValueDisplay describes the properties of a Compute Operation Value Display. +type OperationValueDisplay struct { + // Operation - The display name of the compute operation. + Operation *string `json:"operation,omitempty"` + // Resource - The display name of the resource the operation applies to. + Resource *string `json:"resource,omitempty"` + // Description - The description of the operation. + Description *string `json:"description,omitempty"` + // Provider - The resource provider for the operation. + Provider *string `json:"provider,omitempty"` +} + // OSDisk specifies information about the operating system disk used by the virtual machine.

For more // information about disks, see [About disks and VHDs for Azure virtual // machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). @@ -2242,8 +3418,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 +3454,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 +3468,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 +3481,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 +3698,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 +3752,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 +3763,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 +3874,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 +3888,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 +4038,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 +4049,106 @@ 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"` +} + +// MarshalJSON is the custom marshaler for RunCommandResult. +func (rcr RunCommandResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rcr.RunCommandResultProperties != nil { + objectMap["properties"] = rcr.RunCommandResultProperties + } + if rcr.Name != nil { + objectMap["name"] = rcr.Name + } + if rcr.Status != nil { + objectMap["status"] = rcr.Status + } + if rcr.StartTime != nil { + objectMap["startTime"] = rcr.StartTime + } + if rcr.EndTime != nil { + objectMap["endTime"] = rcr.EndTime + } + if rcr.Error != nil { + objectMap["error"] = rcr.Error + } + return json.Marshal(objectMap) +} + +// 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 +4164,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 +4177,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 +4399,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 +4412,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 +4460,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 +4508,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 +4557,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 +4605,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 +4719,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 +4769,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 +4811,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 +4837,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 +4846,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 +5021,67 @@ 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"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineCaptureResult. +func (vmcr VirtualMachineCaptureResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmcr.VirtualMachineCaptureResultProperties != nil { + objectMap["properties"] = vmcr.VirtualMachineCaptureResultProperties + } + if vmcr.ID != nil { + objectMap["id"] = vmcr.ID + } + return json.Marshal(objectMap) +} + +// 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 +5091,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 +5199,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 +5210,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 +5347,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 +5369,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 +5418,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 +5474,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 +5576,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 +5762,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 +5771,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 +5945,68 @@ 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"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtension. +func (vmsse VirtualMachineScaleSetExtension) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmsse.Name != nil { + objectMap["name"] = vmsse.Name + } + if vmsse.VirtualMachineScaleSetExtensionProperties != nil { + objectMap["properties"] = vmsse.VirtualMachineScaleSetExtensionProperties + } + if vmsse.ID != nil { + objectMap["id"] = vmsse.ID + } + return json.Marshal(objectMap) +} + +// 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 +6131,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 +6151,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 +6200,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 +6259,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 +6268,68 @@ 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"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIPConfiguration. +func (vmssic VirtualMachineScaleSetIPConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssic.Name != nil { + objectMap["name"] = vmssic.Name + } + if vmssic.VirtualMachineScaleSetIPConfigurationProperties != nil { + objectMap["properties"] = vmssic.VirtualMachineScaleSetIPConfigurationProperties + } + if vmssic.ID != nil { + objectMap["id"] = vmssic.ID + } + return json.Marshal(objectMap) +} + +// 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 +6668,68 @@ 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"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetNetworkConfiguration. +func (vmssnc VirtualMachineScaleSetNetworkConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssnc.Name != nil { + objectMap["name"] = vmssnc.Name + } + if vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties != nil { + objectMap["properties"] = vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties + } + if vmssnc.ID != nil { + objectMap["id"] = vmssnc.ID + } + return json.Marshal(objectMap) +} + +// 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 @@ -4310,6 +6826,51 @@ type VirtualMachineScaleSetPublicIPAddressConfiguration struct { *VirtualMachineScaleSetPublicIPAddressConfigurationProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetPublicIPAddressConfiguration. +func (vmsspiac VirtualMachineScaleSetPublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmsspiac.Name != nil { + objectMap["name"] = vmsspiac.Name + } + if vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties != nil { + objectMap["properties"] = vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties + } + return json.Marshal(objectMap) +} + +// 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 +6900,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 +6949,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 +6998,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 +7047,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 +7096,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 +7145,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 +7216,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 +7265,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 +7314,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 +7363,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 +7412,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 +7471,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 +7520,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 +7565,156 @@ 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"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdateIPConfiguration. +func (vmssuic VirtualMachineScaleSetUpdateIPConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssuic.Name != nil { + objectMap["name"] = vmssuic.Name + } + if vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties != nil { + objectMap["properties"] = vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties + } + if vmssuic.ID != nil { + objectMap["id"] = vmssuic.ID + } + return json.Marshal(objectMap) +} + +// 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 +7739,72 @@ 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"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdateNetworkConfiguration. +func (vmssunc VirtualMachineScaleSetUpdateNetworkConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssunc.Name != nil { + objectMap["name"] = vmssunc.Name + } + if vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties != nil { + objectMap["properties"] = vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties + } + if vmssunc.ID != nil { + objectMap["id"] = vmssunc.ID + } + return json.Marshal(objectMap) +} + +// 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 +7865,59 @@ 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"` } +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdatePublicIPAddressConfiguration. +func (vmssupiac VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssupiac.Name != nil { + objectMap["name"] = vmssupiac.Name + } + if vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties != nil { + objectMap["properties"] = vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties + } + return json.Marshal(objectMap) +} + +// 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 +7956,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 +7965,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 +8133,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 +8174,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 +8312,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 +8325,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 +8374,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 +8423,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 +8472,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 +8521,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 +8570,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 +8619,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 +8668,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 +8717,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 +8766,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 +8815,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 +8864,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 +8913,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 +8972,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 +8985,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 +9034,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 +9083,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 +9132,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 +9181,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 +9229,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 } @@ -5780,6 +9274,149 @@ type VirtualMachineStatusCodeCount struct { Count *int32 `json:"count,omitempty"` } +// VirtualMachinesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VirtualMachinesUpdateFuture 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 VirtualMachinesUpdateFuture) Result(client VirtualMachinesClient) (VM VirtualMachine, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + return VM, azure.NewAsyncOpIncompleteError("compute.VirtualMachinesUpdateFuture") + } + if future.PollingMethod() == azure.PollingLocation { + VM, err = client.UpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesUpdateFuture", "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, "compute.VirtualMachinesUpdateFuture", "Result", resp, "Failure sending request") + return + } + VM, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesUpdateFuture", "Result", resp, "Failure responding to request") + } + return +} + +// VirtualMachineUpdate describes a Virtual Machine. +type VirtualMachineUpdate struct { + // 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"` + // Identity - The identity of the virtual machine, if configured. + Identity *VirtualMachineIdentity `json:"identity,omitempty"` + // Zones - The virtual machine zones. + Zones *[]string `json:"zones,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineUpdate. +func (vmu VirtualMachineUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmu.Plan != nil { + objectMap["plan"] = vmu.Plan + } + if vmu.VirtualMachineProperties != nil { + objectMap["properties"] = vmu.VirtualMachineProperties + } + if vmu.Identity != nil { + objectMap["identity"] = vmu.Identity + } + if vmu.Zones != nil { + objectMap["zones"] = vmu.Zones + } + if vmu.Tags != nil { + objectMap["tags"] = vmu.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineUpdate struct. +func (vmu *VirtualMachineUpdate) 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 + } + vmu.Plan = &plan + } + case "properties": + if v != nil { + var virtualMachineProperties VirtualMachineProperties + err = json.Unmarshal(*v, &virtualMachineProperties) + if err != nil { + return err + } + vmu.VirtualMachineProperties = &virtualMachineProperties + } + case "identity": + if v != nil { + var identity VirtualMachineIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + vmu.Identity = &identity + } + case "zones": + if v != nil { + var zones []string + err = json.Unmarshal(*v, &zones) + if err != nil { + return err + } + vmu.Zones = &zones + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vmu.Tags = tags + } + } + } + + return nil +} + // WindowsConfiguration specifies Windows operating system settings on the virtual machine. type WindowsConfiguration struct { // ProvisionVMAgent - Indicates whether virtual machine agent should be provisioned on the virtual machine.

When this property is not specified in the request body, default behavior is to set it to true. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM later. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/operations.go new file mode 100644 index 000000000000..c2daed42b344 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/operations.go @@ -0,0 +1,98 @@ +package compute + +// 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 compute 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 gets a list of compute operations. +func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) { + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.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, "compute.OperationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.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 = "2017-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Compute/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/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..965327b892ff 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) @@ -96,7 +97,7 @@ func (client SnapshotsClient) CreateOrUpdatePreparer(ctx context.Context, resour } 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.Compute/snapshots/{snapshotName}", pathParameters), @@ -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) @@ -313,7 +314,7 @@ func (client SnapshotsClient) GrantAccessPreparer(ctx context.Context, resourceG } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess", pathParameters), @@ -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 { @@ -639,7 +640,7 @@ func (client SnapshotsClient) UpdatePreparer(ctx context.Context, resourceGroupN } 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.Compute/snapshots/{snapshotName}", pathParameters), 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..c5cbe664cbbd 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 { @@ -75,7 +75,7 @@ func (client VirtualMachineExtensionsClient) CreateOrUpdatePreparer(ctx context. } 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.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters), @@ -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..1a34d205a389 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) @@ -83,7 +83,7 @@ func (client VirtualMachinesClient) CapturePreparer(ctx context.Context, resourc } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture", pathParameters), @@ -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) @@ -244,7 +244,7 @@ func (client VirtualMachinesClient) CreateOrUpdatePreparer(ctx context.Context, } 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.Compute/virtualMachines/{vmName}", pathParameters), @@ -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) @@ -1184,7 +1184,7 @@ func (client VirtualMachinesClient) RunCommandPreparer(ctx context.Context, reso } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommand", pathParameters), @@ -1288,3 +1288,74 @@ func (client VirtualMachinesClient) StartResponder(resp *http.Response) (result result.Response = autorest.Response{Response: resp} return } + +// Update the operation to update a virtual machine. +// +// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine. parameters is +// parameters supplied to the Update Virtual Machine operation. +func (client VirtualMachinesClient) Update(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachineUpdate) (result VirtualMachinesUpdateFuture, err error) { + req, err := client.UpdatePreparer(ctx, resourceGroupName, VMName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client VirtualMachinesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachineUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2017-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", 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 VirtualMachinesClient) UpdateSender(req *http.Request) (future VirtualMachinesUpdateFuture, 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)) + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) UpdateResponder(resp *http.Response) (result VirtualMachine, 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/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..fd630e647853 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 @@ -76,7 +76,7 @@ func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdatePreparer(ctx } 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.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", pathParameters), @@ -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..e13b9017cce9 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) @@ -97,7 +97,7 @@ func (client VirtualMachineScaleSetsClient) CreateOrUpdatePreparer(ctx context.C } 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.Compute/virtualMachineScaleSets/{vmScaleSetName}", pathParameters), @@ -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 { @@ -169,7 +169,7 @@ func (client VirtualMachineScaleSetsClient) DeallocatePreparer(ctx context.Conte } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate", pathParameters), @@ -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) @@ -317,7 +317,7 @@ func (client VirtualMachineScaleSetsClient) DeleteInstancesPreparer(ctx context. } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete", pathParameters), @@ -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 { @@ -870,7 +870,7 @@ func (client VirtualMachineScaleSetsClient) PowerOffPreparer(ctx context.Context } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff", pathParameters), @@ -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 { @@ -944,7 +944,7 @@ func (client VirtualMachineScaleSetsClient) ReimagePreparer(ctx context.Context, } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage", pathParameters), @@ -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 { @@ -1019,7 +1019,7 @@ func (client VirtualMachineScaleSetsClient) ReimageAllPreparer(ctx context.Conte } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall", pathParameters), @@ -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 { @@ -1093,7 +1093,7 @@ func (client VirtualMachineScaleSetsClient) RestartPreparer(ctx context.Context, } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart", pathParameters), @@ -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 { @@ -1167,7 +1167,7 @@ func (client VirtualMachineScaleSetsClient) StartPreparer(ctx context.Context, r } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start", pathParameters), @@ -1241,7 +1241,7 @@ func (client VirtualMachineScaleSetsClient) UpdatePreparer(ctx context.Context, } 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.Compute/virtualMachineScaleSets/{vmScaleSetName}", pathParameters), @@ -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) @@ -1318,7 +1318,7 @@ func (client VirtualMachineScaleSetsClient) UpdateInstancesPreparer(ctx context. } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade", pathParameters), 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..2f666409af63 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) @@ -832,7 +832,7 @@ func (client VirtualMachineScaleSetVMsClient) UpdatePreparer(ctx context.Context } 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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}", pathParameters), 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..71daef48f029 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 @@ -44,7 +44,7 @@ func NewContainerGroupsClientWithBaseURI(baseURI string, subscriptionID string) // // resourceGroupName is the name of the resource group. containerGroupName is the name of the container group. // containerGroup is the properties of the container group to be created or updated. -func (client ContainerGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, containerGroupName string, containerGroup ContainerGroup) (result ContainerGroup, err error) { +func (client ContainerGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, containerGroupName string, containerGroup ContainerGroup) (result ContainerGroupsCreateOrUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: containerGroup, Constraints: []validation.Constraint{{Target: "containerGroup.ContainerGroupProperties", Name: validation.Null, Rule: true, @@ -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) @@ -63,18 +63,12 @@ func (client ContainerGroupsClient) CreateOrUpdate(ctx context.Context, resource return } - resp, err := client.CreateOrUpdateSender(req) + result, err = client.CreateOrUpdateSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "CreateOrUpdate", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "CreateOrUpdate", resp, "Failure responding to request") - } - return } @@ -92,7 +86,7 @@ func (client ContainerGroupsClient) CreateOrUpdatePreparer(ctx context.Context, } 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.ContainerInstance/containerGroups/{containerGroupName}", pathParameters), @@ -103,9 +97,17 @@ func (client ContainerGroupsClient) CreateOrUpdatePreparer(ctx context.Context, // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client ContainerGroupsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) +func (client ContainerGroupsClient) CreateOrUpdateSender(req *http.Request) (future ContainerGroupsCreateOrUpdateFuture, 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)) + return } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -445,9 +447,9 @@ 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. -func (client ContainerGroupsClient) Update(ctx context.Context, resourceGroupName string, containerGroupName string, resource *Resource) (result ContainerGroup, err error) { +// 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 { err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "Update", nil, "Failure preparing request") @@ -470,7 +472,7 @@ func (client ContainerGroupsClient) Update(ctx context.Context, resourceGroupNam } // UpdatePreparer prepares the Update request. -func (client ContainerGroupsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, containerGroupName string, resource *Resource) (*http.Request, error) { +func (client ContainerGroupsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, containerGroupName string, resource Resource) (*http.Request, error) { pathParameters := map[string]interface{}{ "containerGroupName": autorest.Encode("path", containerGroupName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -483,15 +485,12 @@ func (client ContainerGroupsClient) UpdatePreparer(ctx context.Context, resource } 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.ContainerInstance/containerGroups/{containerGroupName}", pathParameters), + autorest.WithJSON(resource), autorest.WithQueryParameters(queryParameters)) - if resource != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(resource)) - } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } 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..a68957c7e977 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 @@ -20,6 +20,7 @@ package containerinstance import ( "encoding/json" "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" @@ -35,6 +36,11 @@ const ( UDP ContainerGroupNetworkProtocol = "UDP" ) +// PossibleContainerGroupNetworkProtocolValues returns an array of possible values for the ContainerGroupNetworkProtocol const type. +func PossibleContainerGroupNetworkProtocolValues() []ContainerGroupNetworkProtocol { + return []ContainerGroupNetworkProtocol{TCP, UDP} +} + // ContainerGroupRestartPolicy enumerates the values for container group restart policy. type ContainerGroupRestartPolicy string @@ -47,6 +53,11 @@ const ( OnFailure ContainerGroupRestartPolicy = "OnFailure" ) +// PossibleContainerGroupRestartPolicyValues returns an array of possible values for the ContainerGroupRestartPolicy const type. +func PossibleContainerGroupRestartPolicyValues() []ContainerGroupRestartPolicy { + return []ContainerGroupRestartPolicy{Always, Never, OnFailure} +} + // ContainerNetworkProtocol enumerates the values for container network protocol. type ContainerNetworkProtocol string @@ -57,6 +68,11 @@ const ( ContainerNetworkProtocolUDP ContainerNetworkProtocol = "UDP" ) +// PossibleContainerNetworkProtocolValues returns an array of possible values for the ContainerNetworkProtocol const type. +func PossibleContainerNetworkProtocolValues() []ContainerNetworkProtocol { + return []ContainerNetworkProtocol{ContainerNetworkProtocolTCP, ContainerNetworkProtocolUDP} +} + // OperatingSystemTypes enumerates the values for operating system types. type OperatingSystemTypes string @@ -67,6 +83,11 @@ const ( Windows OperatingSystemTypes = "Windows" ) +// PossibleOperatingSystemTypesValues returns an array of possible values for the OperatingSystemTypes const type. +func PossibleOperatingSystemTypesValues() []OperatingSystemTypes { + return []OperatingSystemTypes{Linux, Windows} +} + // OperationsOrigin enumerates the values for operations origin. type OperationsOrigin string @@ -77,6 +98,11 @@ const ( User OperationsOrigin = "User" ) +// PossibleOperationsOriginValues returns an array of possible values for the OperationsOrigin const type. +func PossibleOperationsOriginValues() []OperationsOrigin { + return []OperationsOrigin{System, User} +} + // AzureFileVolume the properties of the Azure File volume. Azure File shares are mounted as volumes. type AzureFileVolume struct { // ShareName - The name of the Azure File share to be mounted as a volume. @@ -97,6 +123,18 @@ type Container struct { *ContainerProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for Container. +func (c Container) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.Name != nil { + objectMap["name"] = c.Name + } + if c.ContainerProperties != nil { + objectMap["properties"] = c.ContainerProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for Container struct. func (c *Container) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -104,34 +142,61 @@ 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 } +// ContainerExecRequest the start container exec request. +type ContainerExecRequest struct { + // Command - The command to be executed. + Command *string `json:"command,omitempty"` + // TerminalSize - The size of the terminal. + TerminalSize *ContainerExecRequestTerminalSize `json:"terminalSize,omitempty"` +} + +// ContainerExecRequestTerminalSize the size of the terminal. +type ContainerExecRequestTerminalSize struct { + // Rows - The row size of the terminal + Rows *int32 `json:"rows,omitempty"` + // Cols - The column size of the terminal + Cols *int32 `json:"cols,omitempty"` +} + +// ContainerExecResponse the information for the container exec command. +type ContainerExecResponse struct { + autorest.Response `json:"-"` + // WebSocketURI - The uri for the exec websocket. + WebSocketURI *string `json:"webSocketUri,omitempty"` + // Password - The password to start the exec command. + Password *string `json:"password,omitempty"` +} + // 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 +206,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 @@ -351,6 +436,55 @@ type ContainerGroupPropertiesInstanceView struct { State *string `json:"state,omitempty"` } +// ContainerGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ContainerGroupsCreateOrUpdateFuture 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 ContainerGroupsCreateOrUpdateFuture) Result(client ContainerGroupsClient) (cg ContainerGroup, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + return cg, azure.NewAsyncOpIncompleteError("containerinstance.ContainerGroupsCreateOrUpdateFuture") + } + if future.PollingMethod() == azure.PollingLocation { + cg, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsCreateOrUpdateFuture", "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, "containerinstance.ContainerGroupsCreateOrUpdateFuture", "Result", resp, "Failure sending request") + return + } + cg, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } + return +} + // ContainerPort the port exposed on the container instance. type ContainerPort struct { // Protocol - The protocol associated with the port. Possible values include: 'ContainerNetworkProtocolTCP', 'ContainerNetworkProtocolUDP' @@ -490,7 +624,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 +653,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 +734,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/startcontainer.go b/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-02-01-preview/containerinstance/startcontainer.go new file mode 100644 index 000000000000..7db3b7e32b3d --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-02-01-preview/containerinstance/startcontainer.go @@ -0,0 +1,111 @@ +package containerinstance + +// 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" +) + +// StartContainerClient is the client for the StartContainer methods of the Containerinstance service. +type StartContainerClient struct { + BaseClient +} + +// NewStartContainerClient creates an instance of the StartContainerClient client. +func NewStartContainerClient(subscriptionID string) StartContainerClient { + return NewStartContainerClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewStartContainerClientWithBaseURI creates an instance of the StartContainerClient client. +func NewStartContainerClientWithBaseURI(baseURI string, subscriptionID string) StartContainerClient { + return StartContainerClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// LaunchExec starts the exec command for a specified container instance in a specified resource group and container +// group. +// +// resourceGroupName is the name of the resource group. containerGroupName is the name of the container group. +// containerName is the name of the container instance. containerExecRequest is the request for the exec command. +func (client StartContainerClient) LaunchExec(ctx context.Context, resourceGroupName string, containerGroupName string, containerName string, containerExecRequest ContainerExecRequest) (result ContainerExecResponse, err error) { + req, err := client.LaunchExecPreparer(ctx, resourceGroupName, containerGroupName, containerName, containerExecRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.StartContainerClient", "LaunchExec", nil, "Failure preparing request") + return + } + + resp, err := client.LaunchExecSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerinstance.StartContainerClient", "LaunchExec", resp, "Failure sending request") + return + } + + result, err = client.LaunchExecResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.StartContainerClient", "LaunchExec", resp, "Failure responding to request") + } + + return +} + +// LaunchExecPreparer prepares the LaunchExec request. +func (client StartContainerClient) LaunchExecPreparer(ctx context.Context, resourceGroupName string, containerGroupName string, containerName string, containerExecRequest ContainerExecRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerGroupName": autorest.Encode("path", containerGroupName), + "containerName": autorest.Encode("path", containerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-02-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/exec", pathParameters), + autorest.WithJSON(containerExecRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// LaunchExecSender sends the LaunchExec request. The method will close the +// http.Response Body if it receives an error. +func (client StartContainerClient) LaunchExecSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// LaunchExecResponder handles the response to the LaunchExec request. The method always +// closes the http.Response Body. +func (client StartContainerClient) LaunchExecResponder(resp *http.Response) (result ContainerExecResponse, 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/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..61c6cd67b3ce 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 @@ -36,6 +36,11 @@ const ( Password2 PasswordName = "password2" ) +// PossiblePasswordNameValues returns an array of possible values for the PasswordName const type. +func PossiblePasswordNameValues() []PasswordName { + return []PasswordName{Password, Password2} +} + // ProvisioningState enumerates the values for provisioning state. type ProvisioningState string @@ -54,6 +59,11 @@ const ( Updating ProvisioningState = "Updating" ) +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{Canceled, Creating, Deleting, Failed, Succeeded, Updating} +} + // RegistryUsageUnit enumerates the values for registry usage unit. type RegistryUsageUnit string @@ -64,6 +74,11 @@ const ( Count RegistryUsageUnit = "Count" ) +// PossibleRegistryUsageUnitValues returns an array of possible values for the RegistryUsageUnit const type. +func PossibleRegistryUsageUnitValues() []RegistryUsageUnit { + return []RegistryUsageUnit{Bytes, Count} +} + // SkuName enumerates the values for sku name. type SkuName string @@ -78,6 +93,11 @@ const ( Standard SkuName = "Standard" ) +// PossibleSkuNameValues returns an array of possible values for the SkuName const type. +func PossibleSkuNameValues() []SkuName { + return []SkuName{Basic, Classic, Premium, Standard} +} + // SkuTier enumerates the values for sku tier. type SkuTier string @@ -92,6 +112,11 @@ const ( SkuTierStandard SkuTier = "Standard" ) +// PossibleSkuTierValues returns an array of possible values for the SkuTier const type. +func PossibleSkuTierValues() []SkuTier { + return []SkuTier{SkuTierBasic, SkuTierClassic, SkuTierPremium, SkuTierStandard} +} + // WebhookAction enumerates the values for webhook action. type WebhookAction string @@ -102,6 +127,11 @@ const ( Push WebhookAction = "push" ) +// PossibleWebhookActionValues returns an array of possible values for the WebhookAction const type. +func PossibleWebhookActionValues() []WebhookAction { + return []WebhookAction{Delete, Push} +} + // WebhookStatus enumerates the values for webhook status. type WebhookStatus string @@ -112,8 +142,13 @@ const ( Enabled WebhookStatus = "enabled" ) -// Actor the agent that initiated the event. For most situations, this could be from the authorization context of the -// request. +// PossibleWebhookStatusValues returns an array of possible values for the WebhookStatus const type. +func PossibleWebhookStatusValues() []WebhookStatus { + return []WebhookStatus{Disabled, Enabled} +} + +// 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 +160,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 +317,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 +326,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 +361,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 +522,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 +570,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 +618,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 +670,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 +943,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 +972,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 + 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.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 - } - rup.RegistryPropertiesUpdateParameters = &properties } return nil @@ -851,6 +1029,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 +1040,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 +1258,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 +1306,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 +1354,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 +1430,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 +1462,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 +1481,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 +1509,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 +1520,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 +1619,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 +1648,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 + 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.Location = &location - } - - v = m["properties"] - if v != nil { - var properties WebhookPropertiesCreateParameters - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - wcp.WebhookPropertiesCreateParameters = &properties } return nil @@ -1486,7 +1802,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 +1811,33 @@ 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 + } + if wpcp.Status != "" { + 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 +1846,27 @@ 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 + } + if wpup.Status != "" { + 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 +1879,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 +1927,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 +1975,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 +2038,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..2157367e5390 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) @@ -89,7 +89,7 @@ func (client RegistriesClient) CheckNameAvailabilityPreparer(ctx context.Context } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/checkNameAvailability", pathParameters), @@ -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) @@ -166,7 +166,7 @@ func (client RegistriesClient) CreatePreparer(ctx context.Context, resourceGroup } 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.ContainerRegistry/registries/{registryName}", pathParameters), @@ -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) @@ -736,7 +736,7 @@ func (client RegistriesClient) RegenerateCredentialPreparer(ctx context.Context, } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/regenerateCredential", pathParameters), @@ -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) @@ -807,7 +807,7 @@ func (client RegistriesClient) UpdatePreparer(ctx context.Context, resourceGroup } 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.ContainerRegistry/registries/{registryName}", pathParameters), 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..9bb5b87928db 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) @@ -88,7 +88,7 @@ func (client ReplicationsClient) CreatePreparer(ctx context.Context, resourceGro } 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.ContainerRegistry/registries/{registryName}/replications/{replicationName}", pathParameters), @@ -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) @@ -437,7 +437,7 @@ func (client ReplicationsClient) UpdatePreparer(ctx context.Context, resourceGro } 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.ContainerRegistry/registries/{registryName}/replications/{replicationName}", pathParameters), 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..09eab0c91688 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) @@ -94,7 +94,7 @@ func (client WebhooksClient) CreatePreparer(ctx context.Context, resourceGroupNa } 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.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}", pathParameters), @@ -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) @@ -711,7 +711,7 @@ func (client WebhooksClient) UpdatePreparer(ctx context.Context, resourceGroupNa } 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.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}", pathParameters), 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..574c4cb17f48 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) @@ -111,7 +110,7 @@ func (client ContainerServicesClient) CreateOrUpdatePreparer(ctx context.Context } 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.ContainerService/containerServices/{containerServiceName}", pathParameters), @@ -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..ad1a847e8cfc 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) @@ -95,7 +95,7 @@ func (client ManagedClustersClient) CreateOrUpdatePreparer(ctx context.Context, } 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.ContainerService/managedClusters/{resourceName}", pathParameters), 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..82b6808bd5e2 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 @@ -41,6 +41,11 @@ const ( Swarm OrchestratorTypes = "Swarm" ) +// PossibleOrchestratorTypesValues returns an array of possible values for the OrchestratorTypes const type. +func PossibleOrchestratorTypesValues() []OrchestratorTypes { + return []OrchestratorTypes{Custom, DCOS, DockerCE, Kubernetes, Swarm} +} + // OSType enumerates the values for os type. type OSType string @@ -51,6 +56,11 @@ const ( Windows OSType = "Windows" ) +// PossibleOSTypeValues returns an array of possible values for the OSType const type. +func PossibleOSTypeValues() []OSType { + return []OSType{Linux, Windows} +} + // StorageProfileTypes enumerates the values for storage profile types. type StorageProfileTypes string @@ -61,6 +71,11 @@ const ( StorageAccount StorageProfileTypes = "StorageAccount" ) +// PossibleStorageProfileTypesValues returns an array of possible values for the StorageProfileTypes const type. +func PossibleStorageProfileTypesValues() []StorageProfileTypes { + return []StorageProfileTypes{ManagedDisks, StorageAccount} +} + // VMSizeTypes enumerates the values for vm size types. type VMSizeTypes string @@ -103,6 +118,18 @@ const ( StandardA8V2 VMSizeTypes = "Standard_A8_v2" // StandardA9 ... StandardA9 VMSizeTypes = "Standard_A9" + // StandardB1ms ... + StandardB1ms VMSizeTypes = "Standard_B1ms" + // StandardB1s ... + StandardB1s VMSizeTypes = "Standard_B1s" + // StandardB2ms ... + StandardB2ms VMSizeTypes = "Standard_B2ms" + // StandardB2s ... + StandardB2s VMSizeTypes = "Standard_B2s" + // StandardB4ms ... + StandardB4ms VMSizeTypes = "Standard_B4ms" + // StandardB8ms ... + StandardB8ms VMSizeTypes = "Standard_B8ms" // StandardD1 ... StandardD1 VMSizeTypes = "Standard_D1" // StandardD11 ... @@ -149,6 +176,10 @@ const ( StandardD2V3 VMSizeTypes = "Standard_D2_v3" // StandardD3 ... StandardD3 VMSizeTypes = "Standard_D3" + // StandardD32sV3 ... + StandardD32sV3 VMSizeTypes = "Standard_D32s_v3" + // StandardD32V3 ... + StandardD32V3 VMSizeTypes = "Standard_D32_v3" // StandardD3V2 ... StandardD3V2 VMSizeTypes = "Standard_D3_v2" // StandardD3V2Promo ... @@ -167,6 +198,10 @@ const ( StandardD5V2 VMSizeTypes = "Standard_D5_v2" // StandardD5V2Promo ... StandardD5V2Promo VMSizeTypes = "Standard_D5_v2_Promo" + // StandardD64sV3 ... + StandardD64sV3 VMSizeTypes = "Standard_D64s_v3" + // StandardD64V3 ... + StandardD64V3 VMSizeTypes = "Standard_D64_v3" // StandardD8sV3 ... StandardD8sV3 VMSizeTypes = "Standard_D8s_v3" // StandardD8V3 ... @@ -187,12 +222,20 @@ const ( StandardDS12V2Promo VMSizeTypes = "Standard_DS12_v2_Promo" // StandardDS13 ... StandardDS13 VMSizeTypes = "Standard_DS13" + // StandardDS132V2 ... + StandardDS132V2 VMSizeTypes = "Standard_DS13-2_v2" + // StandardDS134V2 ... + StandardDS134V2 VMSizeTypes = "Standard_DS13-4_v2" // StandardDS13V2 ... StandardDS13V2 VMSizeTypes = "Standard_DS13_v2" // StandardDS13V2Promo ... StandardDS13V2Promo VMSizeTypes = "Standard_DS13_v2_Promo" // StandardDS14 ... StandardDS14 VMSizeTypes = "Standard_DS14" + // StandardDS144V2 ... + StandardDS144V2 VMSizeTypes = "Standard_DS14-4_v2" + // StandardDS148V2 ... + StandardDS148V2 VMSizeTypes = "Standard_DS14-8_v2" // StandardDS14V2 ... StandardDS14V2 VMSizeTypes = "Standard_DS14_v2" // StandardDS14V2Promo ... @@ -231,6 +274,10 @@ const ( StandardE2sV3 VMSizeTypes = "Standard_E2s_v3" // StandardE2V3 ... StandardE2V3 VMSizeTypes = "Standard_E2_v3" + // StandardE3216sV3 ... + StandardE3216sV3 VMSizeTypes = "Standard_E32-16s_v3" + // StandardE328sV3 ... + StandardE328sV3 VMSizeTypes = "Standard_E32-8s_v3" // StandardE32sV3 ... StandardE32sV3 VMSizeTypes = "Standard_E32s_v3" // StandardE32V3 ... @@ -239,6 +286,10 @@ const ( StandardE4sV3 VMSizeTypes = "Standard_E4s_v3" // StandardE4V3 ... StandardE4V3 VMSizeTypes = "Standard_E4_v3" + // StandardE6416sV3 ... + StandardE6416sV3 VMSizeTypes = "Standard_E64-16s_v3" + // StandardE6432sV3 ... + StandardE6432sV3 VMSizeTypes = "Standard_E64-32s_v3" // StandardE64sV3 ... StandardE64sV3 VMSizeTypes = "Standard_E64s_v3" // StandardE64V3 ... @@ -253,20 +304,34 @@ const ( StandardF16 VMSizeTypes = "Standard_F16" // StandardF16s ... StandardF16s VMSizeTypes = "Standard_F16s" + // StandardF16sV2 ... + StandardF16sV2 VMSizeTypes = "Standard_F16s_v2" // StandardF1s ... StandardF1s VMSizeTypes = "Standard_F1s" // StandardF2 ... StandardF2 VMSizeTypes = "Standard_F2" // StandardF2s ... StandardF2s VMSizeTypes = "Standard_F2s" + // StandardF2sV2 ... + StandardF2sV2 VMSizeTypes = "Standard_F2s_v2" + // StandardF32sV2 ... + StandardF32sV2 VMSizeTypes = "Standard_F32s_v2" // StandardF4 ... StandardF4 VMSizeTypes = "Standard_F4" // StandardF4s ... StandardF4s VMSizeTypes = "Standard_F4s" + // StandardF4sV2 ... + StandardF4sV2 VMSizeTypes = "Standard_F4s_v2" + // StandardF64sV2 ... + StandardF64sV2 VMSizeTypes = "Standard_F64s_v2" + // StandardF72sV2 ... + StandardF72sV2 VMSizeTypes = "Standard_F72s_v2" // StandardF8 ... StandardF8 VMSizeTypes = "Standard_F8" // StandardF8s ... StandardF8s VMSizeTypes = "Standard_F8s" + // StandardF8sV2 ... + StandardF8sV2 VMSizeTypes = "Standard_F8s_v2" // StandardG1 ... StandardG1 VMSizeTypes = "Standard_G1" // StandardG2 ... @@ -285,8 +350,16 @@ const ( StandardGS3 VMSizeTypes = "Standard_GS3" // StandardGS4 ... StandardGS4 VMSizeTypes = "Standard_GS4" + // StandardGS44 ... + StandardGS44 VMSizeTypes = "Standard_GS4-4" + // StandardGS48 ... + StandardGS48 VMSizeTypes = "Standard_GS4-8" // StandardGS5 ... StandardGS5 VMSizeTypes = "Standard_GS5" + // StandardGS516 ... + StandardGS516 VMSizeTypes = "Standard_GS5-16" + // StandardGS58 ... + StandardGS58 VMSizeTypes = "Standard_GS5-8" // StandardH16 ... StandardH16 VMSizeTypes = "Standard_H16" // StandardH16m ... @@ -307,18 +380,54 @@ const ( StandardL4s VMSizeTypes = "Standard_L4s" // StandardL8s ... StandardL8s VMSizeTypes = "Standard_L8s" + // StandardM12832ms ... + StandardM12832ms VMSizeTypes = "Standard_M128-32ms" + // StandardM12864ms ... + StandardM12864ms VMSizeTypes = "Standard_M128-64ms" + // StandardM128ms ... + StandardM128ms VMSizeTypes = "Standard_M128ms" // StandardM128s ... StandardM128s VMSizeTypes = "Standard_M128s" + // StandardM6416ms ... + StandardM6416ms VMSizeTypes = "Standard_M64-16ms" + // StandardM6432ms ... + StandardM6432ms VMSizeTypes = "Standard_M64-32ms" // StandardM64ms ... StandardM64ms VMSizeTypes = "Standard_M64ms" + // StandardM64s ... + StandardM64s VMSizeTypes = "Standard_M64s" // StandardNC12 ... StandardNC12 VMSizeTypes = "Standard_NC12" + // StandardNC12sV2 ... + StandardNC12sV2 VMSizeTypes = "Standard_NC12s_v2" + // StandardNC12sV3 ... + StandardNC12sV3 VMSizeTypes = "Standard_NC12s_v3" // StandardNC24 ... StandardNC24 VMSizeTypes = "Standard_NC24" // StandardNC24r ... StandardNC24r VMSizeTypes = "Standard_NC24r" + // StandardNC24rsV2 ... + StandardNC24rsV2 VMSizeTypes = "Standard_NC24rs_v2" + // StandardNC24rsV3 ... + StandardNC24rsV3 VMSizeTypes = "Standard_NC24rs_v3" + // StandardNC24sV2 ... + StandardNC24sV2 VMSizeTypes = "Standard_NC24s_v2" + // StandardNC24sV3 ... + StandardNC24sV3 VMSizeTypes = "Standard_NC24s_v3" // StandardNC6 ... StandardNC6 VMSizeTypes = "Standard_NC6" + // StandardNC6sV2 ... + StandardNC6sV2 VMSizeTypes = "Standard_NC6s_v2" + // StandardNC6sV3 ... + StandardNC6sV3 VMSizeTypes = "Standard_NC6s_v3" + // StandardND12s ... + StandardND12s VMSizeTypes = "Standard_ND12s" + // StandardND24rs ... + StandardND24rs VMSizeTypes = "Standard_ND24rs" + // StandardND24s ... + StandardND24s VMSizeTypes = "Standard_ND24s" + // StandardND6s ... + StandardND6s VMSizeTypes = "Standard_ND6s" // StandardNV12 ... StandardNV12 VMSizeTypes = "Standard_NV12" // StandardNV24 ... @@ -327,10 +436,15 @@ const ( StandardNV6 VMSizeTypes = "Standard_NV6" ) +// PossibleVMSizeTypesValues returns an array of possible values for the VMSizeTypes const type. +func PossibleVMSizeTypesValues() []VMSizeTypes { + return []VMSizeTypes{StandardA0, StandardA1, StandardA10, StandardA11, StandardA1V2, StandardA2, StandardA2mV2, StandardA2V2, StandardA3, StandardA4, StandardA4mV2, StandardA4V2, StandardA5, StandardA6, StandardA7, StandardA8, StandardA8mV2, StandardA8V2, StandardA9, StandardB1ms, StandardB1s, StandardB2ms, StandardB2s, StandardB4ms, StandardB8ms, StandardD1, StandardD11, StandardD11V2, StandardD11V2Promo, StandardD12, StandardD12V2, StandardD12V2Promo, StandardD13, StandardD13V2, StandardD13V2Promo, StandardD14, StandardD14V2, StandardD14V2Promo, StandardD15V2, StandardD16sV3, StandardD16V3, StandardD1V2, StandardD2, StandardD2sV3, StandardD2V2, StandardD2V2Promo, StandardD2V3, StandardD3, StandardD32sV3, StandardD32V3, StandardD3V2, StandardD3V2Promo, StandardD4, StandardD4sV3, StandardD4V2, StandardD4V2Promo, StandardD4V3, StandardD5V2, StandardD5V2Promo, StandardD64sV3, StandardD64V3, StandardD8sV3, StandardD8V3, StandardDS1, StandardDS11, StandardDS11V2, StandardDS11V2Promo, StandardDS12, StandardDS12V2, StandardDS12V2Promo, StandardDS13, StandardDS132V2, StandardDS134V2, StandardDS13V2, StandardDS13V2Promo, StandardDS14, StandardDS144V2, StandardDS148V2, StandardDS14V2, StandardDS14V2Promo, StandardDS15V2, StandardDS1V2, StandardDS2, StandardDS2V2, StandardDS2V2Promo, StandardDS3, StandardDS3V2, StandardDS3V2Promo, StandardDS4, StandardDS4V2, StandardDS4V2Promo, StandardDS5V2, StandardDS5V2Promo, StandardE16sV3, StandardE16V3, StandardE2sV3, StandardE2V3, StandardE3216sV3, StandardE328sV3, StandardE32sV3, StandardE32V3, StandardE4sV3, StandardE4V3, StandardE6416sV3, StandardE6432sV3, StandardE64sV3, StandardE64V3, StandardE8sV3, StandardE8V3, StandardF1, StandardF16, StandardF16s, StandardF16sV2, StandardF1s, StandardF2, StandardF2s, StandardF2sV2, StandardF32sV2, StandardF4, StandardF4s, StandardF4sV2, StandardF64sV2, StandardF72sV2, StandardF8, StandardF8s, StandardF8sV2, StandardG1, StandardG2, StandardG3, StandardG4, StandardG5, StandardGS1, StandardGS2, StandardGS3, StandardGS4, StandardGS44, StandardGS48, StandardGS5, StandardGS516, StandardGS58, StandardH16, StandardH16m, StandardH16mr, StandardH16r, StandardH8, StandardH8m, StandardL16s, StandardL32s, StandardL4s, StandardL8s, StandardM12832ms, StandardM12864ms, StandardM128ms, StandardM128s, StandardM6416ms, StandardM6432ms, StandardM64ms, StandardM64s, StandardNC12, StandardNC12sV2, StandardNC12sV3, StandardNC24, StandardNC24r, StandardNC24rsV2, StandardNC24rsV3, StandardNC24sV2, StandardNC24sV3, StandardNC6, StandardNC6sV2, StandardNC6sV3, StandardND12s, StandardND24rs, StandardND24s, StandardND6s, StandardNV12, StandardNV24, StandardNV6} +} + // AccessProfile profile for enabling a user to access a managed cluster. type AccessProfile struct { // KubeConfig - Base64-encoded Kubernetes configuration file. - KubeConfig *string `json:"kubeConfig,omitempty"` + KubeConfig *[]byte `json:"kubeConfig,omitempty"` } // AgentPoolProfile profile for the container service agent pool. @@ -339,7 +453,7 @@ type AgentPoolProfile struct { Name *string `json:"name,omitempty"` // Count - Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. Count *int32 `json:"count,omitempty"` - // VMSize - Size of agent VMs. Possible values include: 'StandardA0', 'StandardA1', 'StandardA10', 'StandardA11', 'StandardA1V2', 'StandardA2', 'StandardA2V2', 'StandardA2mV2', 'StandardA3', 'StandardA4', 'StandardA4V2', 'StandardA4mV2', 'StandardA5', 'StandardA6', 'StandardA7', 'StandardA8', 'StandardA8V2', 'StandardA8mV2', 'StandardA9', 'StandardD1', 'StandardD11', 'StandardD11V2', 'StandardD11V2Promo', 'StandardD12', 'StandardD12V2', 'StandardD12V2Promo', 'StandardD13', 'StandardD13V2', 'StandardD13V2Promo', 'StandardD14', 'StandardD14V2', 'StandardD14V2Promo', 'StandardD15V2', 'StandardD16V3', 'StandardD16sV3', 'StandardD1V2', 'StandardD2', 'StandardD2V2', 'StandardD2V2Promo', 'StandardD2V3', 'StandardD2sV3', 'StandardD3', 'StandardD3V2', 'StandardD3V2Promo', 'StandardD4', 'StandardD4V2', 'StandardD4V2Promo', 'StandardD4V3', 'StandardD4sV3', 'StandardD5V2', 'StandardD5V2Promo', 'StandardD8V3', 'StandardD8sV3', 'StandardDS1', 'StandardDS11', 'StandardDS11V2', 'StandardDS11V2Promo', 'StandardDS12', 'StandardDS12V2', 'StandardDS12V2Promo', 'StandardDS13', 'StandardDS13V2', 'StandardDS13V2Promo', 'StandardDS14', 'StandardDS14V2', 'StandardDS14V2Promo', 'StandardDS15V2', 'StandardDS1V2', 'StandardDS2', 'StandardDS2V2', 'StandardDS2V2Promo', 'StandardDS3', 'StandardDS3V2', 'StandardDS3V2Promo', 'StandardDS4', 'StandardDS4V2', 'StandardDS4V2Promo', 'StandardDS5V2', 'StandardDS5V2Promo', 'StandardE16V3', 'StandardE16sV3', 'StandardE2V3', 'StandardE2sV3', 'StandardE32V3', 'StandardE32sV3', 'StandardE4V3', 'StandardE4sV3', 'StandardE64V3', 'StandardE64sV3', 'StandardE8V3', 'StandardE8sV3', 'StandardF1', 'StandardF16', 'StandardF16s', 'StandardF1s', 'StandardF2', 'StandardF2s', 'StandardF4', 'StandardF4s', 'StandardF8', 'StandardF8s', 'StandardG1', 'StandardG2', 'StandardG3', 'StandardG4', 'StandardG5', 'StandardGS1', 'StandardGS2', 'StandardGS3', 'StandardGS4', 'StandardGS5', 'StandardH16', 'StandardH16m', 'StandardH16mr', 'StandardH16r', 'StandardH8', 'StandardH8m', 'StandardL16s', 'StandardL32s', 'StandardL4s', 'StandardL8s', 'StandardM128s', 'StandardM64ms', 'StandardNC12', 'StandardNC24', 'StandardNC24r', 'StandardNC6', 'StandardNV12', 'StandardNV24', 'StandardNV6' + // VMSize - Size of agent VMs. Possible values include: 'StandardA0', 'StandardA1', 'StandardA10', 'StandardA11', 'StandardA1V2', 'StandardA2', 'StandardA2V2', 'StandardA2mV2', 'StandardA3', 'StandardA4', 'StandardA4V2', 'StandardA4mV2', 'StandardA5', 'StandardA6', 'StandardA7', 'StandardA8', 'StandardA8V2', 'StandardA8mV2', 'StandardA9', 'StandardB1ms', 'StandardB1s', 'StandardB2ms', 'StandardB2s', 'StandardB4ms', 'StandardB8ms', 'StandardD1', 'StandardD11', 'StandardD11V2', 'StandardD11V2Promo', 'StandardD12', 'StandardD12V2', 'StandardD12V2Promo', 'StandardD13', 'StandardD13V2', 'StandardD13V2Promo', 'StandardD14', 'StandardD14V2', 'StandardD14V2Promo', 'StandardD15V2', 'StandardD16V3', 'StandardD16sV3', 'StandardD1V2', 'StandardD2', 'StandardD2V2', 'StandardD2V2Promo', 'StandardD2V3', 'StandardD2sV3', 'StandardD3', 'StandardD32V3', 'StandardD32sV3', 'StandardD3V2', 'StandardD3V2Promo', 'StandardD4', 'StandardD4V2', 'StandardD4V2Promo', 'StandardD4V3', 'StandardD4sV3', 'StandardD5V2', 'StandardD5V2Promo', 'StandardD64V3', 'StandardD64sV3', 'StandardD8V3', 'StandardD8sV3', 'StandardDS1', 'StandardDS11', 'StandardDS11V2', 'StandardDS11V2Promo', 'StandardDS12', 'StandardDS12V2', 'StandardDS12V2Promo', 'StandardDS13', 'StandardDS132V2', 'StandardDS134V2', 'StandardDS13V2', 'StandardDS13V2Promo', 'StandardDS14', 'StandardDS144V2', 'StandardDS148V2', 'StandardDS14V2', 'StandardDS14V2Promo', 'StandardDS15V2', 'StandardDS1V2', 'StandardDS2', 'StandardDS2V2', 'StandardDS2V2Promo', 'StandardDS3', 'StandardDS3V2', 'StandardDS3V2Promo', 'StandardDS4', 'StandardDS4V2', 'StandardDS4V2Promo', 'StandardDS5V2', 'StandardDS5V2Promo', 'StandardE16V3', 'StandardE16sV3', 'StandardE2V3', 'StandardE2sV3', 'StandardE3216sV3', 'StandardE328sV3', 'StandardE32V3', 'StandardE32sV3', 'StandardE4V3', 'StandardE4sV3', 'StandardE6416sV3', 'StandardE6432sV3', 'StandardE64V3', 'StandardE64sV3', 'StandardE8V3', 'StandardE8sV3', 'StandardF1', 'StandardF16', 'StandardF16s', 'StandardF16sV2', 'StandardF1s', 'StandardF2', 'StandardF2s', 'StandardF2sV2', 'StandardF32sV2', 'StandardF4', 'StandardF4s', 'StandardF4sV2', 'StandardF64sV2', 'StandardF72sV2', 'StandardF8', 'StandardF8s', 'StandardF8sV2', 'StandardG1', 'StandardG2', 'StandardG3', 'StandardG4', 'StandardG5', 'StandardGS1', 'StandardGS2', 'StandardGS3', 'StandardGS4', 'StandardGS44', 'StandardGS48', 'StandardGS5', 'StandardGS516', 'StandardGS58', 'StandardH16', 'StandardH16m', 'StandardH16mr', 'StandardH16r', 'StandardH8', 'StandardH8m', 'StandardL16s', 'StandardL32s', 'StandardL4s', 'StandardL8s', 'StandardM12832ms', 'StandardM12864ms', 'StandardM128ms', 'StandardM128s', 'StandardM6416ms', 'StandardM6432ms', 'StandardM64ms', 'StandardM64s', 'StandardNC12', 'StandardNC12sV2', 'StandardNC12sV3', 'StandardNC24', 'StandardNC24r', 'StandardNC24rsV2', 'StandardNC24rsV3', 'StandardNC24sV2', 'StandardNC24sV3', 'StandardNC6', 'StandardNC6sV2', 'StandardNC6sV3', 'StandardND12s', 'StandardND24rs', 'StandardND24s', 'StandardND6s', 'StandardNV12', 'StandardNV24', 'StandardNV6' VMSize VMSizeTypes `json:"vmSize,omitempty"` // OsDiskSizeGB - OS Disk Size in GB to be used to specify the disk size for every machine in this master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. OsDiskSizeGB *int32 `json:"osDiskSizeGB,omitempty"` @@ -360,6 +474,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 +485,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 +814,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 +825,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 +924,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 +935,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 +1176,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 +1225,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 } @@ -1027,6 +1274,24 @@ type ManagedClusterUpgradeProfile struct { *ManagedClusterUpgradeProfileProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for ManagedClusterUpgradeProfile. +func (mcup ManagedClusterUpgradeProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcup.ID != nil { + objectMap["id"] = mcup.ID + } + if mcup.Name != nil { + objectMap["name"] = mcup.Name + } + if mcup.Type != nil { + objectMap["type"] = mcup.Type + } + if mcup.ManagedClusterUpgradeProfileProperties != nil { + objectMap["properties"] = mcup.ManagedClusterUpgradeProfileProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for ManagedClusterUpgradeProfile struct. func (mcup *ManagedClusterUpgradeProfile) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -1034,46 +1299,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 @@ -1093,7 +1357,7 @@ type MasterProfile struct { Count *int32 `json:"count,omitempty"` // DNSPrefix - DNS prefix to be used to create the FQDN for the master pool. DNSPrefix *string `json:"dnsPrefix,omitempty"` - // VMSize - Size of agent VMs. Possible values include: 'StandardA0', 'StandardA1', 'StandardA10', 'StandardA11', 'StandardA1V2', 'StandardA2', 'StandardA2V2', 'StandardA2mV2', 'StandardA3', 'StandardA4', 'StandardA4V2', 'StandardA4mV2', 'StandardA5', 'StandardA6', 'StandardA7', 'StandardA8', 'StandardA8V2', 'StandardA8mV2', 'StandardA9', 'StandardD1', 'StandardD11', 'StandardD11V2', 'StandardD11V2Promo', 'StandardD12', 'StandardD12V2', 'StandardD12V2Promo', 'StandardD13', 'StandardD13V2', 'StandardD13V2Promo', 'StandardD14', 'StandardD14V2', 'StandardD14V2Promo', 'StandardD15V2', 'StandardD16V3', 'StandardD16sV3', 'StandardD1V2', 'StandardD2', 'StandardD2V2', 'StandardD2V2Promo', 'StandardD2V3', 'StandardD2sV3', 'StandardD3', 'StandardD3V2', 'StandardD3V2Promo', 'StandardD4', 'StandardD4V2', 'StandardD4V2Promo', 'StandardD4V3', 'StandardD4sV3', 'StandardD5V2', 'StandardD5V2Promo', 'StandardD8V3', 'StandardD8sV3', 'StandardDS1', 'StandardDS11', 'StandardDS11V2', 'StandardDS11V2Promo', 'StandardDS12', 'StandardDS12V2', 'StandardDS12V2Promo', 'StandardDS13', 'StandardDS13V2', 'StandardDS13V2Promo', 'StandardDS14', 'StandardDS14V2', 'StandardDS14V2Promo', 'StandardDS15V2', 'StandardDS1V2', 'StandardDS2', 'StandardDS2V2', 'StandardDS2V2Promo', 'StandardDS3', 'StandardDS3V2', 'StandardDS3V2Promo', 'StandardDS4', 'StandardDS4V2', 'StandardDS4V2Promo', 'StandardDS5V2', 'StandardDS5V2Promo', 'StandardE16V3', 'StandardE16sV3', 'StandardE2V3', 'StandardE2sV3', 'StandardE32V3', 'StandardE32sV3', 'StandardE4V3', 'StandardE4sV3', 'StandardE64V3', 'StandardE64sV3', 'StandardE8V3', 'StandardE8sV3', 'StandardF1', 'StandardF16', 'StandardF16s', 'StandardF1s', 'StandardF2', 'StandardF2s', 'StandardF4', 'StandardF4s', 'StandardF8', 'StandardF8s', 'StandardG1', 'StandardG2', 'StandardG3', 'StandardG4', 'StandardG5', 'StandardGS1', 'StandardGS2', 'StandardGS3', 'StandardGS4', 'StandardGS5', 'StandardH16', 'StandardH16m', 'StandardH16mr', 'StandardH16r', 'StandardH8', 'StandardH8m', 'StandardL16s', 'StandardL32s', 'StandardL4s', 'StandardL8s', 'StandardM128s', 'StandardM64ms', 'StandardNC12', 'StandardNC24', 'StandardNC24r', 'StandardNC6', 'StandardNV12', 'StandardNV24', 'StandardNV6' + // VMSize - Size of agent VMs. Possible values include: 'StandardA0', 'StandardA1', 'StandardA10', 'StandardA11', 'StandardA1V2', 'StandardA2', 'StandardA2V2', 'StandardA2mV2', 'StandardA3', 'StandardA4', 'StandardA4V2', 'StandardA4mV2', 'StandardA5', 'StandardA6', 'StandardA7', 'StandardA8', 'StandardA8V2', 'StandardA8mV2', 'StandardA9', 'StandardB1ms', 'StandardB1s', 'StandardB2ms', 'StandardB2s', 'StandardB4ms', 'StandardB8ms', 'StandardD1', 'StandardD11', 'StandardD11V2', 'StandardD11V2Promo', 'StandardD12', 'StandardD12V2', 'StandardD12V2Promo', 'StandardD13', 'StandardD13V2', 'StandardD13V2Promo', 'StandardD14', 'StandardD14V2', 'StandardD14V2Promo', 'StandardD15V2', 'StandardD16V3', 'StandardD16sV3', 'StandardD1V2', 'StandardD2', 'StandardD2V2', 'StandardD2V2Promo', 'StandardD2V3', 'StandardD2sV3', 'StandardD3', 'StandardD32V3', 'StandardD32sV3', 'StandardD3V2', 'StandardD3V2Promo', 'StandardD4', 'StandardD4V2', 'StandardD4V2Promo', 'StandardD4V3', 'StandardD4sV3', 'StandardD5V2', 'StandardD5V2Promo', 'StandardD64V3', 'StandardD64sV3', 'StandardD8V3', 'StandardD8sV3', 'StandardDS1', 'StandardDS11', 'StandardDS11V2', 'StandardDS11V2Promo', 'StandardDS12', 'StandardDS12V2', 'StandardDS12V2Promo', 'StandardDS13', 'StandardDS132V2', 'StandardDS134V2', 'StandardDS13V2', 'StandardDS13V2Promo', 'StandardDS14', 'StandardDS144V2', 'StandardDS148V2', 'StandardDS14V2', 'StandardDS14V2Promo', 'StandardDS15V2', 'StandardDS1V2', 'StandardDS2', 'StandardDS2V2', 'StandardDS2V2Promo', 'StandardDS3', 'StandardDS3V2', 'StandardDS3V2Promo', 'StandardDS4', 'StandardDS4V2', 'StandardDS4V2Promo', 'StandardDS5V2', 'StandardDS5V2Promo', 'StandardE16V3', 'StandardE16sV3', 'StandardE2V3', 'StandardE2sV3', 'StandardE3216sV3', 'StandardE328sV3', 'StandardE32V3', 'StandardE32sV3', 'StandardE4V3', 'StandardE4sV3', 'StandardE6416sV3', 'StandardE6432sV3', 'StandardE64V3', 'StandardE64sV3', 'StandardE8V3', 'StandardE8sV3', 'StandardF1', 'StandardF16', 'StandardF16s', 'StandardF16sV2', 'StandardF1s', 'StandardF2', 'StandardF2s', 'StandardF2sV2', 'StandardF32sV2', 'StandardF4', 'StandardF4s', 'StandardF4sV2', 'StandardF64sV2', 'StandardF72sV2', 'StandardF8', 'StandardF8s', 'StandardF8sV2', 'StandardG1', 'StandardG2', 'StandardG3', 'StandardG4', 'StandardG5', 'StandardGS1', 'StandardGS2', 'StandardGS3', 'StandardGS4', 'StandardGS44', 'StandardGS48', 'StandardGS5', 'StandardGS516', 'StandardGS58', 'StandardH16', 'StandardH16m', 'StandardH16mr', 'StandardH16r', 'StandardH8', 'StandardH8m', 'StandardL16s', 'StandardL32s', 'StandardL4s', 'StandardL8s', 'StandardM12832ms', 'StandardM12864ms', 'StandardM128ms', 'StandardM128s', 'StandardM6416ms', 'StandardM6432ms', 'StandardM64ms', 'StandardM64s', 'StandardNC12', 'StandardNC12sV2', 'StandardNC12sV3', 'StandardNC24', 'StandardNC24r', 'StandardNC24rsV2', 'StandardNC24rsV3', 'StandardNC24sV2', 'StandardNC24sV3', 'StandardNC6', 'StandardNC6sV2', 'StandardNC6sV3', 'StandardND12s', 'StandardND24rs', 'StandardND24s', 'StandardND6s', 'StandardNV12', 'StandardNV24', 'StandardNV6' VMSize VMSizeTypes `json:"vmSize,omitempty"` // OsDiskSizeGB - OS Disk Size in GB to be used to specify the disk size for every machine in this master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. OsDiskSizeGB *int32 `json:"osDiskSizeGB,omitempty"` @@ -1148,6 +1412,24 @@ type OrchestratorVersionProfileListResult struct { *OrchestratorVersionProfileProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for OrchestratorVersionProfileListResult. +func (ovplr OrchestratorVersionProfileListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ovplr.ID != nil { + objectMap["id"] = ovplr.ID + } + if ovplr.Name != nil { + objectMap["name"] = ovplr.Name + } + if ovplr.Type != nil { + objectMap["type"] = ovplr.Type + } + if ovplr.OrchestratorVersionProfileProperties != nil { + objectMap["properties"] = ovplr.OrchestratorVersionProfileProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for OrchestratorVersionProfileListResult struct. func (ovplr *OrchestratorVersionProfileListResult) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -1155,46 +1437,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 - } - ovplr.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 "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.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 +1483,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 +1520,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..42548e8cd67b 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) @@ -171,7 +171,7 @@ func (client DatabaseAccountsClient) CreateOrUpdatePreparer(ctx context.Context, } 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.DocumentDB/databaseAccounts/{accountName}", pathParameters), @@ -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) @@ -333,7 +335,7 @@ func (client DatabaseAccountsClient) FailoverPriorityChangePreparer(ctx context. } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange", pathParameters), @@ -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) @@ -1092,7 +1099,7 @@ func (client DatabaseAccountsClient) PatchPreparer(ctx context.Context, resource } 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.DocumentDB/databaseAccounts/{accountName}", pathParameters), @@ -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) @@ -1174,7 +1181,7 @@ func (client DatabaseAccountsClient) RegenerateKeyPreparer(ctx context.Context, } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey", pathParameters), 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..b5cde0669a2e 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 @@ -38,6 +38,11 @@ const ( Parse DatabaseAccountKind = "Parse" ) +// PossibleDatabaseAccountKindValues returns an array of possible values for the DatabaseAccountKind const type. +func PossibleDatabaseAccountKindValues() []DatabaseAccountKind { + return []DatabaseAccountKind{GlobalDocumentDB, MongoDB, Parse} +} + // DatabaseAccountOfferType enumerates the values for database account offer type. type DatabaseAccountOfferType string @@ -46,6 +51,11 @@ const ( Standard DatabaseAccountOfferType = "Standard" ) +// PossibleDatabaseAccountOfferTypeValues returns an array of possible values for the DatabaseAccountOfferType const type. +func PossibleDatabaseAccountOfferTypeValues() []DatabaseAccountOfferType { + return []DatabaseAccountOfferType{Standard} +} + // DefaultConsistencyLevel enumerates the values for default consistency level. type DefaultConsistencyLevel string @@ -62,6 +72,11 @@ const ( Strong DefaultConsistencyLevel = "Strong" ) +// PossibleDefaultConsistencyLevelValues returns an array of possible values for the DefaultConsistencyLevel const type. +func PossibleDefaultConsistencyLevelValues() []DefaultConsistencyLevel { + return []DefaultConsistencyLevel{BoundedStaleness, ConsistentPrefix, Eventual, Session, Strong} +} + // KeyKind enumerates the values for key kind. type KeyKind string @@ -76,6 +91,11 @@ const ( SecondaryReadonly KeyKind = "secondaryReadonly" ) +// PossibleKeyKindValues returns an array of possible values for the KeyKind const type. +func PossibleKeyKindValues() []KeyKind { + return []KeyKind{Primary, PrimaryReadonly, Secondary, SecondaryReadonly} +} + // PrimaryAggregationType enumerates the values for primary aggregation type. type PrimaryAggregationType string @@ -94,6 +114,11 @@ const ( Total PrimaryAggregationType = "Total" ) +// PossiblePrimaryAggregationTypeValues returns an array of possible values for the PrimaryAggregationType const type. +func PossiblePrimaryAggregationTypeValues() []PrimaryAggregationType { + return []PrimaryAggregationType{Average, Last, Maximum, Minimimum, None, Total} +} + // UnitType enumerates the values for unit type. type UnitType string @@ -114,6 +139,17 @@ const ( Seconds UnitType = "Seconds" ) +// PossibleUnitTypeValues returns an array of possible values for the UnitType const type. +func PossibleUnitTypeValues() []UnitType { + return []UnitType{Bytes, BytesPerSecond, Count, CountPerSecond, Milliseconds, Percent, Seconds} +} + +// Capability cosmos DB capability object +type Capability struct { + // Name - Name of the Cosmos DB capability. For example, "name": "EnableCassandra". Current values also include "EnableTable" and "EnableGremlin". + 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 +163,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 +173,110 @@ 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{}) + if da.Kind != "" { + objectMap["kind"] = da.Kind } - 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.DatabaseAccountProperties != nil { + objectMap["properties"] = da.DatabaseAccountProperties } - - 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.ID != nil { + objectMap["id"] = da.ID } - - 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.Name != nil { + objectMap["name"] = da.Name } - - 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.Type != nil { + objectMap["type"] = da.Type } - - 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.Location != nil { + objectMap["location"] = da.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - da.Location = &location + if da.Tags != nil { + objectMap["tags"] = da.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 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 + } + 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 +292,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 +302,110 @@ 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{}) + if dacup.Kind != "" { + objectMap["kind"] = dacup.Kind } - 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.DatabaseAccountCreateUpdateProperties != nil { + objectMap["properties"] = dacup.DatabaseAccountCreateUpdateProperties } - - 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.ID != nil { + objectMap["id"] = dacup.ID } - - 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.Name != nil { + objectMap["name"] = dacup.Name } - - 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.Type != nil { + objectMap["type"] = dacup.Type } - - 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.Location != nil { + objectMap["location"] = dacup.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - dacup.Location = &location + if dacup.Tags != nil { + objectMap["tags"] = dacup.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 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 + } + 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 +422,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. @@ -359,6 +443,21 @@ type DatabaseAccountListKeysResult struct { *DatabaseAccountListReadOnlyKeysResult `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for DatabaseAccountListKeysResult. +func (dalkr DatabaseAccountListKeysResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dalkr.PrimaryMasterKey != nil { + objectMap["primaryMasterKey"] = dalkr.PrimaryMasterKey + } + if dalkr.SecondaryMasterKey != nil { + objectMap["secondaryMasterKey"] = dalkr.SecondaryMasterKey + } + if dalkr.DatabaseAccountListReadOnlyKeysResult != nil { + objectMap["properties"] = dalkr.DatabaseAccountListReadOnlyKeysResult + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for DatabaseAccountListKeysResult struct. func (dalkr *DatabaseAccountListKeysResult) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -366,36 +465,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 - } - 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 + 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.DatabaseAccountListReadOnlyKeysResult = &properties } return nil @@ -412,7 +511,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 +579,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 +608,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 +657,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 +706,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 +763,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 +812,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 +973,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 +1076,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 +1190,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/dns/mgmt/2016-04-01/dns/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns/models.go index 7406d8b0e878..d346ca44b9d8 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/dns/mgmt/2016-04-01/dns/models.go @@ -125,6 +125,11 @@ const ( UseProxy HTTPStatusCode = "UseProxy" ) +// PossibleHTTPStatusCodeValues returns an array of possible values for the HTTPStatusCode const type. +func PossibleHTTPStatusCodeValues() []HTTPStatusCode { + return []HTTPStatusCode{Accepted, Ambiguous, BadGateway, BadRequest, Conflict, Continue, Created, ExpectationFailed, Forbidden, Found, GatewayTimeout, Gone, HTTPVersionNotSupported, InternalServerError, LengthRequired, MethodNotAllowed, Moved, MovedPermanently, MultipleChoices, NoContent, NonAuthoritativeInformation, NotAcceptable, NotFound, NotImplemented, NotModified, OK, PartialContent, PaymentRequired, PreconditionFailed, ProxyAuthenticationRequired, Redirect, RedirectKeepVerb, RedirectMethod, RequestedRangeNotSatisfiable, RequestEntityTooLarge, RequestTimeout, RequestURITooLong, ResetContent, SeeOther, ServiceUnavailable, SwitchingProtocols, TemporaryRedirect, Unauthorized, UnsupportedMediaType, Unused, UpgradeRequired, UseProxy} +} + // OperationStatus enumerates the values for operation status. type OperationStatus string @@ -137,6 +142,11 @@ const ( Succeeded OperationStatus = "Succeeded" ) +// PossibleOperationStatusValues returns an array of possible values for the OperationStatus const type. +func PossibleOperationStatusValues() []OperationStatus { + return []OperationStatus{Failed, InProgress, Succeeded} +} + // RecordType enumerates the values for record type. type RecordType string @@ -161,6 +171,11 @@ const ( TXT RecordType = "TXT" ) +// PossibleRecordTypeValues returns an array of possible values for the RecordType const type. +func PossibleRecordTypeValues() []RecordType { + return []RecordType{A, AAAA, CNAME, MX, NS, PTR, SOA, SRV, TXT} +} + // AaaaRecord an AAAA record. type AaaaRecord struct { // Ipv6Address - The IPv6 address of this AAAA record. @@ -227,6 +242,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 +270,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 + 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.Etag = &etag - } - - v = m["properties"] - if v != nil { - var properties RecordSetProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - rs.RecordSetProperties = &properties } return nil @@ -394,7 +428,7 @@ 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"` // ARecords - The list of A records in the record set. @@ -417,6 +451,45 @@ type RecordSetProperties struct { SoaRecord *SoaRecord `json:"SOARecord,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.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 + } + return json.Marshal(objectMap) +} + // RecordSetUpdateParameters parameters supplied to update a record set. type RecordSetUpdateParameters struct { // RecordSet - Specifies information about the record set being updated. @@ -434,7 +507,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. @@ -482,6 +576,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,90 +589,109 @@ 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 @@ -716,21 +833,38 @@ func (future ZonesDeleteFuture) Result(client ZonesClient) (zdr ZoneDeleteResult 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 zdr, azure.NewAsyncOpIncompleteError("dns.ZonesDeleteFuture") } if future.PollingMethod() == azure.PollingLocation { zdr, 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) + if err != nil { + err = autorest.NewErrorWithError(err, "dns.ZonesDeleteFuture", "Result", resp, "Failure responding to request") + } return } 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/dns/mgmt/2016-04-01/dns/recordsets.go index ae3fd5206b6f..36e683114495 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/dns/mgmt/2016-04-01/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 { @@ -86,7 +86,7 @@ func (client RecordSetsClient) CreateOrUpdatePreparer(ctx context.Context, resou } 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 { @@ -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 { @@ -375,10 +375,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) @@ -480,10 +480,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 { @@ -522,7 +522,7 @@ func (client RecordSetsClient) UpdatePreparer(ctx context.Context, resourceGroup } 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/dns/mgmt/2016-04-01/dns/version.go index d5676e7e1581..23497fd198d1 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/dns/mgmt/2016-04-01/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/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/dns/mgmt/2016-04-01/dns/zones.go b/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns/zones.go index 309a29aa2717..c109156f0003 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/dns/mgmt/2016-04-01/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 { @@ -82,7 +82,7 @@ func (client ZonesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGr } 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 { 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..5d91ce184ba3 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 { @@ -81,7 +81,7 @@ func (client EventSubscriptionsClient) CreatePreparer(ctx context.Context, scope } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}", pathParameters), @@ -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}' @@ -973,7 +975,7 @@ func (client EventSubscriptionsClient) UpdatePreparer(ctx context.Context, scope } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}", pathParameters), 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..c0856820e8c4 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 @@ -36,6 +36,11 @@ const ( EndpointTypeWebHook EndpointType = "WebHook" ) +// PossibleEndpointTypeValues returns an array of possible values for the EndpointType const type. +func PossibleEndpointTypeValues() []EndpointType { + return []EndpointType{EndpointTypeEventHub, EndpointTypeEventSubscriptionDestination, EndpointTypeWebHook} +} + // EventSubscriptionProvisioningState enumerates the values for event subscription provisioning state. type EventSubscriptionProvisioningState string @@ -54,6 +59,11 @@ const ( Updating EventSubscriptionProvisioningState = "Updating" ) +// PossibleEventSubscriptionProvisioningStateValues returns an array of possible values for the EventSubscriptionProvisioningState const type. +func PossibleEventSubscriptionProvisioningStateValues() []EventSubscriptionProvisioningState { + return []EventSubscriptionProvisioningState{Canceled, Creating, Deleting, Failed, Succeeded, Updating} +} + // OperationOrigin enumerates the values for operation origin. type OperationOrigin string @@ -66,6 +76,11 @@ const ( UserAndSystem OperationOrigin = "UserAndSystem" ) +// PossibleOperationOriginValues returns an array of possible values for the OperationOrigin const type. +func PossibleOperationOriginValues() []OperationOrigin { + return []OperationOrigin{System, User, UserAndSystem} +} + // ResourceRegionType enumerates the values for resource region type. type ResourceRegionType string @@ -76,6 +91,11 @@ const ( RegionalResource ResourceRegionType = "RegionalResource" ) +// PossibleResourceRegionTypeValues returns an array of possible values for the ResourceRegionType const type. +func PossibleResourceRegionTypeValues() []ResourceRegionType { + return []ResourceRegionType{GlobalResource, RegionalResource} +} + // TopicProvisioningState enumerates the values for topic provisioning state. type TopicProvisioningState string @@ -94,6 +114,11 @@ const ( TopicProvisioningStateUpdating TopicProvisioningState = "Updating" ) +// PossibleTopicProvisioningStateValues returns an array of possible values for the TopicProvisioningState const type. +func PossibleTopicProvisioningStateValues() []TopicProvisioningState { + return []TopicProvisioningState{TopicProvisioningStateCanceled, TopicProvisioningStateCreating, TopicProvisioningStateDeleting, TopicProvisioningStateFailed, TopicProvisioningStateSucceeded, TopicProvisioningStateUpdating} +} + // TopicTypeProvisioningState enumerates the values for topic type provisioning state. type TopicTypeProvisioningState string @@ -112,23 +137,30 @@ const ( TopicTypeProvisioningStateUpdating TopicTypeProvisioningState = "Updating" ) +// PossibleTopicTypeProvisioningStateValues returns an array of possible values for the TopicTypeProvisioningState const type. +func PossibleTopicTypeProvisioningStateValues() []TopicTypeProvisioningState { + return []TopicTypeProvisioningState{TopicTypeProvisioningStateCanceled, TopicTypeProvisioningStateCreating, TopicTypeProvisioningStateDeleting, TopicTypeProvisioningStateFailed, TopicTypeProvisioningStateSucceeded, TopicTypeProvisioningStateUpdating} +} + // 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 + } + if ehesd.EndpointType != "" { + objectMap["endpointType"] = ehesd.EndpointType + } + return json.Marshal(objectMap) } // AsWebHookEventSubscriptionDestination is the BasicEventSubscriptionDestination implementation for EventHubEventSubscriptionDestination. @@ -158,26 +190,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 +225,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for EventSubscription. +func (es EventSubscription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if es.EventSubscriptionProperties != nil { + objectMap["properties"] = es.EventSubscriptionProperties + } + if es.ID != nil { + objectMap["id"] = es.ID + } + if es.Name != nil { + objectMap["name"] = es.Name + } + if es.Type != nil { + objectMap["type"] = es.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for EventSubscription struct. @@ -209,46 +260,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 +361,11 @@ 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{}) + if esd.EndpointType != "" { + objectMap["endpointType"] = esd.EndpointType + } + return json.Marshal(objectMap) } // AsWebHookEventSubscriptionDestination is the BasicEventSubscriptionDestination implementation for EventSubscriptionDestination. @@ -384,61 +433,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 - } - 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 + 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.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 +498,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 +547,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 +590,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 +603,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 +656,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 + 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.Filter = &filter - } - - v = m["labels"] - if v != nil { - var labels []string - err = json.Unmarshal(*m["labels"], &labels) - if err != nil { - return err - } - esup.Labels = &labels } return nil @@ -591,14 +692,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for EventType. +func (et EventType) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if et.EventTypeProperties != nil { + objectMap["properties"] = et.EventTypeProperties + } + if et.ID != nil { + objectMap["id"] = et.ID + } + if et.Name != nil { + objectMap["name"] = et.Name + } + if et.Type != nil { + objectMap["type"] = et.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for EventType struct. @@ -608,46 +727,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 - } - et.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 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.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 +797,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 +832,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 +965,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 +1013,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 +1077,71 @@ 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"` +} + +// MarshalJSON is the custom marshaler for TopicTypeInfo. +func (tti TopicTypeInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tti.TopicTypeProperties != nil { + objectMap["properties"] = tti.TopicTypeProperties + } + if tti.ID != nil { + objectMap["id"] = tti.ID + } + if tti.Name != nil { + objectMap["name"] = tti.Name + } + if tti.Type != nil { + objectMap["type"] = tti.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for TopicTypeInfo struct. @@ -943,46 +1151,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 - } - 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 + 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.Type = &typeVar } return nil @@ -1014,40 +1221,72 @@ 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 + } + if whesd.EndpointType != "" { + objectMap["endpointType"] = whesd.EndpointType + } + return json.Marshal(objectMap) } // AsWebHookEventSubscriptionDestination is the BasicEventSubscriptionDestination implementation for WebHookEventSubscriptionDestination. @@ -1077,26 +1316,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..0481d5553ca6 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 { @@ -74,7 +74,7 @@ func (client TopicsClient) CreateOrUpdatePreparer(ctx context.Context, resourceG } 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.EventGrid/topics/{topicName}", pathParameters), @@ -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) @@ -552,7 +556,7 @@ func (client TopicsClient) RegenerateKeyPreparer(ctx context.Context, resourceGr } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/regenerateKey", pathParameters), @@ -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 { @@ -615,7 +619,7 @@ func (client TopicsClient) UpdatePreparer(ctx context.Context, resourceGroupName } 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.EventGrid/topics/{topicName}", pathParameters), 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..274da2f4ed52 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) @@ -98,7 +98,7 @@ func (client ConsumerGroupsClient) CreateOrUpdatePreparer(ctx context.Context, r } 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.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}", pathParameters), @@ -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..a2d63e559336 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) @@ -173,7 +173,7 @@ func (client DisasterRecoveryConfigsClient) CheckNameAvailabilityPreparer(ctx co } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/CheckNameAvailability", pathParameters), @@ -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) @@ -257,7 +257,7 @@ func (client DisasterRecoveryConfigsClient) CreateOrUpdatePreparer(ctx context.C } 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.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}", pathParameters), @@ -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..c863b80cfbe5 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) @@ -110,7 +110,7 @@ func (client EventHubsClient) CreateOrUpdatePreparer(ctx context.Context, resour } 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.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}", pathParameters), @@ -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) @@ -199,7 +199,7 @@ func (client EventHubsClient) CreateOrUpdateAuthorizationRulePreparer(ctx contex } 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.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}", pathParameters), @@ -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) @@ -904,7 +905,7 @@ func (client EventHubsClient) RegenerateKeysPreparer(ctx context.Context, resour } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}/regenerateKeys", pathParameters), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/messagingplan.go b/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/messagingplan.go new file mode 100644 index 000000000000..59eababf32d7 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/messagingplan.go @@ -0,0 +1,118 @@ +package eventhub + +// 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" +) + +// MessagingPlanClient is the azure Event Hubs client +type MessagingPlanClient struct { + BaseClient +} + +// NewMessagingPlanClient creates an instance of the MessagingPlanClient client. +func NewMessagingPlanClient(subscriptionID string) MessagingPlanClient { + return NewMessagingPlanClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewMessagingPlanClientWithBaseURI creates an instance of the MessagingPlanClient client. +func NewMessagingPlanClientWithBaseURI(baseURI string, subscriptionID string) MessagingPlanClient { + return MessagingPlanClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets a description for the specified namespace. +// +// resourceGroupName is name of the resource group within the azure subscription. namespaceName is the Namespace +// name +func (client MessagingPlanClient) Get(ctx context.Context, resourceGroupName string, namespaceName string) (result MessagingPlan, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {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.NewError("eventhub.MessagingPlanClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, namespaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.MessagingPlanClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventhub.MessagingPlanClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.MessagingPlanClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client MessagingPlanClient) GetPreparer(ctx context.Context, resourceGroupName string, namespaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "namespaceName": autorest.Encode("path", namespaceName), + "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.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/messagingplan", 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 MessagingPlanClient) 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 MessagingPlanClient) GetResponder(resp *http.Response) (result MessagingPlan, 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/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..23b11d79fcc7 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 @@ -38,6 +38,11 @@ const ( Send AccessRights = "Send" ) +// PossibleAccessRightsValues returns an array of possible values for the AccessRights const type. +func PossibleAccessRightsValues() []AccessRights { + return []AccessRights{Listen, Manage, Send} +} + // EncodingCaptureDescription enumerates the values for encoding capture description. type EncodingCaptureDescription string @@ -48,6 +53,11 @@ const ( AvroDeflate EncodingCaptureDescription = "AvroDeflate" ) +// PossibleEncodingCaptureDescriptionValues returns an array of possible values for the EncodingCaptureDescription const type. +func PossibleEncodingCaptureDescriptionValues() []EncodingCaptureDescription { + return []EncodingCaptureDescription{Avro, AvroDeflate} +} + // EntityStatus enumerates the values for entity status. type EntityStatus string @@ -72,6 +82,11 @@ const ( Unknown EntityStatus = "Unknown" ) +// PossibleEntityStatusValues returns an array of possible values for the EntityStatus const type. +func PossibleEntityStatusValues() []EntityStatus { + return []EntityStatus{Active, Creating, Deleting, Disabled, ReceiveDisabled, Renaming, Restoring, SendDisabled, Unknown} +} + // KeyType enumerates the values for key type. type KeyType string @@ -82,6 +97,11 @@ const ( SecondaryKey KeyType = "SecondaryKey" ) +// PossibleKeyTypeValues returns an array of possible values for the KeyType const type. +func PossibleKeyTypeValues() []KeyType { + return []KeyType{PrimaryKey, SecondaryKey} +} + // ProvisioningStateDR enumerates the values for provisioning state dr. type ProvisioningStateDR string @@ -94,6 +114,11 @@ const ( Succeeded ProvisioningStateDR = "Succeeded" ) +// PossibleProvisioningStateDRValues returns an array of possible values for the ProvisioningStateDR const type. +func PossibleProvisioningStateDRValues() []ProvisioningStateDR { + return []ProvisioningStateDR{Accepted, Failed, Succeeded} +} + // RoleDisasterRecovery enumerates the values for role disaster recovery. type RoleDisasterRecovery string @@ -106,6 +131,11 @@ const ( Secondary RoleDisasterRecovery = "Secondary" ) +// PossibleRoleDisasterRecoveryValues returns an array of possible values for the RoleDisasterRecovery const type. +func PossibleRoleDisasterRecoveryValues() []RoleDisasterRecovery { + return []RoleDisasterRecovery{Primary, PrimaryNotReplicating, Secondary} +} + // SkuName enumerates the values for sku name. type SkuName string @@ -116,6 +146,11 @@ const ( Standard SkuName = "Standard" ) +// PossibleSkuNameValues returns an array of possible values for the SkuName const type. +func PossibleSkuNameValues() []SkuName { + return []SkuName{Basic, Standard} +} + // SkuTier enumerates the values for sku tier. type SkuTier string @@ -126,6 +161,11 @@ const ( SkuTierStandard SkuTier = "Standard" ) +// PossibleSkuTierValues returns an array of possible values for the SkuTier const type. +func PossibleSkuTierValues() []SkuTier { + return []SkuTier{SkuTierBasic, SkuTierStandard} +} + // UnavailableReason enumerates the values for unavailable reason. type UnavailableReason string @@ -144,6 +184,11 @@ const ( TooManyNamespaceInCurrentSubscription UnavailableReason = "TooManyNamespaceInCurrentSubscription" ) +// PossibleUnavailableReasonValues returns an array of possible values for the UnavailableReason const type. +func PossibleUnavailableReasonValues() []UnavailableReason { + return []UnavailableReason{InvalidName, NameInLockdown, NameInUse, None, SubscriptionIsDisabled, TooManyNamespaceInCurrentSubscription} +} + // AccessKeys namespace/EventHub Connection String type AccessKeys struct { autorest.Response `json:"-"` @@ -166,14 +211,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for ArmDisasterRecovery. +func (adr ArmDisasterRecovery) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if adr.ArmDisasterRecoveryProperties != nil { + objectMap["properties"] = adr.ArmDisasterRecoveryProperties + } + if adr.ID != nil { + objectMap["id"] = adr.ID + } + if adr.Name != nil { + objectMap["name"] = adr.Name + } + if adr.Type != nil { + objectMap["type"] = adr.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ArmDisasterRecovery struct. @@ -183,46 +246,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 @@ -330,7 +392,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 +408,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for AuthorizationRule. +func (ar AuthorizationRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ar.AuthorizationRuleProperties != nil { + objectMap["properties"] = ar.AuthorizationRuleProperties + } + if ar.ID != nil { + objectMap["id"] = ar.ID + } + if ar.Name != nil { + objectMap["name"] = ar.Name + } + if ar.Type != nil { + objectMap["type"] = ar.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for AuthorizationRule struct. @@ -362,46 +443,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 - } - 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 + 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.Type = &typeVar } return nil @@ -519,7 +599,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 +629,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for ConsumerGroup. +func (cg ConsumerGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cg.ConsumerGroupProperties != nil { + objectMap["properties"] = cg.ConsumerGroupProperties + } + if cg.ID != nil { + objectMap["id"] = cg.ID + } + if cg.Name != nil { + objectMap["name"] = cg.Name + } + if cg.Type != nil { + objectMap["type"] = cg.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ConsumerGroup struct. @@ -566,46 +664,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 + 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.ConsumerGroupProperties = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - 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 @@ -731,6 +828,18 @@ type Destination struct { *DestinationProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for Destination. +func (d Destination) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if d.Name != nil { + objectMap["name"] = d.Name + } + if d.DestinationProperties != nil { + objectMap["properties"] = d.DestinationProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for Destination struct. func (d *Destination) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -738,33 +847,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 +887,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 +1128,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"` @@ -1106,72 +1239,360 @@ func (page ListResultPage) Values() []Model { return *page.lr.Value } -// Model single item in List or Get Event Hub operation -type Model struct { - autorest.Response `json:"-"` +// MessagingPlan messaging +type MessagingPlan struct { + autorest.Response `json:"-"` + *MessagingPlanproperties `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"` - // Properties - Properties supplied to the Create Or Update Event Hub operation. - *Properties `json:"properties,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for Model struct. -func (mVar *Model) UnmarshalJSON(body []byte) error { +// MarshalJSON is the custom marshaler for MessagingPlan. +func (mp MessagingPlan) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mp.MessagingPlanproperties != nil { + objectMap["properties"] = mp.MessagingPlanproperties + } + if mp.Location != nil { + objectMap["location"] = mp.Location + } + if mp.Tags != nil { + objectMap["tags"] = mp.Tags + } + if mp.ID != nil { + objectMap["id"] = mp.ID + } + if mp.Name != nil { + objectMap["name"] = mp.Name + } + if mp.Type != nil { + objectMap["type"] = mp.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MessagingPlan struct. +func (mp *MessagingPlan) 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 Properties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err + for k, v := range m { + switch k { + case "properties": + if v != nil { + var messagingPlanproperties MessagingPlanproperties + err = json.Unmarshal(*v, &messagingPlanproperties) + if err != nil { + return err + } + mp.MessagingPlanproperties = &messagingPlanproperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mp.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mp.Tags = tags + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mp.Type = &typeVar + } } - 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 + return nil +} + +// MessagingPlanproperties messaging Region +type MessagingPlanproperties struct { + // Sku - Sku type + Sku *int32 `json:"sku,omitempty"` + // SelectedEventHubUnit - Selected event hub unit + SelectedEventHubUnit *int32 `json:"selectedEventHubUnit,omitempty"` + // UpdatedAt - The exact time the messaging plan was updated. + UpdatedAt *date.Time `json:"updatedAt,omitempty"` + // Revision - revision number + Revision *int64 `json:"revision,omitempty"` +} + +// MessagingRegions messaging Region +type MessagingRegions struct { + Properties *MessagingRegionsProperties `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"` +} + +// MarshalJSON is the custom marshaler for MessagingRegions. +func (mr MessagingRegions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mr.Properties != nil { + objectMap["properties"] = mr.Properties + } + if mr.Location != nil { + objectMap["location"] = mr.Location + } + if mr.Tags != nil { + objectMap["tags"] = mr.Tags + } + if mr.ID != nil { + objectMap["id"] = mr.ID } + if mr.Name != nil { + objectMap["name"] = mr.Name + } + if mr.Type != nil { + objectMap["type"] = mr.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 - } - mVar.Name = &name +// MessagingRegionsListResult the response of the List MessagingRegions operation. +type MessagingRegionsListResult struct { + autorest.Response `json:"-"` + // Value - Result of the List MessagingRegions type. + Value *[]MessagingRegions `json:"value,omitempty"` + // NextLink - Link to the next set of results. Not empty if Value contains incomplete list of MessagingRegions. + NextLink *string `json:"nextLink,omitempty"` +} + +// MessagingRegionsListResultIterator provides access to a complete listing of MessagingRegions values. +type MessagingRegionsListResultIterator struct { + i int + page MessagingRegionsListResultPage +} + +// 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 *MessagingRegionsListResultIterator) 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 +} - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter MessagingRegionsListResultIterator) 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 MessagingRegionsListResultIterator) Response() MessagingRegionsListResult { + 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 MessagingRegionsListResultIterator) Value() MessagingRegions { + if !iter.page.NotDone() { + return MessagingRegions{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (mrlr MessagingRegionsListResult) IsEmpty() bool { + return mrlr.Value == nil || len(*mrlr.Value) == 0 +} + +// messagingRegionsListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mrlr MessagingRegionsListResult) messagingRegionsListResultPreparer() (*http.Request, error) { + if mrlr.NextLink == nil || len(to.String(mrlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mrlr.NextLink))) +} + +// MessagingRegionsListResultPage contains a page of MessagingRegions values. +type MessagingRegionsListResultPage struct { + fn func(MessagingRegionsListResult) (MessagingRegionsListResult, error) + mrlr MessagingRegionsListResult +} + +// 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 *MessagingRegionsListResultPage) Next() error { + next, err := page.fn(page.mrlr) + if err != nil { + return err + } + page.mrlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page MessagingRegionsListResultPage) NotDone() bool { + return !page.mrlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page MessagingRegionsListResultPage) Response() MessagingRegionsListResult { + return page.mrlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page MessagingRegionsListResultPage) Values() []MessagingRegions { + if page.mrlr.IsEmpty() { + return nil + } + return *page.mrlr.Value +} + +// MessagingRegionsProperties ... +type MessagingRegionsProperties struct { + // Code - Region code + Code *string `json:"code,omitempty"` + // FullName - Full name of the region + FullName *string `json:"fullName,omitempty"` +} + +// 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"` +} + +// MarshalJSON is the custom marshaler for Model. +func (mVar Model) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mVar.Properties != nil { + objectMap["properties"] = mVar.Properties + } + if mVar.ID != nil { + objectMap["id"] = mVar.ID + } + if mVar.Name != nil { + objectMap["name"] = mVar.Name + } + if mVar.Type != nil { + objectMap["type"] = mVar.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Model struct. +func (mVar *Model) 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 + } + 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.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 +1604,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 +1652,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 +1706,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 +1827,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 +1858,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..a938c085d221 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) @@ -83,7 +83,7 @@ func (client NamespacesClient) CheckNameAvailabilityPreparer(ctx context.Context } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/CheckNameAvailability", pathParameters), @@ -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) @@ -170,7 +170,7 @@ func (client NamespacesClient) CreateOrUpdatePreparer(ctx context.Context, resou } 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.EventHub/namespaces/{namespaceName}", pathParameters), @@ -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) @@ -263,7 +263,7 @@ func (client NamespacesClient) CreateOrUpdateAuthorizationRulePreparer(ctx conte } 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.EventHub/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}", pathParameters), @@ -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) @@ -1032,7 +1035,7 @@ func (client NamespacesClient) RegenerateKeysPreparer(ctx context.Context, resou } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys", pathParameters), @@ -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) @@ -1112,7 +1115,7 @@ func (client NamespacesClient) UpdatePreparer(ctx context.Context, resourceGroup } 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.EventHub/namespaces/{namespaceName}", pathParameters), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/regions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/regions.go new file mode 100644 index 000000000000..118dfd461a49 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub/regions.go @@ -0,0 +1,141 @@ +package eventhub + +// 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" +) + +// RegionsClient is the azure Event Hubs client +type RegionsClient struct { + BaseClient +} + +// NewRegionsClient creates an instance of the RegionsClient client. +func NewRegionsClient(subscriptionID string) RegionsClient { + return NewRegionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRegionsClientWithBaseURI creates an instance of the RegionsClient client. +func NewRegionsClientWithBaseURI(baseURI string, subscriptionID string) RegionsClient { + return RegionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListBySku gets the available Regions for a given sku +// +// sku is the sku type. +func (client RegionsClient) ListBySku(ctx context.Context, sku string) (result MessagingRegionsListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {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.NewError("eventhub.RegionsClient", "ListBySku", err.Error()) + } + + result.fn = client.listBySkuNextResults + req, err := client.ListBySkuPreparer(ctx, sku) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.RegionsClient", "ListBySku", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySkuSender(req) + if err != nil { + result.mrlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "eventhub.RegionsClient", "ListBySku", resp, "Failure sending request") + return + } + + result.mrlr, err = client.ListBySkuResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.RegionsClient", "ListBySku", resp, "Failure responding to request") + } + + return +} + +// ListBySkuPreparer prepares the ListBySku request. +func (client RegionsClient) ListBySkuPreparer(ctx context.Context, sku string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "sku": autorest.Encode("path", sku), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/sku/{sku}/regions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySkuSender sends the ListBySku request. The method will close the +// http.Response Body if it receives an error. +func (client RegionsClient) ListBySkuSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySkuResponder handles the response to the ListBySku request. The method always +// closes the http.Response Body. +func (client RegionsClient) ListBySkuResponder(resp *http.Response) (result MessagingRegionsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySkuNextResults retrieves the next set of results, if any. +func (client RegionsClient) listBySkuNextResults(lastResults MessagingRegionsListResult) (result MessagingRegionsListResult, err error) { + req, err := lastResults.messagingRegionsListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "eventhub.RegionsClient", "listBySkuNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySkuSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "eventhub.RegionsClient", "listBySkuNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySkuResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "eventhub.RegionsClient", "listBySkuNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySkuComplete enumerates all values, automatically crossing page boundaries as required. +func (client RegionsClient) ListBySkuComplete(ctx context.Context, sku string) (result MessagingRegionsListResultIterator, err error) { + result.page, err = client.ListBySku(ctx, sku) + return +} 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..c70036f6dde8 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) @@ -87,7 +87,7 @@ func (client ApplicationsClient) AddOwnerPreparer(ctx context.Context, applicati } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/{tenantID}/applications/{applicationObjectId}/$links/owners", pathParameters), @@ -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) @@ -160,7 +160,7 @@ func (client ApplicationsClient) CreatePreparer(ctx context.Context, parameters } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/{tenantID}/applications", pathParameters), @@ -695,7 +695,7 @@ func (client ApplicationsClient) PatchPreparer(ctx context.Context, applicationO } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/{tenantID}/applications/{applicationObjectId}", pathParameters), @@ -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 { @@ -762,7 +762,7 @@ func (client ApplicationsClient) UpdateKeyCredentialsPreparer(ctx context.Contex } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/{tenantID}/applications/{applicationObjectId}/keyCredentials", pathParameters), @@ -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 { @@ -829,7 +829,7 @@ func (client ApplicationsClient) UpdatePasswordCredentialsPreparer(ctx context.C } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/{tenantID}/applications/{applicationObjectId}/passwordCredentials", pathParameters), 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..7d869adad070 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) @@ -87,7 +87,7 @@ func (client GroupsClient) AddMemberPreparer(ctx context.Context, groupObjectID } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/{tenantID}/groups/{groupObjectId}/$links/members", pathParameters), @@ -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) @@ -161,7 +161,7 @@ func (client GroupsClient) CreatePreparer(ctx context.Context, parameters GroupC } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/{tenantID}/groups", pathParameters), @@ -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) @@ -505,7 +506,7 @@ func (client GroupsClient) GetMemberGroupsPreparer(ctx context.Context, objectID } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/{tenantID}/groups/{objectId}/getMemberGroups", pathParameters), @@ -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) @@ -579,7 +580,7 @@ func (client GroupsClient) IsMemberOfPreparer(ctx context.Context, parameters Ch } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/{tenantID}/isMemberOf", pathParameters), 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..1db6301a64e6 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" ) @@ -40,6 +39,11 @@ const ( ObjectTypeUser ObjectType = "User" ) +// PossibleObjectTypeValues returns an array of possible values for the ObjectType const type. +func PossibleObjectTypeValues() []ObjectType { + return []ObjectType{ObjectTypeApplication, ObjectTypeDirectoryObject, ObjectTypeGroup, ObjectTypeServicePrincipal, ObjectTypeUser} +} + // UserType enumerates the values for user type. type UserType string @@ -50,11 +54,16 @@ const ( Member UserType = "Member" ) +// PossibleUserTypeValues returns an array of possible values for the UserType const type. +func PossibleUserTypeValues() []UserType { + return []UserType{Guest, Member} +} + // AADObject the properties of an Active Directory object. 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 +102,114 @@ 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 + } + if ag.ObjectType != "" { + 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 +245,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 +261,57 @@ 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 + } + if a.ObjectType != "" { + 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 +347,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 +388,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 +517,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 +538,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 +631,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 +693,20 @@ 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 + } + if do.ObjectType != "" { + 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 +753,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 +773,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 +784,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 +821,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 +830,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:"-"` @@ -661,6 +944,15 @@ type GraphError struct { *OdataError `json:"odata.error,omitempty"` } +// MarshalJSON is the custom marshaler for GraphError. +func (ge GraphError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ge.OdataError != nil { + objectMap["odata.error"] = ge.OdataError + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for GraphError struct. func (ge *GraphError) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -668,16 +960,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 +980,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 +1011,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 +1152,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. @@ -826,6 +1165,38 @@ type KeyCredential struct { Usage *string `json:"usage,omitempty"` // Type - Type. Acceptable values are 'AsymmetricX509Cert' and 'Symmetric'. Type *string `json:"type,omitempty"` + // CustomKeyIdentifier - Custom Key Identifier + CustomKeyIdentifier *[]byte `json:"customKeyIdentifier,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 + } + if kc.CustomKeyIdentifier != nil { + objectMap["customKeyIdentifier"] = kc.CustomKeyIdentifier + } + for k, v := range kc.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) } // KeyCredentialListResult keyCredential list operation result. @@ -849,6 +1220,18 @@ type OdataError struct { *ErrorMessage `json:"message,omitempty"` } +// MarshalJSON is the custom marshaler for OdataError. +func (oe OdataError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if oe.Code != nil { + objectMap["code"] = oe.Code + } + if oe.ErrorMessage != nil { + objectMap["message"] = oe.ErrorMessage + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for OdataError struct. func (oe *OdataError) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -856,26 +1239,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 +1268,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 +1279,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 +1316,127 @@ 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 + } + if sp.ObjectType != "" { + 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 +1472,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 +1483,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 +1598,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 +1645,66 @@ 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 + } + if u.UserType != "" { + 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 + } + if u.ObjectType != "" { + 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 +1740,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 +1753,32 @@ 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 + } + if ub.UserType != "" { + 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 +1791,82 @@ 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 + } + if ucp.UserType != "" { + 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 +1966,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 +1976,55 @@ 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 + } + if uup.UserType != "" { + 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..bc4178e5659f 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) { @@ -152,7 +152,7 @@ func (client ObjectsClient) GetObjectsByObjectIdsPreparer(ctx context.Context, p } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/{tenantID}/getObjectsByObjectIds", pathParameters), 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..27392c322aba 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) @@ -85,7 +85,7 @@ func (client ServicePrincipalsClient) CreatePreparer(ctx context.Context, parame } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/{tenantID}/servicePrincipals", pathParameters), @@ -621,7 +621,7 @@ func (client ServicePrincipalsClient) UpdateKeyCredentialsPreparer(ctx context.C } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/{tenantID}/servicePrincipals/{objectId}/keyCredentials", pathParameters), @@ -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 { @@ -688,7 +688,7 @@ func (client ServicePrincipalsClient) UpdatePasswordCredentialsPreparer(ctx cont } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/{tenantID}/servicePrincipals/{objectId}/passwordCredentials", pathParameters), 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..47db7ba00eee 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) @@ -89,7 +89,7 @@ func (client UsersClient) CreatePreparer(ctx context.Context, parameters UserCre } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/{tenantID}/users", pathParameters), @@ -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) @@ -291,7 +292,7 @@ func (client UsersClient) GetMemberGroupsPreparer(ctx context.Context, objectID } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/{tenantID}/users/{objectId}/getMemberGroups", pathParameters), @@ -503,7 +504,7 @@ func (client UsersClient) UpdatePreparer(ctx context.Context, upnOrObjectID stri } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/{tenantID}/users/{upnOrObjectId}", pathParameters), 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..854ff2d1262f 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) @@ -88,7 +89,7 @@ func (client CertificatesClient) CreateOrUpdatePreparer(ctx context.Context, res } 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.Devices/IotHubs/{resourceName}/certificates/{certificateName}", pathParameters), @@ -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) @@ -461,7 +462,7 @@ func (client CertificatesClient) VerifyPreparer(ctx context.Context, resourceGro } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}/verify", pathParameters), 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..713cbb91e16d 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) @@ -83,7 +83,7 @@ func (client IotHubResourceClient) CheckNameAvailabilityPreparer(ctx context.Con } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Devices/checkNameAvailability", pathParameters), @@ -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) @@ -252,7 +252,7 @@ func (client IotHubResourceClient) CreateOrUpdatePreparer(ctx context.Context, r } 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.Devices/IotHubs/{resourceName}", pathParameters), @@ -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) @@ -480,7 +480,7 @@ func (client IotHubResourceClient) ExportDevicesPreparer(ctx context.Context, re } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/exportDevices", pathParameters), @@ -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) @@ -1090,7 +1090,7 @@ func (client IotHubResourceClient) ImportDevicesPreparer(ctx context.Context, re } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/importDevices", pathParameters), @@ -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..6e982061723e 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" @@ -61,6 +62,11 @@ const ( ServiceConnectDeviceConnect AccessRights = "ServiceConnect, DeviceConnect" ) +// PossibleAccessRightsValues returns an array of possible values for the AccessRights const type. +func PossibleAccessRightsValues() []AccessRights { + return []AccessRights{DeviceConnect, RegistryRead, RegistryReadDeviceConnect, RegistryReadRegistryWrite, RegistryReadRegistryWriteDeviceConnect, RegistryReadRegistryWriteServiceConnect, RegistryReadRegistryWriteServiceConnectDeviceConnect, RegistryReadServiceConnect, RegistryReadServiceConnectDeviceConnect, RegistryWrite, RegistryWriteDeviceConnect, RegistryWriteServiceConnect, RegistryWriteServiceConnectDeviceConnect, ServiceConnect, ServiceConnectDeviceConnect} +} + // Capabilities enumerates the values for capabilities. type Capabilities string @@ -71,6 +77,11 @@ const ( None Capabilities = "None" ) +// PossibleCapabilitiesValues returns an array of possible values for the Capabilities const type. +func PossibleCapabilitiesValues() []Capabilities { + return []Capabilities{DeviceManagement, None} +} + // IotHubNameUnavailabilityReason enumerates the values for iot hub name unavailability reason. type IotHubNameUnavailabilityReason string @@ -81,6 +92,11 @@ const ( Invalid IotHubNameUnavailabilityReason = "Invalid" ) +// PossibleIotHubNameUnavailabilityReasonValues returns an array of possible values for the IotHubNameUnavailabilityReason const type. +func PossibleIotHubNameUnavailabilityReasonValues() []IotHubNameUnavailabilityReason { + return []IotHubNameUnavailabilityReason{AlreadyExists, Invalid} +} + // IotHubScaleType enumerates the values for iot hub scale type. type IotHubScaleType string @@ -93,6 +109,11 @@ const ( IotHubScaleTypeNone IotHubScaleType = "None" ) +// PossibleIotHubScaleTypeValues returns an array of possible values for the IotHubScaleType const type. +func PossibleIotHubScaleTypeValues() []IotHubScaleType { + return []IotHubScaleType{IotHubScaleTypeAutomatic, IotHubScaleTypeManual, IotHubScaleTypeNone} +} + // IotHubSku enumerates the values for iot hub sku. type IotHubSku string @@ -107,6 +128,11 @@ const ( S3 IotHubSku = "S3" ) +// PossibleIotHubSkuValues returns an array of possible values for the IotHubSku const type. +func PossibleIotHubSkuValues() []IotHubSku { + return []IotHubSku{F1, S1, S2, S3} +} + // IotHubSkuTier enumerates the values for iot hub sku tier. type IotHubSkuTier string @@ -117,6 +143,11 @@ const ( Standard IotHubSkuTier = "Standard" ) +// PossibleIotHubSkuTierValues returns an array of possible values for the IotHubSkuTier const type. +func PossibleIotHubSkuTierValues() []IotHubSkuTier { + return []IotHubSkuTier{Free, Standard} +} + // IPFilterActionType enumerates the values for ip filter action type. type IPFilterActionType string @@ -127,6 +158,11 @@ const ( Reject IPFilterActionType = "Reject" ) +// PossibleIPFilterActionTypeValues returns an array of possible values for the IPFilterActionType const type. +func PossibleIPFilterActionTypeValues() []IPFilterActionType { + return []IPFilterActionType{Accept, Reject} +} + // JobStatus enumerates the values for job status. type JobStatus string @@ -145,6 +181,11 @@ const ( Unknown JobStatus = "unknown" ) +// PossibleJobStatusValues returns an array of possible values for the JobStatus const type. +func PossibleJobStatusValues() []JobStatus { + return []JobStatus{Cancelled, Completed, Enqueued, Failed, Running, Unknown} +} + // JobType enumerates the values for job type. type JobType string @@ -171,6 +212,11 @@ const ( JobTypeWriteDeviceProperties JobType = "writeDeviceProperties" ) +// PossibleJobTypeValues returns an array of possible values for the JobType const type. +func PossibleJobTypeValues() []JobType { + return []JobType{JobTypeBackup, JobTypeExport, JobTypeFactoryResetDevice, JobTypeFirmwareUpdate, JobTypeImport, JobTypeReadDeviceProperties, JobTypeRebootDevice, JobTypeUnknown, JobTypeUpdateDeviceConfiguration, JobTypeWriteDeviceProperties} +} + // OperationMonitoringLevel enumerates the values for operation monitoring level. type OperationMonitoringLevel string @@ -185,6 +231,11 @@ const ( OperationMonitoringLevelNone OperationMonitoringLevel = "None" ) +// PossibleOperationMonitoringLevelValues returns an array of possible values for the OperationMonitoringLevel const type. +func PossibleOperationMonitoringLevelValues() []OperationMonitoringLevel { + return []OperationMonitoringLevel{OperationMonitoringLevelError, OperationMonitoringLevelErrorInformation, OperationMonitoringLevelInformation, OperationMonitoringLevelNone} +} + // RoutingSource enumerates the values for routing source. type RoutingSource string @@ -199,6 +250,11 @@ const ( TwinChangeEvents RoutingSource = "TwinChangeEvents" ) +// PossibleRoutingSourceValues returns an array of possible values for the RoutingSource const type. +func PossibleRoutingSourceValues() []RoutingSource { + return []RoutingSource{DeviceJobLifecycleEvents, DeviceLifecycleEvents, DeviceMessages, TwinChangeEvents} +} + // CertificateBodyDescription the JSON-serialized X509 Certificate. type CertificateBodyDescription struct { // Certificate - base-64 representation of the X509 leaf certificate .cer file or just .pem file content. @@ -242,8 +298,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 +362,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 +509,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 +555,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 +572,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 +735,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 +751,51 @@ 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 + } + if ihp.Features != "" { + objectMap["features"] = ihp.Features + } + return json.Marshal(objectMap) +} + // IotHubQuotaMetricInfo quota metrics properties. type IotHubQuotaMetricInfo struct { // Name - The name of the quota metric. @@ -769,22 +921,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 +969,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 +1396,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 +1433,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 +1471,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 +1556,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..26df00d4b964 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) @@ -245,7 +247,7 @@ func (client BaseClient) CreateCertificatePreparer(ctx context.Context, vaultBas } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), autorest.WithPathParameters("/certificates/{certificate-name}/create", pathParameters), @@ -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) @@ -323,7 +325,7 @@ func (client BaseClient) CreateKeyPreparer(ctx context.Context, vaultBaseURL str } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), autorest.WithPathParameters("/keys/{key-name}/create", pathParameters), @@ -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) @@ -404,7 +407,7 @@ func (client BaseClient) DecryptPreparer(ctx context.Context, vaultBaseURL strin } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), autorest.WithPathParameters("/keys/{key-name}/{key-version}/decrypt", pathParameters), @@ -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) @@ -1054,7 +1062,7 @@ func (client BaseClient) EncryptPreparer(ctx context.Context, vaultBaseURL strin } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), autorest.WithPathParameters("/keys/{key-name}/{key-version}/encrypt", pathParameters), @@ -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) @@ -3283,7 +3304,7 @@ func (client BaseClient) ImportCertificatePreparer(ctx context.Context, vaultBas } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), autorest.WithPathParameters("/certificates/{certificate-name}/import", pathParameters), @@ -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) @@ -3363,7 +3385,7 @@ func (client BaseClient) ImportKeyPreparer(ctx context.Context, vaultBaseURL str } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), autorest.WithPathParameters("/keys/{key-name}", pathParameters), @@ -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) @@ -3441,7 +3463,7 @@ func (client BaseClient) MergeCertificatePreparer(ctx context.Context, vaultBase } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), autorest.WithPathParameters("/certificates/{certificate-name}/pending/merge", pathParameters), @@ -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) @@ -3939,7 +3965,7 @@ func (client BaseClient) RegenerateStorageAccountKeyPreparer(ctx context.Context } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), autorest.WithPathParameters("/storage/{storage-account-name}/regeneratekey", pathParameters), @@ -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) @@ -4019,7 +4046,7 @@ func (client BaseClient) RestoreKeyPreparer(ctx context.Context, vaultBaseURL st } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), autorest.WithPath("/keys/restore"), @@ -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) @@ -4092,7 +4120,7 @@ func (client BaseClient) RestoreSecretPreparer(ctx context.Context, vaultBaseURL } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), autorest.WithPath("/secrets/restore"), @@ -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 { @@ -4160,7 +4188,7 @@ func (client BaseClient) SetCertificateContactsPreparer(ctx context.Context, vau } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), autorest.WithPath("/certificates/contacts"), @@ -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) @@ -4237,7 +4266,7 @@ func (client BaseClient) SetCertificateIssuerPreparer(ctx context.Context, vault } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), autorest.WithPathParameters("/certificates/issuers/{issuer-name}", pathParameters), @@ -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) @@ -4320,7 +4350,7 @@ func (client BaseClient) SetSasDefinitionPreparer(ctx context.Context, vaultBase } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), autorest.WithPathParameters("/storage/{storage-account-name}/sas/{sas-definition-name}", pathParameters), @@ -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) @@ -4400,7 +4430,7 @@ func (client BaseClient) SetSecretPreparer(ctx context.Context, vaultBaseURL str } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), autorest.WithPathParameters("/secrets/{secret-name}", pathParameters), @@ -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) @@ -4481,7 +4511,7 @@ func (client BaseClient) SetStorageAccountPreparer(ctx context.Context, vaultBas } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), autorest.WithPathParameters("/storage/{storage-account-name}", pathParameters), @@ -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) @@ -4560,7 +4590,7 @@ func (client BaseClient) SignPreparer(ctx context.Context, vaultBaseURL string, } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), autorest.WithPathParameters("/keys/{key-name}/{key-version}/sign", pathParameters), @@ -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) @@ -4640,7 +4671,7 @@ func (client BaseClient) UnwrapKeyPreparer(ctx context.Context, vaultBaseURL str } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), autorest.WithPathParameters("/keys/{key-name}/{key-version}/unwrapkey", pathParameters), @@ -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 @@ -4714,7 +4745,7 @@ func (client BaseClient) UpdateCertificatePreparer(ctx context.Context, vaultBas } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), autorest.WithPathParameters("/certificates/{certificate-name}/{certificate-version}", pathParameters), @@ -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 { @@ -4786,7 +4817,7 @@ func (client BaseClient) UpdateCertificateIssuerPreparer(ctx context.Context, va } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), autorest.WithPathParameters("/certificates/issuers/{issuer-name}", pathParameters), @@ -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. @@ -4858,7 +4889,7 @@ func (client BaseClient) UpdateCertificateOperationPreparer(ctx context.Context, } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), autorest.WithPathParameters("/certificates/{certificate-name}/pending", pathParameters), @@ -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. @@ -4929,7 +4961,7 @@ func (client BaseClient) UpdateCertificatePolicyPreparer(ctx context.Context, va } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), autorest.WithPathParameters("/certificates/{certificate-name}/policy", pathParameters), @@ -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 { @@ -5002,7 +5034,7 @@ func (client BaseClient) UpdateKeyPreparer(ctx context.Context, vaultBaseURL str } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), autorest.WithPathParameters("/keys/{key-name}/{key-version}", pathParameters), @@ -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) @@ -5083,7 +5116,7 @@ func (client BaseClient) UpdateSasDefinitionPreparer(ctx context.Context, vaultB } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), autorest.WithPathParameters("/storage/{storage-account-name}/sas/{sas-definition-name}", pathParameters), @@ -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 { @@ -5156,7 +5190,7 @@ func (client BaseClient) UpdateSecretPreparer(ctx context.Context, vaultBaseURL } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), autorest.WithPathParameters("/secrets/{secret-name}/{secret-version}", pathParameters), @@ -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) @@ -5233,7 +5268,7 @@ func (client BaseClient) UpdateStorageAccountPreparer(ctx context.Context, vault } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), autorest.WithPathParameters("/storage/{storage-account-name}", pathParameters), @@ -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) @@ -5315,7 +5350,7 @@ func (client BaseClient) VerifyPreparer(ctx context.Context, vaultBaseURL string } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), autorest.WithPathParameters("/keys/{key-name}/{key-version}/verify", pathParameters), @@ -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) @@ -5397,7 +5432,7 @@ func (client BaseClient) WrapKeyPreparer(ctx context.Context, vaultBaseURL strin } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithCustomBaseURL("{vaultBaseUrl}", urlParameters), autorest.WithPathParameters("/keys/{key-name}/{key-version}/wrapkey", pathParameters), 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..0bdea2f1b8e7 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" @@ -34,6 +35,11 @@ const ( EmailContacts ActionType = "EmailContacts" ) +// PossibleActionTypeValues returns an array of possible values for the ActionType const type. +func PossibleActionTypeValues() []ActionType { + return []ActionType{AutoRenew, EmailContacts} +} + // DeletionRecoveryLevel enumerates the values for deletion recovery level. type DeletionRecoveryLevel string @@ -48,6 +54,11 @@ const ( RecoverablePurgeable DeletionRecoveryLevel = "Recoverable+Purgeable" ) +// PossibleDeletionRecoveryLevelValues returns an array of possible values for the DeletionRecoveryLevel const type. +func PossibleDeletionRecoveryLevelValues() []DeletionRecoveryLevel { + return []DeletionRecoveryLevel{Purgeable, Recoverable, RecoverableProtectedSubscription, RecoverablePurgeable} +} + // JSONWebKeyCurveName enumerates the values for json web key curve name. type JSONWebKeyCurveName string @@ -62,6 +73,11 @@ const ( SECP256K1 JSONWebKeyCurveName = "SECP256K1" ) +// PossibleJSONWebKeyCurveNameValues returns an array of possible values for the JSONWebKeyCurveName const type. +func PossibleJSONWebKeyCurveNameValues() []JSONWebKeyCurveName { + return []JSONWebKeyCurveName{P256, P384, P521, SECP256K1} +} + // JSONWebKeyEncryptionAlgorithm enumerates the values for json web key encryption algorithm. type JSONWebKeyEncryptionAlgorithm string @@ -74,6 +90,11 @@ const ( RSAOAEP256 JSONWebKeyEncryptionAlgorithm = "RSA-OAEP-256" ) +// PossibleJSONWebKeyEncryptionAlgorithmValues returns an array of possible values for the JSONWebKeyEncryptionAlgorithm const type. +func PossibleJSONWebKeyEncryptionAlgorithmValues() []JSONWebKeyEncryptionAlgorithm { + return []JSONWebKeyEncryptionAlgorithm{RSA15, RSAOAEP, RSAOAEP256} +} + // JSONWebKeyOperation enumerates the values for json web key operation. type JSONWebKeyOperation string @@ -92,6 +113,11 @@ const ( WrapKey JSONWebKeyOperation = "wrapKey" ) +// PossibleJSONWebKeyOperationValues returns an array of possible values for the JSONWebKeyOperation const type. +func PossibleJSONWebKeyOperationValues() []JSONWebKeyOperation { + return []JSONWebKeyOperation{Decrypt, Encrypt, Sign, UnwrapKey, Verify, WrapKey} +} + // JSONWebKeySignatureAlgorithm enumerates the values for json web key signature algorithm. type JSONWebKeySignatureAlgorithm string @@ -120,6 +146,11 @@ const ( RSNULL JSONWebKeySignatureAlgorithm = "RSNULL" ) +// PossibleJSONWebKeySignatureAlgorithmValues returns an array of possible values for the JSONWebKeySignatureAlgorithm const type. +func PossibleJSONWebKeySignatureAlgorithmValues() []JSONWebKeySignatureAlgorithm { + return []JSONWebKeySignatureAlgorithm{ECDSA256, ES256, ES384, ES512, PS256, PS384, PS512, RS256, RS384, RS512, RSNULL} +} + // JSONWebKeyType enumerates the values for json web key type. type JSONWebKeyType string @@ -136,6 +167,11 @@ const ( RSAHSM JSONWebKeyType = "RSA-HSM" ) +// PossibleJSONWebKeyTypeValues returns an array of possible values for the JSONWebKeyType const type. +func PossibleJSONWebKeyTypeValues() []JSONWebKeyType { + return []JSONWebKeyType{EC, ECHSM, Oct, RSA, RSAHSM} +} + // KeyUsageType enumerates the values for key usage type. type KeyUsageType string @@ -160,6 +196,11 @@ const ( NonRepudiation KeyUsageType = "nonRepudiation" ) +// PossibleKeyUsageTypeValues returns an array of possible values for the KeyUsageType const type. +func PossibleKeyUsageTypeValues() []KeyUsageType { + return []KeyUsageType{CRLSign, DataEncipherment, DecipherOnly, DigitalSignature, EncipherOnly, KeyAgreement, KeyCertSign, KeyEncipherment, NonRepudiation} +} + // Action the action that will be executed. type Action struct { // ActionType - The type of the action. Possible values include: 'EmailContacts', 'AutoRenew' @@ -208,6 +249,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 +261,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 +283,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 +326,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 +355,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 +520,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 +652,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 +725,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 +762,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 +789,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 +984,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 +1174,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 +1193,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 +1480,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 +1492,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 +1502,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 +1534,35 @@ 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{}) + if kcp.Kty != "" { + 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 + } + if kcp.Curve != "" { + 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 +1572,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 +1600,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 +1771,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 +1846,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 +1908,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 +2034,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 +2070,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 +2084,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 +2125,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 +2272,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 +2304,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 +2345,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 +2381,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 +2419,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 +2459,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..a887b0ee342f 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,23 @@ 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" +) + +// PossibleAccessPolicyUpdateKindValues returns an array of possible values for the AccessPolicyUpdateKind const type. +func PossibleAccessPolicyUpdateKindValues() []AccessPolicyUpdateKind { + return []AccessPolicyUpdateKind{Add, Remove, Replace} +} + // CertificatePermissions enumerates the values for certificate permissions. type CertificatePermissions string @@ -60,6 +78,11 @@ const ( Update CertificatePermissions = "update" ) +// PossibleCertificatePermissionsValues returns an array of possible values for the CertificatePermissions const type. +func PossibleCertificatePermissionsValues() []CertificatePermissions { + return []CertificatePermissions{Create, Delete, Deleteissuers, Get, Getissuers, Import, List, Listissuers, Managecontacts, Manageissuers, Purge, Recover, Setissuers, Update} +} + // CreateMode enumerates the values for create mode. type CreateMode string @@ -70,6 +93,11 @@ const ( CreateModeRecover CreateMode = "recover" ) +// PossibleCreateModeValues returns an array of possible values for the CreateMode const type. +func PossibleCreateModeValues() []CreateMode { + return []CreateMode{CreateModeDefault, CreateModeRecover} +} + // KeyPermissions enumerates the values for key permissions. type KeyPermissions string @@ -108,6 +136,26 @@ const ( KeyPermissionsWrapKey KeyPermissions = "wrapKey" ) +// PossibleKeyPermissionsValues returns an array of possible values for the KeyPermissions const type. +func PossibleKeyPermissionsValues() []KeyPermissions { + return []KeyPermissions{KeyPermissionsBackup, KeyPermissionsCreate, KeyPermissionsDecrypt, KeyPermissionsDelete, KeyPermissionsEncrypt, KeyPermissionsGet, KeyPermissionsImport, KeyPermissionsList, KeyPermissionsPurge, KeyPermissionsRecover, KeyPermissionsRestore, KeyPermissionsSign, KeyPermissionsUnwrapKey, KeyPermissionsUpdate, KeyPermissionsVerify, KeyPermissionsWrapKey} +} + +// Reason enumerates the values for reason. +type Reason string + +const ( + // AccountNameInvalid ... + AccountNameInvalid Reason = "AccountNameInvalid" + // AlreadyExists ... + AlreadyExists Reason = "AlreadyExists" +) + +// PossibleReasonValues returns an array of possible values for the Reason const type. +func PossibleReasonValues() []Reason { + return []Reason{AccountNameInvalid, AlreadyExists} +} + // SecretPermissions enumerates the values for secret permissions. type SecretPermissions string @@ -130,6 +178,11 @@ const ( SecretPermissionsSet SecretPermissions = "set" ) +// PossibleSecretPermissionsValues returns an array of possible values for the SecretPermissions const type. +func PossibleSecretPermissionsValues() []SecretPermissions { + return []SecretPermissions{SecretPermissionsBackup, SecretPermissionsDelete, SecretPermissionsGet, SecretPermissionsList, SecretPermissionsPurge, SecretPermissionsRecover, SecretPermissionsRestore, SecretPermissionsSet} +} + // SkuName enumerates the values for sku name. type SkuName string @@ -140,10 +193,17 @@ const ( Standard SkuName = "standard" ) +// PossibleSkuNameValues returns an array of possible values for the SkuName const type. +func PossibleSkuNameValues() []SkuName { + return []SkuName{Premium, Standard} +} + // StoragePermissions enumerates the values for storage permissions. type StoragePermissions string const ( + // StoragePermissionsBackup ... + StoragePermissionsBackup StoragePermissions = "backup" // StoragePermissionsDelete ... StoragePermissionsDelete StoragePermissions = "delete" // StoragePermissionsDeletesas ... @@ -156,8 +216,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 ... @@ -166,6 +232,11 @@ const ( StoragePermissionsUpdate StoragePermissions = "update" ) +// PossibleStoragePermissionsValues returns an array of possible values for the StoragePermissions const type. +func PossibleStoragePermissionsValues() []StoragePermissions { + return []StoragePermissions{StoragePermissionsBackup, StoragePermissionsDelete, StoragePermissionsDeletesas, StoragePermissionsGet, StoragePermissionsGetsas, StoragePermissionsList, StoragePermissionsListsas, StoragePermissionsPurge, StoragePermissionsRecover, StoragePermissionsRegeneratekey, StoragePermissionsRestore, StoragePermissionsSet, StoragePermissionsSetsas, StoragePermissionsUpdate} +} + // AccessPolicyEntry an identity 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. type AccessPolicyEntry struct { @@ -179,6 +250,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 +387,240 @@ 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"` +} + +// 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 + } + if o.Origin != nil { + objectMap["origin"] = o.Origin + } + if o.OperationProperties != nil { + objectMap["properties"] = o.OperationProperties + } + return json.Marshal(objectMap) +} + +// 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 +646,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 +772,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 +789,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 +800,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 +861,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 +983,48 @@ 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 specifying whether recoverable deletion ('soft' delete) is enabled for this key vault. The property may not be set to false. + 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"` + // EnablePurgeProtection - Property specifying whether protection against purge is enabled for this vault; it is only effective if soft delete is also enabled. Once activated, the property may no longer be reset to false. + EnablePurgeProtection *bool `json:"enablePurgeProtection,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. @@ -589,10 +1041,12 @@ type VaultProperties struct { 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 - Property specifying whether recoverable deletion is enabled for this key vault. Setting this property to true activates the soft delete feature, whereby vaults or vault entities can be recovered after deletion. Enabling this functionality is irreversible - that is, the property does not accept false as its 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"` + // EnablePurgeProtection - Property specifying whether protection against purge is enabled for this vault. Setting this property to true activates protection against purge for this vault and its content - only the Key Vault service may initiate a hard, irrecoverable deletion. The setting is effective only if soft delete is also enabled. Enabling this functionality is irreversible - that is, the property does not accept false as its value. + EnablePurgeProtection *bool `json:"enablePurgeProtection,omitempty"` } // VaultsPurgeDeletedFuture an abstraction for monitoring and retrieving the results of a long-running operation. @@ -607,21 +1061,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..4f3c75838de0 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.AsContentType("application/json; charset=utf-8"), + 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) @@ -96,7 +167,7 @@ func (client VaultsClient) CreateOrUpdatePreparer(ctx context.Context, resourceG } 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.KeyVault/vaults/{vaultName}", pathParameters), @@ -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.AsContentType("application/json; charset=utf-8"), + 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.AsContentType("application/json; charset=utf-8"), + 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..f176cae03ded 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 @@ -42,8 +42,8 @@ func NewActionGroupsClientWithBaseURI(baseURI string, subscriptionID string) Act // CreateOrUpdate create a new action group or update an existing one. // -// resourceGroupName is the name of the resource group. actionGroupName is the name of the action group. actionGroup is -// the action group to create or use for the update. +// resourceGroupName is the name of the resource group. actionGroupName is the name of the action group. +// actionGroup is the action group to create or use for the update. func (client ActionGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, actionGroupName string, actionGroup ActionGroupResource) (result ActionGroupResource, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: actionGroup, @@ -52,7 +52,7 @@ func (client ActionGroupsClient) CreateOrUpdate(ctx context.Context, resourceGro Chain: []validation.Constraint{{Target: "actionGroup.ActionGroup.GroupShortName", Name: validation.MaxLength, Rule: 15, Chain: nil}}}, {Target: "actionGroup.ActionGroup.Enabled", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "insights.ActionGroupsClient", "CreateOrUpdate") + return result, validation.NewError("insights.ActionGroupsClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, actionGroupName, actionGroup) @@ -90,7 +90,7 @@ func (client ActionGroupsClient) CreateOrUpdatePreparer(ctx context.Context, res } 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.insights/actionGroups/{actionGroupName}", pathParameters), @@ -186,13 +186,13 @@ func (client ActionGroupsClient) DeleteResponder(resp *http.Response) (result au // EnableReceiver enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. // -// resourceGroupName is the name of the resource group. actionGroupName is the name of the action group. enableRequest -// is the receiver to re-enable. +// resourceGroupName is the name of the resource group. actionGroupName is the name of the action group. +// enableRequest is the receiver to re-enable. func (client ActionGroupsClient) EnableReceiver(ctx context.Context, resourceGroupName string, actionGroupName string, enableRequest EnableRequest) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: enableRequest, Constraints: []validation.Constraint{{Target: "enableRequest.ReceiverName", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "insights.ActionGroupsClient", "EnableReceiver") + return result, validation.NewError("insights.ActionGroupsClient", "EnableReceiver", err.Error()) } req, err := client.EnableReceiverPreparer(ctx, resourceGroupName, actionGroupName, enableRequest) @@ -230,7 +230,7 @@ func (client ActionGroupsClient) EnableReceiverPreparer(ctx context.Context, res } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/actionGroups/{actionGroupName}/subscribe", pathParameters), @@ -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.AsContentType("application/json; charset=utf-8"), + 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/activitylogalerts.go b/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/activitylogalerts.go index 137bacfa340e..fb767a084e10 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/activitylogalerts.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/activitylogalerts.go @@ -53,7 +53,7 @@ func (client ActivityLogAlertsClient) CreateOrUpdate(ctx context.Context, resour Chain: []validation.Constraint{{Target: "activityLogAlert.ActivityLogAlert.Condition.AllOf", Name: validation.Null, Rule: true, Chain: nil}}}, {Target: "activityLogAlert.ActivityLogAlert.Actions", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "insights.ActivityLogAlertsClient", "CreateOrUpdate") + return result, validation.NewError("insights.ActivityLogAlertsClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, activityLogAlertName, activityLogAlert) @@ -91,7 +91,7 @@ func (client ActivityLogAlertsClient) CreateOrUpdatePreparer(ctx context.Context } 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.insights/activityLogAlerts/{activityLogAlertName}", pathParameters), @@ -418,7 +418,7 @@ func (client ActivityLogAlertsClient) UpdatePreparer(ctx context.Context, resour } 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.insights/activityLogAlerts/{activityLogAlertName}", pathParameters), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/alertruleincidents.go b/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/alertruleincidents.go index 9d1508ec1bca..f3d8fc8b20ab 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/alertruleincidents.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/alertruleincidents.go @@ -41,8 +41,8 @@ func NewAlertRuleIncidentsClientWithBaseURI(baseURI string, subscriptionID strin // Get gets an incident associated to an alert rule // -// resourceGroupName is the name of the resource group. ruleName is the name of the rule. incidentName is the name of -// the incident to retrieve. +// resourceGroupName is the name of the resource group. ruleName is the name of the rule. incidentName is the name +// of the incident to retrieve. func (client AlertRuleIncidentsClient) Get(ctx context.Context, resourceGroupName string, ruleName string, incidentName string) (result Incident, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, ruleName, incidentName) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/alertrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/alertrules.go index 7d8a19dd6e20..0c1145b37220 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/alertrules.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/alertrules.go @@ -42,8 +42,8 @@ func NewAlertRulesClientWithBaseURI(baseURI string, subscriptionID string) Alert // CreateOrUpdate creates or updates an alert rule. // -// resourceGroupName is the name of the resource group. ruleName is the name of the rule. parameters is the parameters -// of the rule to create or update. +// resourceGroupName is the name of the resource group. ruleName is the name of the rule. parameters is the +// parameters of the rule to create or update. func (client AlertRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, ruleName string, parameters AlertRuleResource) (result AlertRuleResource, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -52,7 +52,7 @@ func (client AlertRulesClient) CreateOrUpdate(ctx context.Context, resourceGroup {Target: "parameters.AlertRule.IsEnabled", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.AlertRule.Condition", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "insights.AlertRulesClient", "CreateOrUpdate") + return result, validation.NewError("insights.AlertRulesClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, ruleName, parameters) @@ -90,7 +90,7 @@ func (client AlertRulesClient) CreateOrUpdatePreparer(ctx context.Context, resou } 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.insights/alertrules/{ruleName}", pathParameters), @@ -355,7 +355,7 @@ func (client AlertRulesClient) UpdatePreparer(ctx context.Context, resourceGroup } 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.insights/alertrules/{ruleName}", pathParameters), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/autoscalesettings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/autoscalesettings.go index a3be3075a55f..d93536ada7b7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/autoscalesettings.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/autoscalesettings.go @@ -42,8 +42,8 @@ func NewAutoscaleSettingsClientWithBaseURI(baseURI string, subscriptionID string // CreateOrUpdate creates or updates an autoscale setting. // -// resourceGroupName is the name of the resource group. autoscaleSettingName is the autoscale setting name. parameters -// is parameters supplied to the operation. +// resourceGroupName is the name of the resource group. autoscaleSettingName is the autoscale setting name. +// parameters is parameters supplied to the operation. func (client AutoscaleSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, autoscaleSettingName string, parameters AutoscaleSettingResource) (result AutoscaleSettingResource, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -51,7 +51,7 @@ func (client AutoscaleSettingsClient) CreateOrUpdate(ctx context.Context, resour Chain: []validation.Constraint{{Target: "parameters.AutoscaleSetting.Profiles", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.AutoscaleSetting.Profiles", Name: validation.MaxItems, Rule: 20, Chain: nil}}}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "insights.AutoscaleSettingsClient", "CreateOrUpdate") + return result, validation.NewError("insights.AutoscaleSettingsClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, autoscaleSettingName, parameters) @@ -89,7 +89,7 @@ func (client AutoscaleSettingsClient) CreateOrUpdatePreparer(ctx context.Context } 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.insights/autoscalesettings/{autoscaleSettingName}", pathParameters), @@ -382,7 +382,7 @@ func (client AutoscaleSettingsClient) UpdatePreparer(ctx context.Context, resour } 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.insights/autoscalesettings/{autoscaleSettingName}", pathParameters), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/diagnosticsettings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/diagnosticsettings.go index c938435a013a..95ed5682be15 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/diagnosticsettings.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/diagnosticsettings.go @@ -41,8 +41,8 @@ func NewDiagnosticSettingsClientWithBaseURI(baseURI string, subscriptionID strin // CreateOrUpdate creates or updates diagnostic settings for the specified resource. // -// resourceURI is the identifier of the resource. parameters is parameters supplied to the operation. name is the name -// of the diagnostic setting. +// resourceURI is the identifier of the resource. parameters is parameters supplied to the operation. name is the +// name of the diagnostic setting. func (client DiagnosticSettingsClient) CreateOrUpdate(ctx context.Context, resourceURI string, parameters DiagnosticSettingsResource, name string) (result DiagnosticSettingsResource, err error) { req, err := client.CreateOrUpdatePreparer(ctx, resourceURI, parameters, name) if err != nil { @@ -78,7 +78,7 @@ func (client DiagnosticSettingsClient) CreateOrUpdatePreparer(ctx context.Contex } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/{resourceUri}/providers/microsoft.insights/diagnosticSettings/{name}", pathParameters), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/logprofiles.go b/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/logprofiles.go index 91342d2467a7..ab273d46afa4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/logprofiles.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-05-01-preview/insights/logprofiles.go @@ -55,7 +55,7 @@ func (client LogProfilesClient) CreateOrUpdate(ctx context.Context, logProfileNa Chain: []validation.Constraint{{Target: "parameters.LogProfileProperties.RetentionPolicy.Days", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}, }}, }}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "insights.LogProfilesClient", "CreateOrUpdate") + return result, validation.NewError("insights.LogProfilesClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, logProfileName, parameters) @@ -92,7 +92,7 @@ func (client LogProfilesClient) CreateOrUpdatePreparer(ctx context.Context, logP } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles/{logProfileName}", pathParameters), @@ -350,7 +350,7 @@ func (client LogProfilesClient) UpdatePreparer(ctx context.Context, logProfileNa } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles/{logProfileName}", pathParameters), 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..decb179ef30c 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 @@ -35,6 +35,11 @@ const ( Metrics CategoryType = "Metrics" ) +// PossibleCategoryTypeValues returns an array of possible values for the CategoryType const type. +func PossibleCategoryTypeValues() []CategoryType { + return []CategoryType{Logs, Metrics} +} + // ComparisonOperationType enumerates the values for comparison operation type. type ComparisonOperationType string @@ -53,6 +58,11 @@ const ( NotEquals ComparisonOperationType = "NotEquals" ) +// PossibleComparisonOperationTypeValues returns an array of possible values for the ComparisonOperationType const type. +func PossibleComparisonOperationTypeValues() []ComparisonOperationType { + return []ComparisonOperationType{Equals, GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual, NotEquals} +} + // ConditionOperator enumerates the values for condition operator. type ConditionOperator string @@ -67,6 +77,11 @@ const ( ConditionOperatorLessThanOrEqual ConditionOperator = "LessThanOrEqual" ) +// PossibleConditionOperatorValues returns an array of possible values for the ConditionOperator const type. +func PossibleConditionOperatorValues() []ConditionOperator { + return []ConditionOperator{ConditionOperatorGreaterThan, ConditionOperatorGreaterThanOrEqual, ConditionOperatorLessThan, ConditionOperatorLessThanOrEqual} +} + // MetricStatisticType enumerates the values for metric statistic type. type MetricStatisticType string @@ -81,6 +96,11 @@ const ( Sum MetricStatisticType = "Sum" ) +// PossibleMetricStatisticTypeValues returns an array of possible values for the MetricStatisticType const type. +func PossibleMetricStatisticTypeValues() []MetricStatisticType { + return []MetricStatisticType{Average, Max, Min, Sum} +} + // OdataType enumerates the values for odata type. type OdataType string @@ -93,6 +113,11 @@ const ( OdataTypeRuleDataSource OdataType = "RuleDataSource" ) +// PossibleOdataTypeValues returns an array of possible values for the OdataType const type. +func PossibleOdataTypeValues() []OdataType { + return []OdataType{OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource, OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource, OdataTypeRuleDataSource} +} + // OdataTypeBasicRuleAction enumerates the values for odata type basic rule action. type OdataTypeBasicRuleAction string @@ -105,6 +130,11 @@ const ( OdataTypeRuleAction OdataTypeBasicRuleAction = "RuleAction" ) +// PossibleOdataTypeBasicRuleActionValues returns an array of possible values for the OdataTypeBasicRuleAction const type. +func PossibleOdataTypeBasicRuleActionValues() []OdataTypeBasicRuleAction { + return []OdataTypeBasicRuleAction{OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction, OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction, OdataTypeRuleAction} +} + // OdataTypeBasicRuleCondition enumerates the values for odata type basic rule condition. type OdataTypeBasicRuleCondition string @@ -119,6 +149,11 @@ const ( OdataTypeRuleCondition OdataTypeBasicRuleCondition = "RuleCondition" ) +// PossibleOdataTypeBasicRuleConditionValues returns an array of possible values for the OdataTypeBasicRuleCondition const type. +func PossibleOdataTypeBasicRuleConditionValues() []OdataTypeBasicRuleCondition { + return []OdataTypeBasicRuleCondition{OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition, OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition, OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition, OdataTypeRuleCondition} +} + // ReceiverStatus enumerates the values for receiver status. type ReceiverStatus string @@ -131,6 +166,11 @@ const ( NotSpecified ReceiverStatus = "NotSpecified" ) +// PossibleReceiverStatusValues returns an array of possible values for the ReceiverStatus const type. +func PossibleReceiverStatusValues() []ReceiverStatus { + return []ReceiverStatus{Disabled, Enabled, NotSpecified} +} + // RecurrenceFrequency enumerates the values for recurrence frequency. type RecurrenceFrequency string @@ -153,6 +193,11 @@ const ( Year RecurrenceFrequency = "Year" ) +// PossibleRecurrenceFrequencyValues returns an array of possible values for the RecurrenceFrequency const type. +func PossibleRecurrenceFrequencyValues() []RecurrenceFrequency { + return []RecurrenceFrequency{Day, Hour, Minute, Month, None, Second, Week, Year} +} + // ScaleDirection enumerates the values for scale direction. type ScaleDirection string @@ -165,6 +210,11 @@ const ( ScaleDirectionNone ScaleDirection = "None" ) +// PossibleScaleDirectionValues returns an array of possible values for the ScaleDirection const type. +func PossibleScaleDirectionValues() []ScaleDirection { + return []ScaleDirection{ScaleDirectionDecrease, ScaleDirectionIncrease, ScaleDirectionNone} +} + // ScaleType enumerates the values for scale type. type ScaleType string @@ -177,6 +227,11 @@ const ( PercentChangeCount ScaleType = "PercentChangeCount" ) +// PossibleScaleTypeValues returns an array of possible values for the ScaleType const type. +func PossibleScaleTypeValues() []ScaleType { + return []ScaleType{ChangeCount, ExactCount, PercentChangeCount} +} + // TimeAggregationOperator enumerates the values for time aggregation operator. type TimeAggregationOperator string @@ -193,6 +248,11 @@ const ( TimeAggregationOperatorTotal TimeAggregationOperator = "Total" ) +// PossibleTimeAggregationOperatorValues returns an array of possible values for the TimeAggregationOperator const type. +func PossibleTimeAggregationOperatorValues() []TimeAggregationOperator { + return []TimeAggregationOperator{TimeAggregationOperatorAverage, TimeAggregationOperatorLast, TimeAggregationOperatorMaximum, TimeAggregationOperatorMinimum, TimeAggregationOperatorTotal} +} + // TimeAggregationType enumerates the values for time aggregation type. type TimeAggregationType string @@ -209,6 +269,11 @@ const ( TimeAggregationTypeTotal TimeAggregationType = "Total" ) +// PossibleTimeAggregationTypeValues returns an array of possible values for the TimeAggregationType const type. +func PossibleTimeAggregationTypeValues() []TimeAggregationType { + return []TimeAggregationType{TimeAggregationTypeAverage, TimeAggregationTypeCount, TimeAggregationTypeMaximum, TimeAggregationTypeMinimum, TimeAggregationTypeTotal} +} + // ActionGroup an Azure action group. type ActionGroup struct { // GroupShortName - The short name of the action group. This will be used in SMS messages. @@ -221,6 +286,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,9 +303,70 @@ 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"` + // ActionGroupPatch - The action group settings for an update operation. + *ActionGroupPatch `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ActionGroupPatchBody. +func (agpb ActionGroupPatchBody) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agpb.Tags != nil { + objectMap["tags"] = agpb.Tags + } + if agpb.ActionGroupPatch != nil { + objectMap["properties"] = agpb.ActionGroupPatch + } + return json.Marshal(objectMap) +} + +// 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 + } + 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 + } + agpb.Tags = tags + } + case "properties": + if v != nil { + var actionGroupPatch ActionGroupPatch + err = json.Unmarshal(*v, &actionGroupPatch) + if err != nil { + return err + } + agpb.ActionGroupPatch = &actionGroupPatch + } + } + } + + return nil +} + // ActionGroupResource an action group resource. type ActionGroupResource struct { autorest.Response `json:"-"` + // ActionGroup - The action groups properties of the resource. + *ActionGroup `json:"properties,omitempty"` // ID - Azure resource Id ID *string `json:"id,omitempty"` // Name - Azure resource name @@ -244,78 +376,97 @@ type ActionGroupResource struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - // ActionGroup - The action groups properties of the resource. - *ActionGroup `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for ActionGroupResource struct. -func (agr *ActionGroupResource) 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 ActionGroupResource. +func (agr ActionGroupResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agr.ActionGroup != nil { + objectMap["properties"] = agr.ActionGroup } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ActionGroup - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - agr.ActionGroup = &properties + if agr.ID != nil { + objectMap["id"] = agr.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - agr.ID = &ID + if agr.Name != nil { + objectMap["name"] = agr.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - agr.Name = &name + if agr.Type != nil { + objectMap["type"] = agr.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - agr.Type = &typeVar + if agr.Location != nil { + objectMap["location"] = agr.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - agr.Location = &location + if agr.Tags != nil { + objectMap["tags"] = agr.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 ActionGroupResource struct. +func (agr *ActionGroupResource) 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 actionGroup ActionGroup + err = json.Unmarshal(*v, &actionGroup) + if err != nil { + return err + } + agr.ActionGroup = &actionGroup + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + agr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + agr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + agr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + agr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + agr.Tags = tags + } } - agr.Tags = &tags } return nil @@ -340,7 +491,19 @@ type ActivityLogAlertActionGroup struct { // ActionGroupID - The resourceId of the action group. This cannot be null or empty. ActionGroupID *string `json:"actionGroupId,omitempty"` // WebhookProperties - the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload. - WebhookProperties *map[string]*string `json:"webhookProperties,omitempty"` + WebhookProperties map[string]*string `json:"webhookProperties"` +} + +// MarshalJSON is the custom marshaler for ActivityLogAlertActionGroup. +func (alaag ActivityLogAlertActionGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if alaag.ActionGroupID != nil { + objectMap["actionGroupId"] = alaag.ActionGroupID + } + if alaag.WebhookProperties != nil { + objectMap["webhookProperties"] = alaag.WebhookProperties + } + return json.Marshal(objectMap) } // ActivityLogAlertActionList a list of activity log alert actions. @@ -349,7 +512,8 @@ type ActivityLogAlertActionList struct { ActionGroups *[]ActivityLogAlertActionGroup `json:"actionGroups,omitempty"` } -// ActivityLogAlertAllOfCondition an Activity Log alert condition that is met when all its member conditions are met. +// ActivityLogAlertAllOfCondition an Activity Log alert condition that is met when all its member conditions are +// met. type ActivityLogAlertAllOfCondition struct { // AllOf - The list of activity log alert conditions. AllOf *[]ActivityLogAlertLeafCondition `json:"allOf,omitempty"` @@ -382,11 +546,23 @@ type ActivityLogAlertPatch struct { // ActivityLogAlertPatchBody an activity log alert object for the body of patch operations. type ActivityLogAlertPatchBody struct { // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` // ActivityLogAlertPatch - The activity log alert settings for an update operation. *ActivityLogAlertPatch `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for ActivityLogAlertPatchBody. +func (alapb ActivityLogAlertPatchBody) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if alapb.Tags != nil { + objectMap["tags"] = alapb.Tags + } + if alapb.ActivityLogAlertPatch != nil { + objectMap["properties"] = alapb.ActivityLogAlertPatch + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for ActivityLogAlertPatchBody struct. func (alapb *ActivityLogAlertPatchBody) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -394,26 +570,27 @@ func (alapb *ActivityLogAlertPatchBody) 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 - } - alapb.Tags = &tags - } - - v = m["properties"] - if v != nil { - var properties ActivityLogAlertPatch - 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 + } + alapb.Tags = tags + } + case "properties": + if v != nil { + var activityLogAlertPatch ActivityLogAlertPatch + err = json.Unmarshal(*v, &activityLogAlertPatch) + if err != nil { + return err + } + alapb.ActivityLogAlertPatch = &activityLogAlertPatch + } } - alapb.ActivityLogAlertPatch = &properties } return nil @@ -422,6 +599,8 @@ func (alapb *ActivityLogAlertPatchBody) UnmarshalJSON(body []byte) error { // ActivityLogAlertResource an activity log alert resource. type ActivityLogAlertResource struct { autorest.Response `json:"-"` + // ActivityLogAlert - The activity log alert properties of the resource. + *ActivityLogAlert `json:"properties,omitempty"` // ID - Azure resource Id ID *string `json:"id,omitempty"` // Name - Azure resource name @@ -431,78 +610,97 @@ type ActivityLogAlertResource struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - // ActivityLogAlert - The activity log alert properties of the resource. - *ActivityLogAlert `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for ActivityLogAlertResource struct. -func (alar *ActivityLogAlertResource) 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 ActivityLogAlertResource. +func (alar ActivityLogAlertResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if alar.ActivityLogAlert != nil { + objectMap["properties"] = alar.ActivityLogAlert } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties ActivityLogAlert - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - alar.ActivityLogAlert = &properties + if alar.ID != nil { + objectMap["id"] = alar.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - alar.ID = &ID + if alar.Name != nil { + objectMap["name"] = alar.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - alar.Name = &name + if alar.Type != nil { + objectMap["type"] = alar.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - alar.Type = &typeVar + if alar.Location != nil { + objectMap["location"] = alar.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - alar.Location = &location + if alar.Tags != nil { + objectMap["tags"] = alar.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 ActivityLogAlertResource struct. +func (alar *ActivityLogAlertResource) 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 activityLogAlert ActivityLogAlert + err = json.Unmarshal(*v, &activityLogAlert) + if err != nil { + return err + } + alar.ActivityLogAlert = &activityLogAlert + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + alar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + alar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + alar.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + alar.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + alar.Tags = tags + } } - alar.Tags = &tags } return nil @@ -531,64 +729,61 @@ func (ar *AlertRule) 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 - } - ar.Name = &name - } - - v = m["description"] - if v != nil { - var description string - err = json.Unmarshal(*m["description"], &description) - if err != nil { - return err - } - ar.Description = &description - } - - v = m["isEnabled"] - if v != nil { - var isEnabled bool - err = json.Unmarshal(*m["isEnabled"], &isEnabled) - if err != nil { - return err - } - ar.IsEnabled = &isEnabled - } - - v = m["condition"] - if v != nil { - condition, err := unmarshalBasicRuleCondition(*m["condition"]) - if err != nil { - return err - } - ar.Condition = condition - } - - v = m["actions"] - if v != nil { - actions, err := unmarshalBasicRuleActionArray(*m["actions"]) - if err != nil { - return err - } - ar.Actions = &actions - } - - v = m["lastUpdatedTime"] - if v != nil { - var lastUpdatedTime date.Time - err = json.Unmarshal(*m["lastUpdatedTime"], &lastUpdatedTime) - 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 + } + ar.Name = &name + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + ar.Description = &description + } + case "isEnabled": + if v != nil { + var isEnabled bool + err = json.Unmarshal(*v, &isEnabled) + if err != nil { + return err + } + ar.IsEnabled = &isEnabled + } + case "condition": + if v != nil { + condition, err := unmarshalBasicRuleCondition(*v) + if err != nil { + return err + } + ar.Condition = condition + } + case "actions": + if v != nil { + actions, err := unmarshalBasicRuleActionArray(*v) + if err != nil { + return err + } + ar.Actions = &actions + } + case "lastUpdatedTime": + if v != nil { + var lastUpdatedTime date.Time + err = json.Unmarshal(*v, &lastUpdatedTime) + if err != nil { + return err + } + ar.LastUpdatedTime = &lastUpdatedTime + } } - ar.LastUpdatedTime = &lastUpdatedTime } return nil @@ -597,6 +792,8 @@ func (ar *AlertRule) UnmarshalJSON(body []byte) error { // AlertRuleResource the alert rule resource. type AlertRuleResource struct { autorest.Response `json:"-"` + // AlertRule - The alert rule properties of the resource. + *AlertRule `json:"properties,omitempty"` // ID - Azure resource Id ID *string `json:"id,omitempty"` // Name - Azure resource name @@ -606,78 +803,97 @@ type AlertRuleResource struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - // AlertRule - The alert rule properties of the resource. - *AlertRule `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for AlertRuleResource struct. -func (arr *AlertRuleResource) 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 AlertRuleResource. +func (arr AlertRuleResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if arr.AlertRule != nil { + objectMap["properties"] = arr.AlertRule } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties AlertRule - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - arr.AlertRule = &properties + if arr.ID != nil { + objectMap["id"] = arr.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - arr.ID = &ID + if arr.Name != nil { + objectMap["name"] = arr.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - arr.Name = &name + if arr.Type != nil { + objectMap["type"] = arr.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - arr.Type = &typeVar + if arr.Location != nil { + objectMap["location"] = arr.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - arr.Location = &location + if arr.Tags != nil { + objectMap["tags"] = arr.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 AlertRuleResource struct. +func (arr *AlertRuleResource) 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 alertRule AlertRule + err = json.Unmarshal(*v, &alertRule) + if err != nil { + return err + } + arr.AlertRule = &alertRule + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + arr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + arr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + arr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + arr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + arr.Tags = tags + } } - arr.Tags = &tags } return nil @@ -693,11 +909,23 @@ type AlertRuleResourceCollection struct { // AlertRuleResourcePatch the alert rule object for patch operations. type AlertRuleResourcePatch struct { // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` // AlertRule - The properties of an alert rule. *AlertRule `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for AlertRuleResourcePatch. +func (arrp AlertRuleResourcePatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if arrp.Tags != nil { + objectMap["tags"] = arrp.Tags + } + if arrp.AlertRule != nil { + objectMap["properties"] = arrp.AlertRule + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for AlertRuleResourcePatch struct. func (arrp *AlertRuleResourcePatch) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -705,31 +933,48 @@ func (arrp *AlertRuleResourcePatch) 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 + } + arrp.Tags = tags + } + case "properties": + if v != nil { + var alertRule AlertRule + err = json.Unmarshal(*v, &alertRule) + if err != nil { + return err + } + arrp.AlertRule = &alertRule + } } - arrp.Tags = &tags - } - - v = m["properties"] - if v != nil { - var properties AlertRule - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - arrp.AlertRule = &properties } 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" @@ -771,6 +1016,8 @@ type AutoscaleSetting struct { // AutoscaleSettingResource the autoscale setting resource. type AutoscaleSettingResource struct { autorest.Response `json:"-"` + // AutoscaleSetting - The autoscale setting of the resource. + *AutoscaleSetting `json:"properties,omitempty"` // ID - Azure resource Id ID *string `json:"id,omitempty"` // Name - Azure resource name @@ -780,78 +1027,97 @@ type AutoscaleSettingResource struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - // AutoscaleSetting - The autoscale setting of the resource. - *AutoscaleSetting `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for AutoscaleSettingResource struct. -func (asr *AutoscaleSettingResource) 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 AutoscaleSettingResource. +func (asr AutoscaleSettingResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asr.AutoscaleSetting != nil { + objectMap["properties"] = asr.AutoscaleSetting } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties AutoscaleSetting - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - asr.AutoscaleSetting = &properties + if asr.ID != nil { + objectMap["id"] = asr.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - asr.ID = &ID + if asr.Name != nil { + objectMap["name"] = asr.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - asr.Name = &name + if asr.Type != nil { + objectMap["type"] = asr.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - asr.Type = &typeVar + if asr.Location != nil { + objectMap["location"] = asr.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - asr.Location = &location + if asr.Tags != nil { + objectMap["tags"] = asr.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 AutoscaleSettingResource struct. +func (asr *AutoscaleSettingResource) 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 autoscaleSetting AutoscaleSetting + err = json.Unmarshal(*v, &autoscaleSetting) + if err != nil { + return err + } + asr.AutoscaleSetting = &autoscaleSetting + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + asr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + asr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + asr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + asr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + asr.Tags = tags + } } - asr.Tags = &tags } return nil @@ -866,7 +1132,8 @@ type AutoscaleSettingResourceCollection struct { NextLink *string `json:"nextLink,omitempty"` } -// AutoscaleSettingResourceCollectionIterator provides access to a complete listing of AutoscaleSettingResource values. +// AutoscaleSettingResourceCollectionIterator provides access to a complete listing of AutoscaleSettingResource +// values. type AutoscaleSettingResourceCollectionIterator struct { i int page AutoscaleSettingResourceCollectionPage @@ -962,11 +1229,23 @@ func (page AutoscaleSettingResourceCollectionPage) Values() []AutoscaleSettingRe // AutoscaleSettingResourcePatch the autoscale setting object for patch operations. type AutoscaleSettingResourcePatch struct { // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` // AutoscaleSetting - The autoscale setting properties of the update operation. *AutoscaleSetting `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for AutoscaleSettingResourcePatch. +func (asrp AutoscaleSettingResourcePatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asrp.Tags != nil { + objectMap["tags"] = asrp.Tags + } + if asrp.AutoscaleSetting != nil { + objectMap["properties"] = asrp.AutoscaleSetting + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for AutoscaleSettingResourcePatch struct. func (asrp *AutoscaleSettingResourcePatch) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -974,31 +1253,40 @@ func (asrp *AutoscaleSettingResourcePatch) 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 - } - asrp.Tags = &tags - } - - v = m["properties"] - if v != nil { - var properties AutoscaleSetting - 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 + } + asrp.Tags = tags + } + case "properties": + if v != nil { + var autoscaleSetting AutoscaleSetting + err = json.Unmarshal(*v, &autoscaleSetting) + if err != nil { + return err + } + asrp.AutoscaleSetting = &autoscaleSetting + } } - asrp.AutoscaleSetting = &properties } 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. @@ -1023,14 +1311,32 @@ type DiagnosticSettingsCategory struct { // DiagnosticSettingsCategoryResource the diagnostic settings category resource. type DiagnosticSettingsCategoryResource struct { - autorest.Response `json:"-"` + autorest.Response `json:"-"` + *DiagnosticSettingsCategory `json:"properties,omitempty"` // ID - Azure resource Id ID *string `json:"id,omitempty"` // Name - Azure resource name Name *string `json:"name,omitempty"` // Type - Azure resource type - Type *string `json:"type,omitempty"` - *DiagnosticSettingsCategory `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiagnosticSettingsCategoryResource. +func (dscr DiagnosticSettingsCategoryResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dscr.DiagnosticSettingsCategory != nil { + objectMap["properties"] = dscr.DiagnosticSettingsCategory + } + if dscr.ID != nil { + objectMap["id"] = dscr.ID + } + if dscr.Name != nil { + objectMap["name"] = dscr.Name + } + if dscr.Type != nil { + objectMap["type"] = dscr.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for DiagnosticSettingsCategoryResource struct. @@ -1040,46 +1346,45 @@ func (dscr *DiagnosticSettingsCategoryResource) UnmarshalJSON(body []byte) error if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties DiagnosticSettingsCategory - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - dscr.DiagnosticSettingsCategory = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - dscr.ID = &ID - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - dscr.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 diagnosticSettingsCategory DiagnosticSettingsCategory + err = json.Unmarshal(*v, &diagnosticSettingsCategory) + if err != nil { + return err + } + dscr.DiagnosticSettingsCategory = &diagnosticSettingsCategory + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dscr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dscr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dscr.Type = &typeVar + } } - dscr.Type = &typeVar } return nil @@ -1094,14 +1399,32 @@ type DiagnosticSettingsCategoryResourceCollection struct { // DiagnosticSettingsResource the diagnostic setting resource. type DiagnosticSettingsResource struct { - autorest.Response `json:"-"` + autorest.Response `json:"-"` + *DiagnosticSettings `json:"properties,omitempty"` // ID - Azure resource Id ID *string `json:"id,omitempty"` // Name - Azure resource name Name *string `json:"name,omitempty"` // Type - Azure resource type - Type *string `json:"type,omitempty"` - *DiagnosticSettings `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiagnosticSettingsResource. +func (dsr DiagnosticSettingsResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dsr.DiagnosticSettings != nil { + objectMap["properties"] = dsr.DiagnosticSettings + } + if dsr.ID != nil { + objectMap["id"] = dsr.ID + } + if dsr.Name != nil { + objectMap["name"] = dsr.Name + } + if dsr.Type != nil { + objectMap["type"] = dsr.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for DiagnosticSettingsResource struct. @@ -1111,46 +1434,45 @@ func (dsr *DiagnosticSettingsResource) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties DiagnosticSettings - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - dsr.DiagnosticSettings = &properties - } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - dsr.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 diagnosticSettings DiagnosticSettings + err = json.Unmarshal(*v, &diagnosticSettings) + if err != nil { + return err + } + dsr.DiagnosticSettings = &diagnosticSettings + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dsr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dsr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dsr.Type = &typeVar + } } - dsr.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - dsr.Type = &typeVar } return nil @@ -1219,27 +1541,47 @@ 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. - DataSource BasicRuleDataSource `json:"dataSource,omitempty"` - // OdataType - Possible values include: 'OdataTypeRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition' - OdataType OdataTypeBasicRuleCondition `json:"odata.type,omitempty"` // WindowSize - the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. If specified then it must be between 5 minutes and 1 day. WindowSize *string `json:"windowSize,omitempty"` // FailedLocationCount - the number of locations that must fail to activate the alert. FailedLocationCount *int32 `json:"failedLocationCount,omitempty"` + // DataSource - the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource. + DataSource BasicRuleDataSource `json:"dataSource,omitempty"` + // OdataType - Possible values include: 'OdataTypeRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition' + OdataType OdataTypeBasicRuleCondition `json:"odata.type,omitempty"` } // MarshalJSON is the custom marshaler for LocationThresholdRuleCondition. func (ltrc LocationThresholdRuleCondition) MarshalJSON() ([]byte, error) { ltrc.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition - type Alias LocationThresholdRuleCondition - return json.Marshal(&struct { - Alias - }{ - Alias: (Alias)(ltrc), - }) + objectMap := make(map[string]interface{}) + if ltrc.WindowSize != nil { + objectMap["windowSize"] = ltrc.WindowSize + } + if ltrc.FailedLocationCount != nil { + objectMap["failedLocationCount"] = ltrc.FailedLocationCount + } + objectMap["dataSource"] = ltrc.DataSource + if ltrc.OdataType != "" { + objectMap["odata.type"] = ltrc.OdataType + } + return json.Marshal(objectMap) } // AsThresholdRuleCondition is the BasicRuleCondition implementation for LocationThresholdRuleCondition. @@ -1274,45 +1616,44 @@ func (ltrc *LocationThresholdRuleCondition) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["windowSize"] - if v != nil { - var windowSize string - err = json.Unmarshal(*m["windowSize"], &windowSize) - if err != nil { - return err - } - ltrc.WindowSize = &windowSize - } - - v = m["failedLocationCount"] - if v != nil { - var failedLocationCount int32 - err = json.Unmarshal(*m["failedLocationCount"], &failedLocationCount) - if err != nil { - return err - } - ltrc.FailedLocationCount = &failedLocationCount - } - - v = m["dataSource"] - if v != nil { - dataSource, err := unmarshalBasicRuleDataSource(*m["dataSource"]) - if err != nil { - return err - } - ltrc.DataSource = dataSource - } - - v = m["odata.type"] - if v != nil { - var odatatype OdataTypeBasicRuleCondition - err = json.Unmarshal(*m["odata.type"], &odatatype) - if err != nil { - return err + for k, v := range m { + switch k { + case "windowSize": + if v != nil { + var windowSize string + err = json.Unmarshal(*v, &windowSize) + if err != nil { + return err + } + ltrc.WindowSize = &windowSize + } + case "failedLocationCount": + if v != nil { + var failedLocationCount int32 + err = json.Unmarshal(*v, &failedLocationCount) + if err != nil { + return err + } + ltrc.FailedLocationCount = &failedLocationCount + } + case "dataSource": + if v != nil { + dataSource, err := unmarshalBasicRuleDataSource(*v) + if err != nil { + return err + } + ltrc.DataSource = dataSource + } + case "odata.type": + if v != nil { + var odataType OdataTypeBasicRuleCondition + err = json.Unmarshal(*v, &odataType) + if err != nil { + return err + } + ltrc.OdataType = odataType + } } - ltrc.OdataType = odatatype } return nil @@ -1342,6 +1683,8 @@ type LogProfileProperties struct { // LogProfileResource the log profile resource. type LogProfileResource struct { autorest.Response `json:"-"` + // LogProfileProperties - The log profile properties of the resource. + *LogProfileProperties `json:"properties,omitempty"` // ID - Azure resource Id ID *string `json:"id,omitempty"` // Name - Azure resource name @@ -1351,78 +1694,97 @@ type LogProfileResource struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` - // LogProfileProperties - The log profile properties of the resource. - *LogProfileProperties `json:"properties,omitempty"` + Tags map[string]*string `json:"tags"` } -// UnmarshalJSON is the custom unmarshaler for LogProfileResource struct. -func (lpr *LogProfileResource) 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 LogProfileResource. +func (lpr LogProfileResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lpr.LogProfileProperties != nil { + objectMap["properties"] = lpr.LogProfileProperties } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties LogProfileProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - lpr.LogProfileProperties = &properties + if lpr.ID != nil { + objectMap["id"] = lpr.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - lpr.ID = &ID + if lpr.Name != nil { + objectMap["name"] = lpr.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - lpr.Name = &name + if lpr.Type != nil { + objectMap["type"] = lpr.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - lpr.Type = &typeVar + if lpr.Location != nil { + objectMap["location"] = lpr.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - lpr.Location = &location + if lpr.Tags != nil { + objectMap["tags"] = lpr.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 LogProfileResource struct. +func (lpr *LogProfileResource) 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 logProfileProperties LogProfileProperties + err = json.Unmarshal(*v, &logProfileProperties) + if err != nil { + return err + } + lpr.LogProfileProperties = &logProfileProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + lpr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + lpr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + lpr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + lpr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + lpr.Tags = tags + } } - lpr.Tags = &tags } return nil @@ -1431,11 +1793,23 @@ func (lpr *LogProfileResource) UnmarshalJSON(body []byte) error { // LogProfileResourcePatch the log profile resource for patch operations. type LogProfileResourcePatch struct { // Tags - Resource tags - Tags *map[string]*string `json:"tags,omitempty"` + Tags map[string]*string `json:"tags"` // LogProfileProperties - The log profile properties for an update operation. *LogProfileProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for LogProfileResourcePatch. +func (lprp LogProfileResourcePatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lprp.Tags != nil { + objectMap["tags"] = lprp.Tags + } + if lprp.LogProfileProperties != nil { + objectMap["properties"] = lprp.LogProfileProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for LogProfileResourcePatch struct. func (lprp *LogProfileResourcePatch) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -1443,26 +1817,27 @@ func (lprp *LogProfileResourcePatch) 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 - } - lprp.Tags = &tags - } - - v = m["properties"] - if v != nil { - var properties LogProfileProperties - 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 + } + lprp.Tags = tags + } + case "properties": + if v != nil { + var logProfileProperties LogProfileProperties + err = json.Unmarshal(*v, &logProfileProperties) + if err != nil { + return err + } + lprp.LogProfileProperties = &logProfileProperties + } } - lprp.LogProfileProperties = &properties } return nil @@ -1490,23 +1865,26 @@ type ManagementEventAggregationCondition struct { // ManagementEventRuleCondition a management event rule condition. type ManagementEventRuleCondition struct { + // Aggregation - How the data that is collected should be combined over time and when the alert is activated. Note that for management event alerts aggregation is optional – if it is not provided then any event will cause the alert to activate. + Aggregation *ManagementEventAggregationCondition `json:"aggregation,omitempty"` // DataSource - the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource. DataSource BasicRuleDataSource `json:"dataSource,omitempty"` // OdataType - Possible values include: 'OdataTypeRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition' OdataType OdataTypeBasicRuleCondition `json:"odata.type,omitempty"` - // Aggregation - How the data that is collected should be combined over time and when the alert is activated. Note that for management event alerts aggregation is optional – if it is not provided then any event will cause the alert to activate. - Aggregation *ManagementEventAggregationCondition `json:"aggregation,omitempty"` } // MarshalJSON is the custom marshaler for ManagementEventRuleCondition. func (merc ManagementEventRuleCondition) MarshalJSON() ([]byte, error) { merc.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition - type Alias ManagementEventRuleCondition - return json.Marshal(&struct { - Alias - }{ - Alias: (Alias)(merc), - }) + objectMap := make(map[string]interface{}) + if merc.Aggregation != nil { + objectMap["aggregation"] = merc.Aggregation + } + objectMap["dataSource"] = merc.DataSource + if merc.OdataType != "" { + objectMap["odata.type"] = merc.OdataType + } + return json.Marshal(objectMap) } // AsThresholdRuleCondition is the BasicRuleCondition implementation for ManagementEventRuleCondition. @@ -1541,35 +1919,35 @@ func (merc *ManagementEventRuleCondition) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["aggregation"] - if v != nil { - var aggregation ManagementEventAggregationCondition - err = json.Unmarshal(*m["aggregation"], &aggregation) - if err != nil { - return err - } - merc.Aggregation = &aggregation - } - - v = m["dataSource"] - if v != nil { - dataSource, err := unmarshalBasicRuleDataSource(*m["dataSource"]) - if err != nil { - return err - } - merc.DataSource = dataSource - } - - v = m["odata.type"] - if v != nil { - var odatatype OdataTypeBasicRuleCondition - err = json.Unmarshal(*m["odata.type"], &odatatype) - if err != nil { - return err + for k, v := range m { + switch k { + case "aggregation": + if v != nil { + var aggregation ManagementEventAggregationCondition + err = json.Unmarshal(*v, &aggregation) + if err != nil { + return err + } + merc.Aggregation = &aggregation + } + case "dataSource": + if v != nil { + dataSource, err := unmarshalBasicRuleDataSource(*v) + if err != nil { + return err + } + merc.DataSource = dataSource + } + case "odata.type": + if v != nil { + var odataType OdataTypeBasicRuleCondition + err = json.Unmarshal(*v, &odataType) + if err != nil { + return err + } + merc.OdataType = odataType + } } - merc.OdataType = odatatype } return nil @@ -1625,8 +2003,8 @@ type OperationDisplay struct { Operation *string `json:"operation,omitempty"` } -// OperationListResult result of the request to list Microsoft.Insights 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 Microsoft.Insights 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 Microsoft.Insights provider. @@ -1645,8 +2023,8 @@ type ProxyOnlyResource struct { Type *string `json:"type,omitempty"` } -// Recurrence the repeating times at which this profile begins. This element is not used if the FixedDate element is -// used. +// Recurrence the repeating times at which this profile begins. This element is not used if the FixedDate element +// is used. type Recurrence struct { // Frequency - the recurrence frequency. How often the schedule profile should take effect. This value must be Week, meaning each week will have the same set of profiles. Possible values include: 'None', 'Second', 'Minute', 'Hour', 'Day', 'Week', 'Month', 'Year' Frequency RecurrenceFrequency `json:"frequency,omitempty"` @@ -1677,7 +2055,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) } // RetentionPolicy specifies the retention policy for the log. @@ -1696,7 +2095,8 @@ type BasicRuleAction interface { AsRuleAction() (*RuleAction, bool) } -// RuleAction the action that is performed when the alert rule becomes active, and when an alert condition is resolved. +// RuleAction the action that is performed when the alert rule becomes active, and when an alert condition is +// resolved. type RuleAction struct { // OdataType - Possible values include: 'OdataTypeRuleAction', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction' OdataType OdataTypeBasicRuleAction `json:"odata.type,omitempty"` @@ -1746,12 +2146,11 @@ func unmarshalBasicRuleActionArray(body []byte) ([]BasicRuleAction, error) { // MarshalJSON is the custom marshaler for RuleAction. func (ra RuleAction) MarshalJSON() ([]byte, error) { ra.OdataType = OdataTypeRuleAction - type Alias RuleAction - return json.Marshal(&struct { - Alias - }{ - Alias: (Alias)(ra), - }) + objectMap := make(map[string]interface{}) + if ra.OdataType != "" { + objectMap["odata.type"] = ra.OdataType + } + return json.Marshal(objectMap) } // AsRuleEmailAction is the BasicRuleAction implementation for RuleAction. @@ -1838,12 +2237,12 @@ func unmarshalBasicRuleConditionArray(body []byte) ([]BasicRuleCondition, error) // MarshalJSON is the custom marshaler for RuleCondition. func (rc RuleCondition) MarshalJSON() ([]byte, error) { rc.OdataType = OdataTypeRuleCondition - type Alias RuleCondition - return json.Marshal(&struct { - Alias - }{ - Alias: (Alias)(rc), - }) + objectMap := make(map[string]interface{}) + objectMap["dataSource"] = rc.DataSource + if rc.OdataType != "" { + objectMap["odata.type"] = rc.OdataType + } + return json.Marshal(objectMap) } // AsThresholdRuleCondition is the BasicRuleCondition implementation for RuleCondition. @@ -1878,25 +2277,26 @@ func (rc *RuleCondition) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["dataSource"] - if v != nil { - dataSource, err := unmarshalBasicRuleDataSource(*m["dataSource"]) - if err != nil { - return err + for k, v := range m { + switch k { + case "dataSource": + if v != nil { + dataSource, err := unmarshalBasicRuleDataSource(*v) + if err != nil { + return err + } + rc.DataSource = dataSource + } + case "odata.type": + if v != nil { + var odataType OdataTypeBasicRuleCondition + err = json.Unmarshal(*v, &odataType) + if err != nil { + return err + } + rc.OdataType = odataType + } } - rc.DataSource = dataSource - } - - v = m["odata.type"] - if v != nil { - var odatatype OdataTypeBasicRuleCondition - err = json.Unmarshal(*m["odata.type"], &odatatype) - if err != nil { - return err - } - rc.OdataType = odatatype } return nil @@ -1961,12 +2361,14 @@ func unmarshalBasicRuleDataSourceArray(body []byte) ([]BasicRuleDataSource, erro // MarshalJSON is the custom marshaler for RuleDataSource. func (rds RuleDataSource) MarshalJSON() ([]byte, error) { rds.OdataType = OdataTypeRuleDataSource - type Alias RuleDataSource - return json.Marshal(&struct { - Alias - }{ - Alias: (Alias)(rds), - }) + objectMap := make(map[string]interface{}) + if rds.ResourceURI != nil { + objectMap["resourceUri"] = rds.ResourceURI + } + if rds.OdataType != "" { + objectMap["odata.type"] = rds.OdataType + } + return json.Marshal(objectMap) } // AsRuleMetricDataSource is the BasicRuleDataSource implementation for RuleDataSource. @@ -1989,26 +2391,31 @@ func (rds RuleDataSource) AsBasicRuleDataSource() (BasicRuleDataSource, bool) { return &rds, true } -// RuleEmailAction specifies the action to send email when the rule condition is evaluated. The discriminator is always -// RuleEmailAction in this case. +// RuleEmailAction specifies the action to send email when the rule condition is evaluated. The discriminator is +// always RuleEmailAction in this case. type RuleEmailAction struct { - // OdataType - Possible values include: 'OdataTypeRuleAction', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction' - OdataType OdataTypeBasicRuleAction `json:"odata.type,omitempty"` // SendToServiceOwners - Whether the administrators (service and co-administrators) of the service should be notified when the alert is activated. SendToServiceOwners *bool `json:"sendToServiceOwners,omitempty"` // CustomEmails - the list of administrator's custom email addresses to notify of the activation of the alert. CustomEmails *[]string `json:"customEmails,omitempty"` + // OdataType - Possible values include: 'OdataTypeRuleAction', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction' + OdataType OdataTypeBasicRuleAction `json:"odata.type,omitempty"` } // MarshalJSON is the custom marshaler for RuleEmailAction. func (rea RuleEmailAction) MarshalJSON() ([]byte, error) { rea.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction - type Alias RuleEmailAction - return json.Marshal(&struct { - Alias - }{ - Alias: (Alias)(rea), - }) + objectMap := make(map[string]interface{}) + if rea.SendToServiceOwners != nil { + objectMap["sendToServiceOwners"] = rea.SendToServiceOwners + } + if rea.CustomEmails != nil { + objectMap["customEmails"] = rea.CustomEmails + } + if rea.OdataType != "" { + objectMap["odata.type"] = rea.OdataType + } + return json.Marshal(objectMap) } // AsRuleEmailAction is the BasicRuleAction implementation for RuleEmailAction. @@ -2040,10 +2447,6 @@ type RuleManagementEventClaimsDataSource struct { // RuleManagementEventDataSource a rule management event data source. The discriminator fields is always // RuleManagementEventDataSource in this case. type RuleManagementEventDataSource struct { - // ResourceURI - the resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule. - ResourceURI *string `json:"resourceUri,omitempty"` - // OdataType - Possible values include: 'OdataTypeRuleDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource' - OdataType OdataType `json:"odata.type,omitempty"` // EventName - the event name. EventName *string `json:"eventName,omitempty"` // EventSource - the event source. @@ -2062,17 +2465,50 @@ type RuleManagementEventDataSource struct { SubStatus *string `json:"subStatus,omitempty"` // Claims - the claims. Claims *RuleManagementEventClaimsDataSource `json:"claims,omitempty"` + // ResourceURI - the resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule. + ResourceURI *string `json:"resourceUri,omitempty"` + // OdataType - Possible values include: 'OdataTypeRuleDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource' + OdataType OdataType `json:"odata.type,omitempty"` } // MarshalJSON is the custom marshaler for RuleManagementEventDataSource. func (rmeds RuleManagementEventDataSource) MarshalJSON() ([]byte, error) { rmeds.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource - type Alias RuleManagementEventDataSource - return json.Marshal(&struct { - Alias - }{ - Alias: (Alias)(rmeds), - }) + objectMap := make(map[string]interface{}) + if rmeds.EventName != nil { + objectMap["eventName"] = rmeds.EventName + } + if rmeds.EventSource != nil { + objectMap["eventSource"] = rmeds.EventSource + } + if rmeds.Level != nil { + objectMap["level"] = rmeds.Level + } + if rmeds.OperationName != nil { + objectMap["operationName"] = rmeds.OperationName + } + if rmeds.ResourceGroupName != nil { + objectMap["resourceGroupName"] = rmeds.ResourceGroupName + } + if rmeds.ResourceProviderName != nil { + objectMap["resourceProviderName"] = rmeds.ResourceProviderName + } + if rmeds.Status != nil { + objectMap["status"] = rmeds.Status + } + if rmeds.SubStatus != nil { + objectMap["subStatus"] = rmeds.SubStatus + } + if rmeds.Claims != nil { + objectMap["claims"] = rmeds.Claims + } + if rmeds.ResourceURI != nil { + objectMap["resourceUri"] = rmeds.ResourceURI + } + if rmeds.OdataType != "" { + objectMap["odata.type"] = rmeds.OdataType + } + return json.Marshal(objectMap) } // AsRuleMetricDataSource is the BasicRuleDataSource implementation for RuleManagementEventDataSource. @@ -2095,25 +2531,31 @@ func (rmeds RuleManagementEventDataSource) AsBasicRuleDataSource() (BasicRuleDat return &rmeds, true } -// RuleMetricDataSource a rule metric data source. The discriminator value is always RuleMetricDataSource in this case. +// RuleMetricDataSource a rule metric data source. The discriminator value is always RuleMetricDataSource in this +// case. type RuleMetricDataSource struct { + // MetricName - the name of the metric that defines what the rule monitors. + MetricName *string `json:"metricName,omitempty"` // ResourceURI - the resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule. ResourceURI *string `json:"resourceUri,omitempty"` // OdataType - Possible values include: 'OdataTypeRuleDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource' OdataType OdataType `json:"odata.type,omitempty"` - // MetricName - the name of the metric that defines what the rule monitors. - MetricName *string `json:"metricName,omitempty"` } // MarshalJSON is the custom marshaler for RuleMetricDataSource. func (rmds RuleMetricDataSource) MarshalJSON() ([]byte, error) { rmds.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource - type Alias RuleMetricDataSource - return json.Marshal(&struct { - Alias - }{ - Alias: (Alias)(rmds), - }) + objectMap := make(map[string]interface{}) + if rmds.MetricName != nil { + objectMap["metricName"] = rmds.MetricName + } + if rmds.ResourceURI != nil { + objectMap["resourceUri"] = rmds.ResourceURI + } + if rmds.OdataType != "" { + objectMap["odata.type"] = rmds.OdataType + } + return json.Marshal(objectMap) } // AsRuleMetricDataSource is the BasicRuleDataSource implementation for RuleMetricDataSource. @@ -2136,26 +2578,31 @@ func (rmds RuleMetricDataSource) AsBasicRuleDataSource() (BasicRuleDataSource, b return &rmds, true } -// RuleWebhookAction specifies the action to post to service when the rule condition is evaluated. The discriminator is -// always RuleWebhookAction in this case. +// RuleWebhookAction specifies the action to post to service when the rule condition is evaluated. The +// discriminator is always RuleWebhookAction in this case. type RuleWebhookAction struct { - // OdataType - Possible values include: 'OdataTypeRuleAction', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction' - OdataType OdataTypeBasicRuleAction `json:"odata.type,omitempty"` // ServiceURI - the service uri to Post the notification when the alert activates or resolves. ServiceURI *string `json:"serviceUri,omitempty"` // Properties - the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload. - Properties *map[string]*string `json:"properties,omitempty"` + Properties map[string]*string `json:"properties"` + // OdataType - Possible values include: 'OdataTypeRuleAction', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction' + OdataType OdataTypeBasicRuleAction `json:"odata.type,omitempty"` } // MarshalJSON is the custom marshaler for RuleWebhookAction. func (rwa RuleWebhookAction) MarshalJSON() ([]byte, error) { rwa.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction - type Alias RuleWebhookAction - return json.Marshal(&struct { - Alias - }{ - Alias: (Alias)(rwa), - }) + objectMap := make(map[string]interface{}) + if rwa.ServiceURI != nil { + objectMap["serviceUri"] = rwa.ServiceURI + } + if rwa.Properties != nil { + objectMap["properties"] = rwa.Properties + } + if rwa.OdataType != "" { + objectMap["odata.type"] = rwa.OdataType + } + return json.Marshal(objectMap) } // AsRuleEmailAction is the BasicRuleAction implementation for RuleWebhookAction. @@ -2222,10 +2669,6 @@ type SmsReceiver struct { // ThresholdRuleCondition a rule condition based on a metric crossing a threshold. type ThresholdRuleCondition struct { - // DataSource - the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource. - DataSource BasicRuleDataSource `json:"dataSource,omitempty"` - // OdataType - Possible values include: 'OdataTypeRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition' - OdataType OdataTypeBasicRuleCondition `json:"odata.type,omitempty"` // Operator - the operator used to compare the data and the threshold. Possible values include: 'ConditionOperatorGreaterThan', 'ConditionOperatorGreaterThanOrEqual', 'ConditionOperatorLessThan', 'ConditionOperatorLessThanOrEqual' Operator ConditionOperator `json:"operator,omitempty"` // Threshold - the threshold value that activates the alert. @@ -2234,17 +2677,33 @@ type ThresholdRuleCondition struct { WindowSize *string `json:"windowSize,omitempty"` // TimeAggregation - the time aggregation operator. How the data that are collected should be combined over time. The default value is the PrimaryAggregationType of the Metric. Possible values include: 'TimeAggregationOperatorAverage', 'TimeAggregationOperatorMinimum', 'TimeAggregationOperatorMaximum', 'TimeAggregationOperatorTotal', 'TimeAggregationOperatorLast' TimeAggregation TimeAggregationOperator `json:"timeAggregation,omitempty"` + // DataSource - the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource. + DataSource BasicRuleDataSource `json:"dataSource,omitempty"` + // OdataType - Possible values include: 'OdataTypeRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition' + OdataType OdataTypeBasicRuleCondition `json:"odata.type,omitempty"` } // MarshalJSON is the custom marshaler for ThresholdRuleCondition. func (trc ThresholdRuleCondition) MarshalJSON() ([]byte, error) { trc.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition - type Alias ThresholdRuleCondition - return json.Marshal(&struct { - Alias - }{ - Alias: (Alias)(trc), - }) + objectMap := make(map[string]interface{}) + if trc.Operator != "" { + objectMap["operator"] = trc.Operator + } + if trc.Threshold != nil { + objectMap["threshold"] = trc.Threshold + } + if trc.WindowSize != nil { + objectMap["windowSize"] = trc.WindowSize + } + if trc.TimeAggregation != "" { + objectMap["timeAggregation"] = trc.TimeAggregation + } + objectMap["dataSource"] = trc.DataSource + if trc.OdataType != "" { + objectMap["odata.type"] = trc.OdataType + } + return json.Marshal(objectMap) } // AsThresholdRuleCondition is the BasicRuleCondition implementation for ThresholdRuleCondition. @@ -2279,65 +2738,62 @@ func (trc *ThresholdRuleCondition) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["operator"] - if v != nil { - var operator ConditionOperator - err = json.Unmarshal(*m["operator"], &operator) - if err != nil { - return err - } - trc.Operator = operator - } - - v = m["threshold"] - if v != nil { - var threshold float64 - err = json.Unmarshal(*m["threshold"], &threshold) - if err != nil { - return err - } - trc.Threshold = &threshold - } - - v = m["windowSize"] - if v != nil { - var windowSize string - err = json.Unmarshal(*m["windowSize"], &windowSize) - if err != nil { - return err - } - trc.WindowSize = &windowSize - } - - v = m["timeAggregation"] - if v != nil { - var timeAggregation TimeAggregationOperator - err = json.Unmarshal(*m["timeAggregation"], &timeAggregation) - if err != nil { - return err - } - trc.TimeAggregation = timeAggregation - } - - v = m["dataSource"] - if v != nil { - dataSource, err := unmarshalBasicRuleDataSource(*m["dataSource"]) - if err != nil { - return err + for k, v := range m { + switch k { + case "operator": + if v != nil { + var operator ConditionOperator + err = json.Unmarshal(*v, &operator) + if err != nil { + return err + } + trc.Operator = operator + } + case "threshold": + if v != nil { + var threshold float64 + err = json.Unmarshal(*v, &threshold) + if err != nil { + return err + } + trc.Threshold = &threshold + } + case "windowSize": + if v != nil { + var windowSize string + err = json.Unmarshal(*v, &windowSize) + if err != nil { + return err + } + trc.WindowSize = &windowSize + } + case "timeAggregation": + if v != nil { + var timeAggregation TimeAggregationOperator + err = json.Unmarshal(*v, &timeAggregation) + if err != nil { + return err + } + trc.TimeAggregation = timeAggregation + } + case "dataSource": + if v != nil { + dataSource, err := unmarshalBasicRuleDataSource(*v) + if err != nil { + return err + } + trc.DataSource = dataSource + } + case "odata.type": + if v != nil { + var odataType OdataTypeBasicRuleCondition + err = json.Unmarshal(*v, &odataType) + if err != nil { + return err + } + trc.OdataType = odataType + } } - trc.DataSource = dataSource - } - - v = m["odata.type"] - if v != nil { - var odatatype OdataTypeBasicRuleCondition - err = json.Unmarshal(*m["odata.type"], &odatatype) - if err != nil { - return err - } - trc.OdataType = odatatype } return nil @@ -2358,7 +2814,19 @@ type WebhookNotification struct { // ServiceURI - the service address to receive the notification. ServiceURI *string `json:"serviceUri,omitempty"` // Properties - a property bag of settings. This value can be empty. - Properties *map[string]*string `json:"properties,omitempty"` + Properties map[string]*string `json:"properties"` +} + +// MarshalJSON is the custom marshaler for WebhookNotification. +func (wn WebhookNotification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wn.ServiceURI != nil { + objectMap["serviceUri"] = wn.ServiceURI + } + if wn.Properties != nil { + objectMap["properties"] = wn.Properties + } + return json.Marshal(objectMap) } // WebhookReceiver a webhook receiver. 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..022a9d003c1b 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) @@ -85,7 +84,7 @@ func (client CheckNameAvailabilityClient) ExecutePreparer(ctx context.Context, n } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/checkNameAvailability", pathParameters), 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..7840739c6593 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 { @@ -77,7 +76,7 @@ func (client ConfigurationsClient) CreateOrUpdatePreparer(ctx context.Context, r } 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.DBforMySQL/servers/{serverName}/configurations/{configurationName}", pathParameters), @@ -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..52f2fbb2965a 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 { @@ -76,7 +76,7 @@ func (client DatabasesClient) CreateOrUpdatePreparer(ctx context.Context, resour } 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.DBforMySQL/servers/{serverName}/databases/{databaseName}", pathParameters), @@ -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..04bd6a3b6655 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) @@ -89,7 +88,7 @@ func (client FirewallRulesClient) CreateOrUpdatePreparer(ctx context.Context, re } 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.DBforMySQL/servers/{serverName}/firewallRules/{firewallRuleName}", pathParameters), @@ -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..c4196a8ad549 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" ) @@ -38,6 +37,11 @@ const ( CreateModeServerPropertiesForCreate CreateMode = "ServerPropertiesForCreate" ) +// PossibleCreateModeValues returns an array of possible values for the CreateMode const type. +func PossibleCreateModeValues() []CreateMode { + return []CreateMode{CreateModeDefault, CreateModePointInTimeRestore, CreateModeServerPropertiesForCreate} +} + // OperationOrigin enumerates the values for operation origin. type OperationOrigin string @@ -50,6 +54,11 @@ const ( User OperationOrigin = "user" ) +// PossibleOperationOriginValues returns an array of possible values for the OperationOrigin const type. +func PossibleOperationOriginValues() []OperationOrigin { + return []OperationOrigin{NotSpecified, System, User} +} + // ServerState enumerates the values for server state. type ServerState string @@ -62,6 +71,11 @@ const ( Ready ServerState = "Ready" ) +// PossibleServerStateValues returns an array of possible values for the ServerState const type. +func PossibleServerStateValues() []ServerState { + return []ServerState{Disabled, Dropping, Ready} +} + // ServerVersion enumerates the values for server version. type ServerVersion string @@ -72,6 +86,11 @@ const ( FiveFullStopSix ServerVersion = "5.6" ) +// PossibleServerVersionValues returns an array of possible values for the ServerVersion const type. +func PossibleServerVersionValues() []ServerVersion { + return []ServerVersion{FiveFullStopSeven, FiveFullStopSix} +} + // SkuTier enumerates the values for sku tier. type SkuTier string @@ -82,6 +101,11 @@ const ( Standard SkuTier = "Standard" ) +// PossibleSkuTierValues returns an array of possible values for the SkuTier const type. +func PossibleSkuTierValues() []SkuTier { + return []SkuTier{Basic, Standard} +} + // SslEnforcementEnum enumerates the values for ssl enforcement enum. type SslEnforcementEnum string @@ -92,33 +116,40 @@ 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" -) +// PossibleSslEnforcementEnumValues returns an array of possible values for the SslEnforcementEnum const type. +func PossibleSslEnforcementEnumValues() []SslEnforcementEnum { + return []SslEnforcementEnum{SslEnforcementEnumDisabled, SslEnforcementEnumEnabled} +} // 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"` +} + +// MarshalJSON is the custom marshaler for Configuration. +func (c Configuration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.ConfigurationProperties != nil { + objectMap["properties"] = c.ConfigurationProperties + } + if c.ID != nil { + objectMap["id"] = c.ID + } + if c.Name != nil { + objectMap["name"] = c.Name + } + if c.Type != nil { + objectMap["type"] = c.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for Configuration struct. @@ -128,46 +159,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 +239,71 @@ 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"` +} + +// MarshalJSON is the custom marshaler for Database. +func (d Database) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if d.DatabaseProperties != nil { + objectMap["properties"] = d.DatabaseProperties + } + if d.ID != nil { + objectMap["id"] = d.ID + } + if d.Name != nil { + objectMap["name"] = d.Name + } + if d.Type != nil { + objectMap["type"] = d.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for Database struct. @@ -248,46 +313,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 - } - 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 + 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.Type = &typeVar } return nil @@ -308,7 +372,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 +385,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 +433,71 @@ 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"` +} + +// MarshalJSON is the custom marshaler for FirewallRule. +func (fr FirewallRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fr.FirewallRuleProperties != nil { + objectMap["properties"] = fr.FirewallRuleProperties + } + if fr.ID != nil { + objectMap["id"] = fr.ID + } + if fr.Name != nil { + objectMap["name"] = fr.Name + } + if fr.Type != nil { + objectMap["type"] = fr.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for FirewallRule struct. @@ -390,46 +507,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 - } - 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 + 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.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 +579,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 +627,70 @@ 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"` +} + +// MarshalJSON is the custom marshaler for LogFile. +func (lf LogFile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lf.LogFileProperties != nil { + objectMap["properties"] = lf.LogFileProperties + } + if lf.ID != nil { + objectMap["id"] = lf.ID + } + if lf.Name != nil { + objectMap["name"] = lf.Name + } + if lf.Type != nil { + objectMap["type"] = lf.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for LogFile struct. @@ -532,46 +700,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 +795,25 @@ 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 + } + if o.Origin != "" { + 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 +877,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 +1007,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 +1033,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 +1162,20 @@ 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 + } + if spfc.Version != "" { + objectMap["version"] = spfc.Version + } + if spfc.SslEnforcement != "" { + objectMap["sslEnforcement"] = spfc.SslEnforcement + } + if spfc.CreateMode != "" { + objectMap["createMode"] = spfc.CreateMode + } + return json.Marshal(objectMap) } // AsServerPropertiesForDefaultCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForCreate. @@ -969,6 +1200,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 +1212,31 @@ 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 + } + if spfdc.Version != "" { + objectMap["version"] = spfdc.Version + } + if spfdc.SslEnforcement != "" { + objectMap["sslEnforcement"] = spfdc.SslEnforcement + } + if spfdc.CreateMode != "" { + objectMap["createMode"] = spfdc.CreateMode + } + return json.Marshal(objectMap) } // AsServerPropertiesForDefaultCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForDefaultCreate. @@ -1016,6 +1261,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 +1273,31 @@ 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 + } + if spfr.Version != "" { + objectMap["version"] = spfr.Version + } + if spfr.SslEnforcement != "" { + objectMap["sslEnforcement"] = spfr.SslEnforcement + } + if spfr.CreateMode != "" { + objectMap["createMode"] = spfr.CreateMode + } + return json.Marshal(objectMap) } // AsServerPropertiesForDefaultCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForRestore. @@ -1061,7 +1320,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 +1333,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 +1381,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 +1429,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 +1472,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 +1497,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 + 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.Sku = &sku - } - - v = m["properties"] - if v != nil { - var properties ServerUpdateParametersProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - 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 +1560,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 - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - vnr.Type = &typeVar - } - - 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 + if tr.Name != nil { + objectMap["name"] = tr.Name } - err := iter.page.Next() - if err != nil { - iter.i-- - return err + if tr.Type != nil { + objectMap["type"] = tr.Type } - 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..fc22975e6e6d 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) @@ -91,7 +91,7 @@ func (client ServersClient) CreateOrUpdatePreparer(ctx context.Context, resource } 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.DBforMySQL/servers/{serverName}", pathParameters), @@ -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) @@ -427,7 +427,7 @@ func (client ServersClient) UpdatePreparer(ctx context.Context, resourceGroupNam } 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.DBforMySQL/servers/{serverName}", pathParameters), 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..b8e5d3d6a5cb 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) @@ -158,7 +158,7 @@ func (client ApplicationGatewaysClient) CreateOrUpdatePreparer(ctx context.Conte } 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/applicationGateways/{applicationGatewayName}", pathParameters), @@ -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 { @@ -958,7 +962,7 @@ func (client ApplicationGatewaysClient) UpdateTagsPreparer(ctx context.Context, } 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/applicationGateways/{applicationGatewayName}", pathParameters), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/applicationsecuritygroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/applicationsecuritygroups.go index 62e14d1e358e..d363a4dd227d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/applicationsecuritygroups.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/applicationsecuritygroups.go @@ -73,7 +73,7 @@ func (client ApplicationSecurityGroupsClient) CreateOrUpdatePreparer(ctx context } 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/applicationSecurityGroups/{applicationSecurityGroupName}", pathParameters), 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..222ffd7f4c72 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 { @@ -77,7 +77,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdatePreparer(ctx } 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/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}", pathParameters), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/expressroutecircuitpeerings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/expressroutecircuitpeerings.go index 43415eb652fa..991a96093a15 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/expressroutecircuitpeerings.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/expressroutecircuitpeerings.go @@ -75,7 +75,7 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdatePreparer(ctx conte } 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/expressRouteCircuits/{circuitName}/peerings/{peeringName}", pathParameters), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/expressroutecircuits.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/expressroutecircuits.go index 5893b64e9e1d..20c4d7efee14 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/expressroutecircuits.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/expressroutecircuits.go @@ -73,7 +73,7 @@ func (client ExpressRouteCircuitsClient) CreateOrUpdatePreparer(ctx context.Cont } 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/expressRouteCircuits/{circuitName}", pathParameters), @@ -809,7 +809,7 @@ func (client ExpressRouteCircuitsClient) UpdateTagsPreparer(ctx context.Context, } 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/expressRouteCircuits/{circuitName}", pathParameters), 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..638b72c6fcc6 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) @@ -95,7 +95,7 @@ func (client InboundNatRulesClient) CreateOrUpdatePreparer(ctx context.Context, } 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/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}", pathParameters), 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..c0618178f81e 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 @@ -73,7 +73,7 @@ func (client InterfacesClient) CreateOrUpdatePreparer(ctx context.Context, resou } 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/networkInterfaces/{networkInterfaceName}", pathParameters), @@ -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) @@ -1042,7 +1043,7 @@ func (client InterfacesClient) UpdateTagsPreparer(ctx context.Context, resourceG } 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/networkInterfaces/{networkInterfaceName}", pathParameters), 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..c98266dde99c 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 { @@ -73,7 +73,7 @@ func (client LoadBalancersClient) CreateOrUpdatePreparer(ctx context.Context, re } 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/loadBalancers/{loadBalancerName}", pathParameters), @@ -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 { @@ -464,7 +464,7 @@ func (client LoadBalancersClient) UpdateTagsPreparer(ctx context.Context, resour } 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/loadBalancers/{loadBalancerName}", pathParameters), 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..eb7e739d7be0 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) @@ -82,7 +82,7 @@ func (client LocalNetworkGatewaysClient) CreateOrUpdatePreparer(ctx context.Cont } 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/localNetworkGateways/{localNetworkGatewayName}", pathParameters), @@ -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) @@ -399,7 +399,7 @@ func (client LocalNetworkGatewaysClient) UpdateTagsPreparer(ctx context.Context, } 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/localNetworkGateways/{localNetworkGatewayName}", pathParameters), 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..15cf9c6f0335 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,13 @@ const ( Deny Access = "Deny" ) -// ApplicationGatewayBackendHealthServerHealth enumerates the values for application gateway backend health server -// health. +// PossibleAccessValues returns an array of possible values for the Access const type. +func PossibleAccessValues() []Access { + return []Access{Allow, Deny} +} + +// ApplicationGatewayBackendHealthServerHealth enumerates the values for application gateway backend health +// server health. type ApplicationGatewayBackendHealthServerHealth string const ( @@ -53,6 +58,11 @@ const ( Up ApplicationGatewayBackendHealthServerHealth = "Up" ) +// PossibleApplicationGatewayBackendHealthServerHealthValues returns an array of possible values for the ApplicationGatewayBackendHealthServerHealth const type. +func PossibleApplicationGatewayBackendHealthServerHealthValues() []ApplicationGatewayBackendHealthServerHealth { + return []ApplicationGatewayBackendHealthServerHealth{Down, Draining, Partial, Unknown, Up} +} + // ApplicationGatewayCookieBasedAffinity enumerates the values for application gateway cookie based affinity. type ApplicationGatewayCookieBasedAffinity string @@ -63,6 +73,11 @@ const ( Enabled ApplicationGatewayCookieBasedAffinity = "Enabled" ) +// PossibleApplicationGatewayCookieBasedAffinityValues returns an array of possible values for the ApplicationGatewayCookieBasedAffinity const type. +func PossibleApplicationGatewayCookieBasedAffinityValues() []ApplicationGatewayCookieBasedAffinity { + return []ApplicationGatewayCookieBasedAffinity{Disabled, Enabled} +} + // ApplicationGatewayFirewallMode enumerates the values for application gateway firewall mode. type ApplicationGatewayFirewallMode string @@ -73,6 +88,11 @@ const ( Prevention ApplicationGatewayFirewallMode = "Prevention" ) +// PossibleApplicationGatewayFirewallModeValues returns an array of possible values for the ApplicationGatewayFirewallMode const type. +func PossibleApplicationGatewayFirewallModeValues() []ApplicationGatewayFirewallMode { + return []ApplicationGatewayFirewallMode{Detection, Prevention} +} + // ApplicationGatewayOperationalState enumerates the values for application gateway operational state. type ApplicationGatewayOperationalState string @@ -87,6 +107,11 @@ const ( Stopping ApplicationGatewayOperationalState = "Stopping" ) +// PossibleApplicationGatewayOperationalStateValues returns an array of possible values for the ApplicationGatewayOperationalState const type. +func PossibleApplicationGatewayOperationalStateValues() []ApplicationGatewayOperationalState { + return []ApplicationGatewayOperationalState{Running, Starting, Stopped, Stopping} +} + // ApplicationGatewayProtocol enumerates the values for application gateway protocol. type ApplicationGatewayProtocol string @@ -97,6 +122,11 @@ const ( HTTPS ApplicationGatewayProtocol = "Https" ) +// PossibleApplicationGatewayProtocolValues returns an array of possible values for the ApplicationGatewayProtocol const type. +func PossibleApplicationGatewayProtocolValues() []ApplicationGatewayProtocol { + return []ApplicationGatewayProtocol{HTTP, HTTPS} +} + // ApplicationGatewayRedirectType enumerates the values for application gateway redirect type. type ApplicationGatewayRedirectType string @@ -111,7 +141,13 @@ const ( Temporary ApplicationGatewayRedirectType = "Temporary" ) -// ApplicationGatewayRequestRoutingRuleType enumerates the values for application gateway request routing rule type. +// PossibleApplicationGatewayRedirectTypeValues returns an array of possible values for the ApplicationGatewayRedirectType const type. +func PossibleApplicationGatewayRedirectTypeValues() []ApplicationGatewayRedirectType { + return []ApplicationGatewayRedirectType{Found, Permanent, SeeOther, Temporary} +} + +// ApplicationGatewayRequestRoutingRuleType enumerates the values for application gateway request routing rule +// type. type ApplicationGatewayRequestRoutingRuleType string const ( @@ -121,6 +157,11 @@ const ( PathBasedRouting ApplicationGatewayRequestRoutingRuleType = "PathBasedRouting" ) +// PossibleApplicationGatewayRequestRoutingRuleTypeValues returns an array of possible values for the ApplicationGatewayRequestRoutingRuleType const type. +func PossibleApplicationGatewayRequestRoutingRuleTypeValues() []ApplicationGatewayRequestRoutingRuleType { + return []ApplicationGatewayRequestRoutingRuleType{Basic, PathBasedRouting} +} + // ApplicationGatewaySkuName enumerates the values for application gateway sku name. type ApplicationGatewaySkuName string @@ -137,6 +178,11 @@ const ( WAFMedium ApplicationGatewaySkuName = "WAF_Medium" ) +// PossibleApplicationGatewaySkuNameValues returns an array of possible values for the ApplicationGatewaySkuName const type. +func PossibleApplicationGatewaySkuNameValues() []ApplicationGatewaySkuName { + return []ApplicationGatewaySkuName{StandardLarge, StandardMedium, StandardSmall, WAFLarge, WAFMedium} +} + // ApplicationGatewaySslCipherSuite enumerates the values for application gateway ssl cipher suite. type ApplicationGatewaySslCipherSuite string @@ -193,6 +239,11 @@ const ( TLSRSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_GCM_SHA384" ) +// PossibleApplicationGatewaySslCipherSuiteValues returns an array of possible values for the ApplicationGatewaySslCipherSuite const type. +func PossibleApplicationGatewaySslCipherSuiteValues() []ApplicationGatewaySslCipherSuite { + return []ApplicationGatewaySslCipherSuite{TLSDHEDSSWITHAES128CBCSHA, TLSDHEDSSWITHAES128CBCSHA256, TLSDHEDSSWITHAES256CBCSHA, TLSDHEDSSWITHAES256CBCSHA256, TLSDHERSAWITHAES128CBCSHA, TLSDHERSAWITHAES128GCMSHA256, TLSDHERSAWITHAES256CBCSHA, TLSDHERSAWITHAES256GCMSHA384, TLSECDHEECDSAWITHAES128CBCSHA, TLSECDHEECDSAWITHAES128CBCSHA256, TLSECDHEECDSAWITHAES128GCMSHA256, TLSECDHEECDSAWITHAES256CBCSHA, TLSECDHEECDSAWITHAES256CBCSHA384, TLSECDHEECDSAWITHAES256GCMSHA384, TLSECDHERSAWITHAES128CBCSHA, TLSECDHERSAWITHAES128CBCSHA256, TLSECDHERSAWITHAES256CBCSHA, TLSECDHERSAWITHAES256CBCSHA384, TLSRSAWITH3DESEDECBCSHA, TLSRSAWITHAES128CBCSHA, TLSRSAWITHAES128CBCSHA256, TLSRSAWITHAES128GCMSHA256, TLSRSAWITHAES256CBCSHA, TLSRSAWITHAES256CBCSHA256, TLSRSAWITHAES256GCMSHA384} +} + // ApplicationGatewaySslPolicyName enumerates the values for application gateway ssl policy name. type ApplicationGatewaySslPolicyName string @@ -205,6 +256,11 @@ const ( AppGwSslPolicy20170401S ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401S" ) +// PossibleApplicationGatewaySslPolicyNameValues returns an array of possible values for the ApplicationGatewaySslPolicyName const type. +func PossibleApplicationGatewaySslPolicyNameValues() []ApplicationGatewaySslPolicyName { + return []ApplicationGatewaySslPolicyName{AppGwSslPolicy20150501, AppGwSslPolicy20170401, AppGwSslPolicy20170401S} +} + // ApplicationGatewaySslPolicyType enumerates the values for application gateway ssl policy type. type ApplicationGatewaySslPolicyType string @@ -215,6 +271,11 @@ const ( Predefined ApplicationGatewaySslPolicyType = "Predefined" ) +// PossibleApplicationGatewaySslPolicyTypeValues returns an array of possible values for the ApplicationGatewaySslPolicyType const type. +func PossibleApplicationGatewaySslPolicyTypeValues() []ApplicationGatewaySslPolicyType { + return []ApplicationGatewaySslPolicyType{Custom, Predefined} +} + // ApplicationGatewaySslProtocol enumerates the values for application gateway ssl protocol. type ApplicationGatewaySslProtocol string @@ -227,6 +288,11 @@ const ( TLSv12 ApplicationGatewaySslProtocol = "TLSv1_2" ) +// PossibleApplicationGatewaySslProtocolValues returns an array of possible values for the ApplicationGatewaySslProtocol const type. +func PossibleApplicationGatewaySslProtocolValues() []ApplicationGatewaySslProtocol { + return []ApplicationGatewaySslProtocol{TLSv10, TLSv11, TLSv12} +} + // ApplicationGatewayTier enumerates the values for application gateway tier. type ApplicationGatewayTier string @@ -237,6 +303,11 @@ const ( WAF ApplicationGatewayTier = "WAF" ) +// PossibleApplicationGatewayTierValues returns an array of possible values for the ApplicationGatewayTier const type. +func PossibleApplicationGatewayTierValues() []ApplicationGatewayTier { + return []ApplicationGatewayTier{Standard, WAF} +} + // AssociationType enumerates the values for association type. type AssociationType string @@ -247,6 +318,11 @@ const ( Contains AssociationType = "Contains" ) +// PossibleAssociationTypeValues returns an array of possible values for the AssociationType const type. +func PossibleAssociationTypeValues() []AssociationType { + return []AssociationType{Associated, Contains} +} + // AuthenticationMethod enumerates the values for authentication method. type AuthenticationMethod string @@ -257,6 +333,11 @@ const ( EAPTLS AuthenticationMethod = "EAPTLS" ) +// PossibleAuthenticationMethodValues returns an array of possible values for the AuthenticationMethod const type. +func PossibleAuthenticationMethodValues() []AuthenticationMethod { + return []AuthenticationMethod{EAPMSCHAPv2, EAPTLS} +} + // AuthorizationUseStatus enumerates the values for authorization use status. type AuthorizationUseStatus string @@ -267,6 +348,11 @@ const ( InUse AuthorizationUseStatus = "InUse" ) +// PossibleAuthorizationUseStatusValues returns an array of possible values for the AuthorizationUseStatus const type. +func PossibleAuthorizationUseStatusValues() []AuthorizationUseStatus { + return []AuthorizationUseStatus{Available, InUse} +} + // BgpPeerState enumerates the values for bgp peer state. type BgpPeerState string @@ -283,6 +369,11 @@ const ( BgpPeerStateUnknown BgpPeerState = "Unknown" ) +// PossibleBgpPeerStateValues returns an array of possible values for the BgpPeerState const type. +func PossibleBgpPeerStateValues() []BgpPeerState { + return []BgpPeerState{BgpPeerStateConnected, BgpPeerStateConnecting, BgpPeerStateIdle, BgpPeerStateStopped, BgpPeerStateUnknown} +} + // ConnectionStatus enumerates the values for connection status. type ConnectionStatus string @@ -297,6 +388,11 @@ const ( ConnectionStatusUnknown ConnectionStatus = "Unknown" ) +// PossibleConnectionStatusValues returns an array of possible values for the ConnectionStatus const type. +func PossibleConnectionStatusValues() []ConnectionStatus { + return []ConnectionStatus{ConnectionStatusConnected, ConnectionStatusDegraded, ConnectionStatusDisconnected, ConnectionStatusUnknown} +} + // DhGroup enumerates the values for dh group. type DhGroup string @@ -319,6 +415,11 @@ const ( None DhGroup = "None" ) +// PossibleDhGroupValues returns an array of possible values for the DhGroup const type. +func PossibleDhGroupValues() []DhGroup { + return []DhGroup{DHGroup1, DHGroup14, DHGroup2, DHGroup2048, DHGroup24, ECP256, ECP384, None} +} + // Direction enumerates the values for direction. type Direction string @@ -329,6 +430,11 @@ const ( Outbound Direction = "Outbound" ) +// PossibleDirectionValues returns an array of possible values for the Direction const type. +func PossibleDirectionValues() []Direction { + return []Direction{Inbound, Outbound} +} + // EffectiveRouteSource enumerates the values for effective route source. type EffectiveRouteSource string @@ -343,6 +449,11 @@ const ( EffectiveRouteSourceVirtualNetworkGateway EffectiveRouteSource = "VirtualNetworkGateway" ) +// PossibleEffectiveRouteSourceValues returns an array of possible values for the EffectiveRouteSource const type. +func PossibleEffectiveRouteSourceValues() []EffectiveRouteSource { + return []EffectiveRouteSource{EffectiveRouteSourceDefault, EffectiveRouteSourceUnknown, EffectiveRouteSourceUser, EffectiveRouteSourceVirtualNetworkGateway} +} + // EffectiveRouteState enumerates the values for effective route state. type EffectiveRouteState string @@ -353,6 +464,11 @@ const ( Invalid EffectiveRouteState = "Invalid" ) +// PossibleEffectiveRouteStateValues returns an array of possible values for the EffectiveRouteState const type. +func PossibleEffectiveRouteStateValues() []EffectiveRouteState { + return []EffectiveRouteState{Active, Invalid} +} + // EffectiveSecurityRuleProtocol enumerates the values for effective security rule protocol. type EffectiveSecurityRuleProtocol string @@ -365,8 +481,13 @@ const ( UDP EffectiveSecurityRuleProtocol = "Udp" ) -// ExpressRouteCircuitPeeringAdvertisedPublicPrefixState enumerates the values for express route circuit peering -// advertised public prefix state. +// PossibleEffectiveSecurityRuleProtocolValues returns an array of possible values for the EffectiveSecurityRuleProtocol const type. +func PossibleEffectiveSecurityRuleProtocolValues() []EffectiveSecurityRuleProtocol { + return []EffectiveSecurityRuleProtocol{All, TCP, UDP} +} + +// ExpressRouteCircuitPeeringAdvertisedPublicPrefixState enumerates the values for express route circuit +// peering advertised public prefix state. type ExpressRouteCircuitPeeringAdvertisedPublicPrefixState string const ( @@ -380,6 +501,11 @@ const ( ValidationNeeded ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "ValidationNeeded" ) +// PossibleExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValues returns an array of possible values for the ExpressRouteCircuitPeeringAdvertisedPublicPrefixState const type. +func PossibleExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValues() []ExpressRouteCircuitPeeringAdvertisedPublicPrefixState { + return []ExpressRouteCircuitPeeringAdvertisedPublicPrefixState{Configured, Configuring, NotConfigured, ValidationNeeded} +} + // ExpressRouteCircuitPeeringState enumerates the values for express route circuit peering state. type ExpressRouteCircuitPeeringState string @@ -390,6 +516,11 @@ const ( ExpressRouteCircuitPeeringStateEnabled ExpressRouteCircuitPeeringState = "Enabled" ) +// PossibleExpressRouteCircuitPeeringStateValues returns an array of possible values for the ExpressRouteCircuitPeeringState const type. +func PossibleExpressRouteCircuitPeeringStateValues() []ExpressRouteCircuitPeeringState { + return []ExpressRouteCircuitPeeringState{ExpressRouteCircuitPeeringStateDisabled, ExpressRouteCircuitPeeringStateEnabled} +} + // ExpressRouteCircuitPeeringType enumerates the values for express route circuit peering type. type ExpressRouteCircuitPeeringType string @@ -402,6 +533,11 @@ const ( MicrosoftPeering ExpressRouteCircuitPeeringType = "MicrosoftPeering" ) +// PossibleExpressRouteCircuitPeeringTypeValues returns an array of possible values for the ExpressRouteCircuitPeeringType const type. +func PossibleExpressRouteCircuitPeeringTypeValues() []ExpressRouteCircuitPeeringType { + return []ExpressRouteCircuitPeeringType{AzurePrivatePeering, AzurePublicPeering, MicrosoftPeering} +} + // ExpressRouteCircuitSkuFamily enumerates the values for express route circuit sku family. type ExpressRouteCircuitSkuFamily string @@ -412,6 +548,11 @@ const ( UnlimitedData ExpressRouteCircuitSkuFamily = "UnlimitedData" ) +// PossibleExpressRouteCircuitSkuFamilyValues returns an array of possible values for the ExpressRouteCircuitSkuFamily const type. +func PossibleExpressRouteCircuitSkuFamilyValues() []ExpressRouteCircuitSkuFamily { + return []ExpressRouteCircuitSkuFamily{MeteredData, UnlimitedData} +} + // ExpressRouteCircuitSkuTier enumerates the values for express route circuit sku tier. type ExpressRouteCircuitSkuTier string @@ -422,6 +563,11 @@ const ( ExpressRouteCircuitSkuTierStandard ExpressRouteCircuitSkuTier = "Standard" ) +// PossibleExpressRouteCircuitSkuTierValues returns an array of possible values for the ExpressRouteCircuitSkuTier const type. +func PossibleExpressRouteCircuitSkuTierValues() []ExpressRouteCircuitSkuTier { + return []ExpressRouteCircuitSkuTier{ExpressRouteCircuitSkuTierPremium, ExpressRouteCircuitSkuTierStandard} +} + // IkeEncryption enumerates the values for ike encryption. type IkeEncryption string @@ -438,6 +584,11 @@ const ( DES3 IkeEncryption = "DES3" ) +// PossibleIkeEncryptionValues returns an array of possible values for the IkeEncryption const type. +func PossibleIkeEncryptionValues() []IkeEncryption { + return []IkeEncryption{AES128, AES192, AES256, DES, DES3} +} + // IkeIntegrity enumerates the values for ike integrity. type IkeIntegrity string @@ -452,6 +603,11 @@ const ( SHA384 IkeIntegrity = "SHA384" ) +// PossibleIkeIntegrityValues returns an array of possible values for the IkeIntegrity const type. +func PossibleIkeIntegrityValues() []IkeIntegrity { + return []IkeIntegrity{MD5, SHA1, SHA256, SHA384} +} + // IPAllocationMethod enumerates the values for ip allocation method. type IPAllocationMethod string @@ -462,6 +618,11 @@ const ( Static IPAllocationMethod = "Static" ) +// PossibleIPAllocationMethodValues returns an array of possible values for the IPAllocationMethod const type. +func PossibleIPAllocationMethodValues() []IPAllocationMethod { + return []IPAllocationMethod{Dynamic, Static} +} + // IpsecEncryption enumerates the values for ipsec encryption. type IpsecEncryption string @@ -486,6 +647,11 @@ const ( IpsecEncryptionNone IpsecEncryption = "None" ) +// PossibleIpsecEncryptionValues returns an array of possible values for the IpsecEncryption const type. +func PossibleIpsecEncryptionValues() []IpsecEncryption { + return []IpsecEncryption{IpsecEncryptionAES128, IpsecEncryptionAES192, IpsecEncryptionAES256, IpsecEncryptionDES, IpsecEncryptionDES3, IpsecEncryptionGCMAES128, IpsecEncryptionGCMAES192, IpsecEncryptionGCMAES256, IpsecEncryptionNone} +} + // IpsecIntegrity enumerates the values for ipsec integrity. type IpsecIntegrity string @@ -504,6 +670,11 @@ const ( IpsecIntegritySHA256 IpsecIntegrity = "SHA256" ) +// PossibleIpsecIntegrityValues returns an array of possible values for the IpsecIntegrity const type. +func PossibleIpsecIntegrityValues() []IpsecIntegrity { + return []IpsecIntegrity{IpsecIntegrityGCMAES128, IpsecIntegrityGCMAES192, IpsecIntegrityGCMAES256, IpsecIntegrityMD5, IpsecIntegritySHA1, IpsecIntegritySHA256} +} + // IPVersion enumerates the values for ip version. type IPVersion string @@ -514,6 +685,11 @@ const ( IPv6 IPVersion = "IPv6" ) +// PossibleIPVersionValues returns an array of possible values for the IPVersion const type. +func PossibleIPVersionValues() []IPVersion { + return []IPVersion{IPv4, IPv6} +} + // IssueType enumerates the values for issue type. type IssueType string @@ -538,6 +714,11 @@ const ( IssueTypeUserDefinedRoute IssueType = "UserDefinedRoute" ) +// PossibleIssueTypeValues returns an array of possible values for the IssueType const type. +func PossibleIssueTypeValues() []IssueType { + return []IssueType{IssueTypeAgentStopped, IssueTypeDNSResolution, IssueTypeGuestFirewall, IssueTypeNetworkSecurityRule, IssueTypePlatform, IssueTypePortThrottled, IssueTypeSocketBind, IssueTypeUnknown, IssueTypeUserDefinedRoute} +} + // LoadBalancerSkuName enumerates the values for load balancer sku name. type LoadBalancerSkuName string @@ -548,6 +729,11 @@ const ( LoadBalancerSkuNameStandard LoadBalancerSkuName = "Standard" ) +// PossibleLoadBalancerSkuNameValues returns an array of possible values for the LoadBalancerSkuName const type. +func PossibleLoadBalancerSkuNameValues() []LoadBalancerSkuName { + return []LoadBalancerSkuName{LoadBalancerSkuNameBasic, LoadBalancerSkuNameStandard} +} + // LoadDistribution enumerates the values for load distribution. type LoadDistribution string @@ -560,6 +746,11 @@ const ( SourceIPProtocol LoadDistribution = "SourceIPProtocol" ) +// PossibleLoadDistributionValues returns an array of possible values for the LoadDistribution const type. +func PossibleLoadDistributionValues() []LoadDistribution { + return []LoadDistribution{Default, SourceIP, SourceIPProtocol} +} + // NextHopType enumerates the values for next hop type. type NextHopType string @@ -578,6 +769,11 @@ const ( NextHopTypeVnetLocal NextHopType = "VnetLocal" ) +// PossibleNextHopTypeValues returns an array of possible values for the NextHopType const type. +func PossibleNextHopTypeValues() []NextHopType { + return []NextHopType{NextHopTypeHyperNetGateway, NextHopTypeInternet, NextHopTypeNone, NextHopTypeVirtualAppliance, NextHopTypeVirtualNetworkGateway, NextHopTypeVnetLocal} +} + // OperationStatus enumerates the values for operation status. type OperationStatus string @@ -590,6 +786,11 @@ const ( Succeeded OperationStatus = "Succeeded" ) +// PossibleOperationStatusValues returns an array of possible values for the OperationStatus const type. +func PossibleOperationStatusValues() []OperationStatus { + return []OperationStatus{Failed, InProgress, Succeeded} +} + // Origin enumerates the values for origin. type Origin string @@ -602,6 +803,11 @@ const ( OriginOutbound Origin = "Outbound" ) +// PossibleOriginValues returns an array of possible values for the Origin const type. +func PossibleOriginValues() []Origin { + return []Origin{OriginInbound, OriginLocal, OriginOutbound} +} + // PcError enumerates the values for pc error. type PcError string @@ -618,6 +824,11 @@ const ( StorageFailed PcError = "StorageFailed" ) +// PossiblePcErrorValues returns an array of possible values for the PcError const type. +func PossiblePcErrorValues() []PcError { + return []PcError{AgentStopped, CaptureFailed, InternalError, LocalFileFailed, StorageFailed} +} + // PcProtocol enumerates the values for pc protocol. type PcProtocol string @@ -630,6 +841,11 @@ const ( PcProtocolUDP PcProtocol = "UDP" ) +// PossiblePcProtocolValues returns an array of possible values for the PcProtocol const type. +func PossiblePcProtocolValues() []PcProtocol { + return []PcProtocol{PcProtocolAny, PcProtocolTCP, PcProtocolUDP} +} + // PcStatus enumerates the values for pc status. type PcStatus string @@ -646,6 +862,11 @@ const ( PcStatusUnknown PcStatus = "Unknown" ) +// PossiblePcStatusValues returns an array of possible values for the PcStatus const type. +func PossiblePcStatusValues() []PcStatus { + return []PcStatus{PcStatusError, PcStatusNotStarted, PcStatusRunning, PcStatusStopped, PcStatusUnknown} +} + // PfsGroup enumerates the values for pfs group. type PfsGroup string @@ -666,6 +887,11 @@ const ( PfsGroupPFS24 PfsGroup = "PFS24" ) +// PossiblePfsGroupValues returns an array of possible values for the PfsGroup const type. +func PossiblePfsGroupValues() []PfsGroup { + return []PfsGroup{PfsGroupECP256, PfsGroupECP384, PfsGroupNone, PfsGroupPFS1, PfsGroupPFS2, PfsGroupPFS2048, PfsGroupPFS24} +} + // ProbeProtocol enumerates the values for probe protocol. type ProbeProtocol string @@ -676,6 +902,11 @@ const ( ProbeProtocolTCP ProbeProtocol = "Tcp" ) +// PossibleProbeProtocolValues returns an array of possible values for the ProbeProtocol const type. +func PossibleProbeProtocolValues() []ProbeProtocol { + return []ProbeProtocol{ProbeProtocolHTTP, ProbeProtocolTCP} +} + // ProcessorArchitecture enumerates the values for processor architecture. type ProcessorArchitecture string @@ -686,6 +917,11 @@ const ( X86 ProcessorArchitecture = "X86" ) +// PossibleProcessorArchitectureValues returns an array of possible values for the ProcessorArchitecture const type. +func PossibleProcessorArchitectureValues() []ProcessorArchitecture { + return []ProcessorArchitecture{Amd64, X86} +} + // Protocol enumerates the values for protocol. type Protocol string @@ -696,6 +932,11 @@ const ( ProtocolUDP Protocol = "UDP" ) +// PossibleProtocolValues returns an array of possible values for the Protocol const type. +func PossibleProtocolValues() []Protocol { + return []Protocol{ProtocolTCP, ProtocolUDP} +} + // ProvisioningState enumerates the values for provisioning state. type ProvisioningState string @@ -710,6 +951,11 @@ const ( ProvisioningStateUpdating ProvisioningState = "Updating" ) +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateSucceeded, ProvisioningStateUpdating} +} + // PublicIPAddressSkuName enumerates the values for public ip address sku name. type PublicIPAddressSkuName string @@ -720,6 +966,11 @@ const ( PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" ) +// PossiblePublicIPAddressSkuNameValues returns an array of possible values for the PublicIPAddressSkuName const type. +func PossiblePublicIPAddressSkuNameValues() []PublicIPAddressSkuName { + return []PublicIPAddressSkuName{PublicIPAddressSkuNameBasic, PublicIPAddressSkuNameStandard} +} + // RouteNextHopType enumerates the values for route next hop type. type RouteNextHopType string @@ -736,6 +987,11 @@ const ( RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" ) +// PossibleRouteNextHopTypeValues returns an array of possible values for the RouteNextHopType const type. +func PossibleRouteNextHopTypeValues() []RouteNextHopType { + return []RouteNextHopType{RouteNextHopTypeInternet, RouteNextHopTypeNone, RouteNextHopTypeVirtualAppliance, RouteNextHopTypeVirtualNetworkGateway, RouteNextHopTypeVnetLocal} +} + // SecurityRuleAccess enumerates the values for security rule access. type SecurityRuleAccess string @@ -746,6 +1002,11 @@ const ( SecurityRuleAccessDeny SecurityRuleAccess = "Deny" ) +// PossibleSecurityRuleAccessValues returns an array of possible values for the SecurityRuleAccess const type. +func PossibleSecurityRuleAccessValues() []SecurityRuleAccess { + return []SecurityRuleAccess{SecurityRuleAccessAllow, SecurityRuleAccessDeny} +} + // SecurityRuleDirection enumerates the values for security rule direction. type SecurityRuleDirection string @@ -756,6 +1017,11 @@ const ( SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" ) +// PossibleSecurityRuleDirectionValues returns an array of possible values for the SecurityRuleDirection const type. +func PossibleSecurityRuleDirectionValues() []SecurityRuleDirection { + return []SecurityRuleDirection{SecurityRuleDirectionInbound, SecurityRuleDirectionOutbound} +} + // SecurityRuleProtocol enumerates the values for security rule protocol. type SecurityRuleProtocol string @@ -768,6 +1034,11 @@ const ( SecurityRuleProtocolUDP SecurityRuleProtocol = "Udp" ) +// PossibleSecurityRuleProtocolValues returns an array of possible values for the SecurityRuleProtocol const type. +func PossibleSecurityRuleProtocolValues() []SecurityRuleProtocol { + return []SecurityRuleProtocol{SecurityRuleProtocolAsterisk, SecurityRuleProtocolTCP, SecurityRuleProtocolUDP} +} + // ServiceProviderProvisioningState enumerates the values for service provider provisioning state. type ServiceProviderProvisioningState string @@ -782,6 +1053,11 @@ const ( Provisioning ServiceProviderProvisioningState = "Provisioning" ) +// PossibleServiceProviderProvisioningStateValues returns an array of possible values for the ServiceProviderProvisioningState const type. +func PossibleServiceProviderProvisioningStateValues() []ServiceProviderProvisioningState { + return []ServiceProviderProvisioningState{Deprovisioning, NotProvisioned, Provisioned, Provisioning} +} + // Severity enumerates the values for severity. type Severity string @@ -792,6 +1068,11 @@ const ( SeverityWarning Severity = "Warning" ) +// PossibleSeverityValues returns an array of possible values for the Severity const type. +func PossibleSeverityValues() []Severity { + return []Severity{SeverityError, SeverityWarning} +} + // TransportProtocol enumerates the values for transport protocol. type TransportProtocol string @@ -804,6 +1085,11 @@ const ( TransportProtocolUDP TransportProtocol = "Udp" ) +// PossibleTransportProtocolValues returns an array of possible values for the TransportProtocol const type. +func PossibleTransportProtocolValues() []TransportProtocol { + return []TransportProtocol{TransportProtocolAll, TransportProtocolTCP, TransportProtocolUDP} +} + // VirtualNetworkGatewayConnectionStatus enumerates the values for virtual network gateway connection status. type VirtualNetworkGatewayConnectionStatus string @@ -818,6 +1104,11 @@ const ( VirtualNetworkGatewayConnectionStatusUnknown VirtualNetworkGatewayConnectionStatus = "Unknown" ) +// PossibleVirtualNetworkGatewayConnectionStatusValues returns an array of possible values for the VirtualNetworkGatewayConnectionStatus const type. +func PossibleVirtualNetworkGatewayConnectionStatusValues() []VirtualNetworkGatewayConnectionStatus { + return []VirtualNetworkGatewayConnectionStatus{VirtualNetworkGatewayConnectionStatusConnected, VirtualNetworkGatewayConnectionStatusConnecting, VirtualNetworkGatewayConnectionStatusNotConnected, VirtualNetworkGatewayConnectionStatusUnknown} +} + // VirtualNetworkGatewayConnectionType enumerates the values for virtual network gateway connection type. type VirtualNetworkGatewayConnectionType string @@ -832,6 +1123,11 @@ const ( VPNClient VirtualNetworkGatewayConnectionType = "VPNClient" ) +// PossibleVirtualNetworkGatewayConnectionTypeValues returns an array of possible values for the VirtualNetworkGatewayConnectionType const type. +func PossibleVirtualNetworkGatewayConnectionTypeValues() []VirtualNetworkGatewayConnectionType { + return []VirtualNetworkGatewayConnectionType{ExpressRoute, IPsec, Vnet2Vnet, VPNClient} +} + // VirtualNetworkGatewaySkuName enumerates the values for virtual network gateway sku name. type VirtualNetworkGatewaySkuName string @@ -852,6 +1148,11 @@ const ( VirtualNetworkGatewaySkuNameVpnGw3 VirtualNetworkGatewaySkuName = "VpnGw3" ) +// PossibleVirtualNetworkGatewaySkuNameValues returns an array of possible values for the VirtualNetworkGatewaySkuName const type. +func PossibleVirtualNetworkGatewaySkuNameValues() []VirtualNetworkGatewaySkuName { + return []VirtualNetworkGatewaySkuName{VirtualNetworkGatewaySkuNameBasic, VirtualNetworkGatewaySkuNameHighPerformance, VirtualNetworkGatewaySkuNameStandard, VirtualNetworkGatewaySkuNameUltraPerformance, VirtualNetworkGatewaySkuNameVpnGw1, VirtualNetworkGatewaySkuNameVpnGw2, VirtualNetworkGatewaySkuNameVpnGw3} +} + // VirtualNetworkGatewaySkuTier enumerates the values for virtual network gateway sku tier. type VirtualNetworkGatewaySkuTier string @@ -872,6 +1173,11 @@ const ( VirtualNetworkGatewaySkuTierVpnGw3 VirtualNetworkGatewaySkuTier = "VpnGw3" ) +// PossibleVirtualNetworkGatewaySkuTierValues returns an array of possible values for the VirtualNetworkGatewaySkuTier const type. +func PossibleVirtualNetworkGatewaySkuTierValues() []VirtualNetworkGatewaySkuTier { + return []VirtualNetworkGatewaySkuTier{VirtualNetworkGatewaySkuTierBasic, VirtualNetworkGatewaySkuTierHighPerformance, VirtualNetworkGatewaySkuTierStandard, VirtualNetworkGatewaySkuTierUltraPerformance, VirtualNetworkGatewaySkuTierVpnGw1, VirtualNetworkGatewaySkuTierVpnGw2, VirtualNetworkGatewaySkuTierVpnGw3} +} + // VirtualNetworkGatewayType enumerates the values for virtual network gateway type. type VirtualNetworkGatewayType string @@ -882,6 +1188,11 @@ const ( VirtualNetworkGatewayTypeVpn VirtualNetworkGatewayType = "Vpn" ) +// PossibleVirtualNetworkGatewayTypeValues returns an array of possible values for the VirtualNetworkGatewayType const type. +func PossibleVirtualNetworkGatewayTypeValues() []VirtualNetworkGatewayType { + return []VirtualNetworkGatewayType{VirtualNetworkGatewayTypeExpressRoute, VirtualNetworkGatewayTypeVpn} +} + // VirtualNetworkPeeringState enumerates the values for virtual network peering state. type VirtualNetworkPeeringState string @@ -894,6 +1205,11 @@ const ( Initiated VirtualNetworkPeeringState = "Initiated" ) +// PossibleVirtualNetworkPeeringStateValues returns an array of possible values for the VirtualNetworkPeeringState const type. +func PossibleVirtualNetworkPeeringStateValues() []VirtualNetworkPeeringState { + return []VirtualNetworkPeeringState{Connected, Disconnected, Initiated} +} + // VpnClientProtocol enumerates the values for vpn client protocol. type VpnClientProtocol string @@ -904,6 +1220,11 @@ const ( SSTP VpnClientProtocol = "SSTP" ) +// PossibleVpnClientProtocolValues returns an array of possible values for the VpnClientProtocol const type. +func PossibleVpnClientProtocolValues() []VpnClientProtocol { + return []VpnClientProtocol{IkeV2, SSTP} +} + // VpnType enumerates the values for vpn type. type VpnType string @@ -914,7 +1235,13 @@ const ( RouteBased VpnType = "RouteBased" ) -// AddressSpace addressSpace contains an array of IP address ranges that can be used by subnets of the virtual network. +// PossibleVpnTypeValues returns an array of possible values for the VpnType const type. +func PossibleVpnTypeValues() []VpnType { + return []VpnType{PolicyBased, RouteBased} +} + +// 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 +1249,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 +1262,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 +1372,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 +1379,29 @@ 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"` +} + +// MarshalJSON is the custom marshaler for ApplicationGatewayAuthenticationCertificate. +func (agac ApplicationGatewayAuthenticationCertificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agac.ApplicationGatewayAuthenticationCertificatePropertiesFormat != nil { + objectMap["properties"] = agac.ApplicationGatewayAuthenticationCertificatePropertiesFormat + } + if agac.Name != nil { + objectMap["name"] = agac.Name + } + if agac.Etag != nil { + objectMap["etag"] = agac.Etag + } + if agac.Type != nil { + objectMap["type"] = agac.Type + } + if agac.ID != nil { + objectMap["id"] = agac.ID + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ApplicationGatewayAuthenticationCertificate struct. @@ -1040,63 +1411,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 + 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 + } } - agac.ID = &ID } return nil } -// ApplicationGatewayAuthenticationCertificatePropertiesFormat authentication certificates properties of an application -// gateway. +// ApplicationGatewayAuthenticationCertificatePropertiesFormat authentication certificates properties of an +// application gateway. type ApplicationGatewayAuthenticationCertificatePropertiesFormat struct { // Data - Certificate public data. Data *string `json:"data,omitempty"` @@ -1106,7 +1475,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 +1486,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 +1699,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 +1717,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 +1724,29 @@ 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"` +} + +// MarshalJSON is the custom marshaler for ApplicationGatewayBackendAddressPool. +func (agbap ApplicationGatewayBackendAddressPool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat != nil { + objectMap["properties"] = agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat + } + if agbap.Name != nil { + objectMap["name"] = agbap.Name + } + if agbap.Etag != nil { + objectMap["etag"] = agbap.Etag + } + if agbap.Type != nil { + objectMap["type"] = agbap.Type + } + if agbap.ID != nil { + objectMap["id"] = agbap.ID + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ApplicationGatewayBackendAddressPool struct. @@ -1344,62 +1756,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 + 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 + } } - 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 - } + return nil +} - 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. +// 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 +1854,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 +1861,29 @@ 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"` +} + +// MarshalJSON is the custom marshaler for ApplicationGatewayBackendHTTPSettings. +func (agbhs ApplicationGatewayBackendHTTPSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat != nil { + objectMap["properties"] = agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat + } + if agbhs.Name != nil { + objectMap["name"] = agbhs.Name + } + if agbhs.Etag != nil { + objectMap["etag"] = agbhs.Etag + } + if agbhs.Type != nil { + objectMap["type"] = agbhs.Type + } + if agbhs.ID != nil { + objectMap["id"] = agbhs.ID + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ApplicationGatewayBackendHTTPSettings struct. @@ -1461,63 +1893,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 + 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 + } } - 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. +// ApplicationGatewayBackendHTTPSettingsPropertiesFormat properties of Backend address pool settings of an +// application gateway. type ApplicationGatewayBackendHTTPSettingsPropertiesFormat struct { // Port - Port Port *int32 `json:"port,omitempty"` @@ -1547,8 +1977,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 +2014,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 +2024,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 +2134,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 +2141,29 @@ 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"` +} + +// MarshalJSON is the custom marshaler for ApplicationGatewayFrontendIPConfiguration. +func (agfic ApplicationGatewayFrontendIPConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat != nil { + objectMap["properties"] = agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat + } + if agfic.Name != nil { + objectMap["name"] = agfic.Name + } + if agfic.Etag != nil { + objectMap["etag"] = agfic.Etag + } + if agfic.Type != nil { + objectMap["type"] = agfic.Type + } + if agfic.ID != nil { + objectMap["id"] = agfic.ID + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ApplicationGatewayFrontendIPConfiguration struct. @@ -1701,63 +2173,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 + 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 + } } - 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. +// 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 +2243,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 +2250,29 @@ 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"` +} + +// MarshalJSON is the custom marshaler for ApplicationGatewayFrontendPort. +func (agfp ApplicationGatewayFrontendPort) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agfp.ApplicationGatewayFrontendPortPropertiesFormat != nil { + objectMap["properties"] = agfp.ApplicationGatewayFrontendPortPropertiesFormat + } + if agfp.Name != nil { + objectMap["name"] = agfp.Name + } + if agfp.Etag != nil { + objectMap["etag"] = agfp.Etag + } + if agfp.Type != nil { + objectMap["type"] = agfp.Type + } + if agfp.ID != nil { + objectMap["id"] = agfp.ID + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ApplicationGatewayFrontendPort struct. @@ -1791,56 +2282,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 + 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.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 - } - 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 +2345,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 +2352,29 @@ 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"` +} + +// MarshalJSON is the custom marshaler for ApplicationGatewayHTTPListener. +func (aghl ApplicationGatewayHTTPListener) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aghl.ApplicationGatewayHTTPListenerPropertiesFormat != nil { + objectMap["properties"] = aghl.ApplicationGatewayHTTPListenerPropertiesFormat + } + if aghl.Name != nil { + objectMap["name"] = aghl.Name + } + if aghl.Etag != nil { + objectMap["etag"] = aghl.Etag + } + if aghl.Type != nil { + objectMap["type"] = aghl.Type + } + if aghl.ID != nil { + objectMap["id"] = aghl.ID + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ApplicationGatewayHTTPListener struct. @@ -1874,56 +2384,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 + 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.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 - } - 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 +2455,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 +2465,29 @@ 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"` +} + +// MarshalJSON is the custom marshaler for ApplicationGatewayIPConfiguration. +func (agic ApplicationGatewayIPConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agic.ApplicationGatewayIPConfigurationPropertiesFormat != nil { + objectMap["properties"] = agic.ApplicationGatewayIPConfigurationPropertiesFormat + } + if agic.Name != nil { + objectMap["name"] = agic.Name + } + if agic.Etag != nil { + objectMap["etag"] = agic.Etag + } + if agic.Type != nil { + objectMap["type"] = agic.Type + } + if agic.ID != nil { + objectMap["id"] = agic.ID + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ApplicationGatewayIPConfiguration struct. @@ -1968,56 +2497,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 - } - agic.ApplicationGatewayIPConfigurationPropertiesFormat = &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 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.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 +2662,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 +2669,29 @@ 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"` +} + +// MarshalJSON is the custom marshaler for ApplicationGatewayPathRule. +func (agpr ApplicationGatewayPathRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agpr.ApplicationGatewayPathRulePropertiesFormat != nil { + objectMap["properties"] = agpr.ApplicationGatewayPathRulePropertiesFormat + } + if agpr.Name != nil { + objectMap["name"] = agpr.Name + } + if agpr.Etag != nil { + objectMap["etag"] = agpr.Etag + } + if agpr.Type != nil { + objectMap["type"] = agpr.Type + } + if agpr.ID != nil { + objectMap["id"] = agpr.ID + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ApplicationGatewayPathRule struct. @@ -2153,56 +2701,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 - } - 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 + 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.ID = &ID } return nil @@ -2224,8 +2770,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 +2777,29 @@ 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"` +} + +// MarshalJSON is the custom marshaler for ApplicationGatewayProbe. +func (agp ApplicationGatewayProbe) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agp.ApplicationGatewayProbePropertiesFormat != nil { + objectMap["properties"] = agp.ApplicationGatewayProbePropertiesFormat + } + if agp.Name != nil { + objectMap["name"] = agp.Name + } + if agp.Etag != nil { + objectMap["etag"] = agp.Etag + } + if agp.Type != nil { + objectMap["type"] = agp.Type + } + if agp.ID != nil { + objectMap["id"] = agp.ID + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ApplicationGatewayProbe struct. @@ -2242,56 +2809,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 + 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.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 - } - agp.ID = &ID } return nil @@ -2371,8 +2936,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 +2943,29 @@ 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"` +} + +// MarshalJSON is the custom marshaler for ApplicationGatewayRedirectConfiguration. +func (agrc ApplicationGatewayRedirectConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agrc.ApplicationGatewayRedirectConfigurationPropertiesFormat != nil { + objectMap["properties"] = agrc.ApplicationGatewayRedirectConfigurationPropertiesFormat + } + if agrc.Name != nil { + objectMap["name"] = agrc.Name + } + if agrc.Etag != nil { + objectMap["etag"] = agrc.Etag + } + if agrc.Type != nil { + objectMap["type"] = agrc.Type + } + if agrc.ID != nil { + objectMap["id"] = agrc.ID + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ApplicationGatewayRedirectConfiguration struct. @@ -2389,56 +2975,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 + 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.Etag = &etag - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - 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 +3051,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 +3058,29 @@ 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"` +} + +// MarshalJSON is the custom marshaler for ApplicationGatewayRequestRoutingRule. +func (agrrr ApplicationGatewayRequestRoutingRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agrrr.ApplicationGatewayRequestRoutingRulePropertiesFormat != nil { + objectMap["properties"] = agrrr.ApplicationGatewayRequestRoutingRulePropertiesFormat + } + if agrrr.Name != nil { + objectMap["name"] = agrrr.Name + } + if agrrr.Etag != nil { + objectMap["etag"] = agrrr.Etag + } + if agrrr.Type != nil { + objectMap["type"] = agrrr.Type + } + if agrrr.ID != nil { + objectMap["id"] = agrrr.ID + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ApplicationGatewayRequestRoutingRule struct. @@ -2485,62 +3090,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 + 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 + } } - agrrr.ID = &ID } return nil } -// ApplicationGatewayRequestRoutingRulePropertiesFormat properties of request routing rule of the application gateway. +// 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 +3162,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 +3175,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) + 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 +3224,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 +3273,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 +3321,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 +3328,29 @@ 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"` +} + +// MarshalJSON is the custom marshaler for ApplicationGatewaySslCertificate. +func (agsc ApplicationGatewaySslCertificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agsc.ApplicationGatewaySslCertificatePropertiesFormat != nil { + objectMap["properties"] = agsc.ApplicationGatewaySslCertificatePropertiesFormat + } + if agsc.Name != nil { + objectMap["name"] = agsc.Name + } + if agsc.Etag != nil { + objectMap["etag"] = agsc.Etag + } + if agsc.Type != nil { + objectMap["type"] = agsc.Type + } + if agsc.ID != nil { + objectMap["id"] = agsc.ID + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ApplicationGatewaySslCertificate struct. @@ -2684,56 +3360,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 +3442,26 @@ 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"` +} + +// MarshalJSON is the custom marshaler for ApplicationGatewaySslPredefinedPolicy. +func (agspp ApplicationGatewaySslPredefinedPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agspp.Name != nil { + objectMap["name"] = agspp.Name + } + if agspp.ApplicationGatewaySslPredefinedPolicyPropertiesFormat != nil { + objectMap["properties"] = agspp.ApplicationGatewaySslPredefinedPolicyPropertiesFormat + } + if agspp.ID != nil { + objectMap["id"] = agspp.ID + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ApplicationGatewaySslPredefinedPolicy struct. @@ -2782,36 +3471,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 - } - 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 + 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.ID = &ID } return nil @@ -2825,7 +3514,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 +3527,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 +3576,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 +3625,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 +3671,29 @@ 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"` +} + +// MarshalJSON is the custom marshaler for ApplicationGatewayURLPathMap. +func (agupm ApplicationGatewayURLPathMap) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agupm.ApplicationGatewayURLPathMapPropertiesFormat != nil { + objectMap["properties"] = agupm.ApplicationGatewayURLPathMapPropertiesFormat + } + if agupm.Name != nil { + objectMap["name"] = agupm.Name + } + if agupm.Etag != nil { + objectMap["etag"] = agupm.Etag + } + if agupm.Type != nil { + objectMap["type"] = agupm.Type + } + if agupm.ID != nil { + objectMap["id"] = agupm.ID + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ApplicationGatewayURLPathMap struct. @@ -2939,56 +3703,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 +3770,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 +3788,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. @@ -3034,90 +3801,109 @@ type ApplicationSecurityGroup struct { // 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 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 +3918,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 +4033,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 +4082,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 +4128,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 +4289,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 +4355,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for BackendAddressPool. +func (bap BackendAddressPool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if bap.BackendAddressPoolPropertiesFormat != nil { + objectMap["properties"] = bap.BackendAddressPoolPropertiesFormat + } + if bap.Name != nil { + objectMap["name"] = bap.Name + } + if bap.Etag != nil { + objectMap["etag"] = bap.Etag + } + if bap.ID != nil { + objectMap["id"] = bap.ID + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for BackendAddressPool struct. @@ -3549,46 +4390,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 +4491,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 +4501,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 +4802,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 +4835,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 +4934,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 +5063,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 +5077,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 - } - 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 +// 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 } - - 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.ExpressRouteCircuitPropertiesFormat != nil { + objectMap["properties"] = erc.ExpressRouteCircuitPropertiesFormat } - - 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.Etag != nil { + objectMap["etag"] = erc.Etag } - - 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.ID != nil { + objectMap["id"] = erc.ID } - - 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.Name != nil { + objectMap["name"] = erc.Name } - - 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.Type != nil { + objectMap["type"] = erc.Type } - - 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.Location != nil { + objectMap["location"] = erc.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 +5211,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for ExpressRouteCircuitAuthorization. +func (erca ExpressRouteCircuitAuthorization) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if erca.AuthorizationPropertiesFormat != nil { + objectMap["properties"] = erca.AuthorizationPropertiesFormat + } + if erca.Name != nil { + objectMap["name"] = erca.Name + } + if erca.Etag != nil { + objectMap["etag"] = erca.Etag + } + if erca.ID != nil { + objectMap["id"] = erca.ID + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ExpressRouteCircuitAuthorization struct. @@ -4324,53 +5246,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 + 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 + } } - erca.ID = &ID } return nil } -// ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. type ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture struct { azure.Future req *http.Request @@ -4382,22 +5303,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 +5352,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 +5492,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for ExpressRouteCircuitPeering. +func (ercp ExpressRouteCircuitPeering) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ercp.ExpressRouteCircuitPeeringPropertiesFormat != nil { + objectMap["properties"] = ercp.ExpressRouteCircuitPeeringPropertiesFormat + } + if ercp.Name != nil { + objectMap["name"] = ercp.Name + } + if ercp.Etag != nil { + objectMap["etag"] = ercp.Etag + } + if ercp.ID != nil { + objectMap["id"] = ercp.ID + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ExpressRouteCircuitPeering struct. @@ -4554,46 +5527,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 +5587,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 +5742,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 +5791,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 +5888,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 +5901,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 +5950,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 +6006,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 +6019,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 +6068,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 +6117,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 +6199,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 +6247,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 +// 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 } - 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 + if ersp.ID != nil { + objectMap["id"] = ersp.ID } - - 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.Name != nil { + objectMap["name"] = ersp.Name } - - 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.Type != nil { + objectMap["type"] = ersp.Type } - - 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.Location != nil { + objectMap["location"] = ersp.Location } - - 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.Tags != nil { + objectMap["tags"] = ersp.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 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 + } } - ersp.Tags = &tags } return nil } -// ExpressRouteServiceProviderBandwidthsOffered contains bandwidths offered in ExpressRouteServiceProvider resources. +// ExpressRouteServiceProviderBandwidthsOffered contains bandwidths offered in ExpressRouteServiceProvider +// resources. type ExpressRouteServiceProviderBandwidthsOffered struct { // OfferName - The OfferName. OfferName *string `json:"offerName,omitempty"` @@ -5231,8 +6361,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 @@ -5343,6 +6473,18 @@ type FlowLogInformation struct { *FlowLogProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for FlowLogInformation. +func (fli FlowLogInformation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fli.TargetResourceID != nil { + objectMap["targetResourceId"] = fli.TargetResourceID + } + if fli.FlowLogProperties != nil { + objectMap["properties"] = fli.FlowLogProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for FlowLogInformation struct. func (fli *FlowLogInformation) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -5350,26 +6492,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 +6536,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 +6544,29 @@ 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"` +} + +// MarshalJSON is the custom marshaler for FrontendIPConfiguration. +func (fic FrontendIPConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fic.FrontendIPConfigurationPropertiesFormat != nil { + objectMap["properties"] = fic.FrontendIPConfigurationPropertiesFormat + } + if fic.Name != nil { + objectMap["name"] = fic.Name + } + if fic.Etag != nil { + objectMap["etag"] = fic.Etag + } + if fic.Zones != nil { + objectMap["zones"] = fic.Zones + } + if fic.ID != nil { + objectMap["id"] = fic.ID + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for FrontendIPConfiguration struct. @@ -5412,56 +6576,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 +6678,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for InboundNatPool. +func (inp InboundNatPool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if inp.InboundNatPoolPropertiesFormat != nil { + objectMap["properties"] = inp.InboundNatPoolPropertiesFormat + } + if inp.Name != nil { + objectMap["name"] = inp.Name + } + if inp.Etag != nil { + objectMap["etag"] = inp.Etag + } + if inp.ID != nil { + objectMap["id"] = inp.ID + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for InboundNatPool struct. @@ -5532,47 +6712,46 @@ func (inp *InboundNatPool) UnmarshalJSON(body []byte) error { err := json.Unmarshal(body, &m) 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 +6776,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for InboundNatRule. +func (inr InboundNatRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if inr.InboundNatRulePropertiesFormat != nil { + objectMap["properties"] = inr.InboundNatRulePropertiesFormat + } + if inr.Name != nil { + objectMap["name"] = inr.Name + } + if inr.Etag != nil { + objectMap["etag"] = inr.Etag + } + if inr.ID != nil { + objectMap["id"] = inr.ID + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for InboundNatRule struct. @@ -5614,46 +6811,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 +6990,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 +7039,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 +7091,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 +7224,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for InterfaceIPConfiguration. +func (iic InterfaceIPConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if iic.InterfaceIPConfigurationPropertiesFormat != nil { + objectMap["properties"] = iic.InterfaceIPConfigurationPropertiesFormat + } + if iic.Name != nil { + objectMap["name"] = iic.Name + } + if iic.Etag != nil { + objectMap["etag"] = iic.Etag + } + if iic.ID != nil { + objectMap["id"] = iic.ID + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for InterfaceIPConfiguration struct. @@ -5987,46 +7259,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 +7312,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 +7660,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 +7673,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 +7721,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 +7770,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 +7819,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 +7867,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 +7914,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for IPConfiguration. +func (ic IPConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ic.IPConfigurationPropertiesFormat != nil { + objectMap["properties"] = ic.IPConfigurationPropertiesFormat + } + if ic.Name != nil { + objectMap["name"] = ic.Name + } + if ic.Etag != nil { + objectMap["etag"] = ic.Etag + } + if ic.ID != nil { + objectMap["id"] = ic.ID + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for IPConfiguration struct. @@ -6573,46 +7949,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 +8044,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 +8059,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 +8188,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 +8496,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 +8727,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 +8775,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 +8817,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,85 +8830,119 @@ 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. -func (lbr *LoadBalancingRule) 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 LoadBalancingRule. +func (lbr LoadBalancingRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lbr.LoadBalancingRulePropertiesFormat != nil { + objectMap["properties"] = lbr.LoadBalancingRulePropertiesFormat } - 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 + if lbr.Name != nil { + objectMap["name"] = lbr.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - lbr.Name = &name + if lbr.Etag != nil { + objectMap["etag"] = lbr.Etag } - - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - lbr.Etag = &etag + if lbr.ID != nil { + objectMap["id"] = lbr.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 LoadBalancingRule struct. +func (lbr *LoadBalancingRule) 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 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 +8977,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 +8990,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 +9214,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 +9227,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 +9276,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 +9325,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 } @@ -7893,6 +9438,24 @@ type Operation struct { *OperationPropertiesFormat `json:"properties,omitempty"` } +// 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 + } + if o.Origin != nil { + objectMap["origin"] = o.Origin + } + if o.OperationPropertiesFormat != nil { + objectMap["properties"] = o.OperationPropertiesFormat + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for Operation struct. func (o *Operation) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -7900,46 +9463,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 +9638,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for OutboundNatRule. +func (onr OutboundNatRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if onr.OutboundNatRulePropertiesFormat != nil { + objectMap["properties"] = onr.OutboundNatRulePropertiesFormat + } + if onr.Name != nil { + objectMap["name"] = onr.Name + } + if onr.Etag != nil { + objectMap["etag"] = onr.Etag + } + if onr.ID != nil { + objectMap["id"] = onr.ID + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for OutboundNatRule struct. @@ -8093,46 +9673,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 @@ -8155,6 +9734,15 @@ type PacketCapture struct { *PacketCaptureParameters `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for PacketCapture. +func (pc PacketCapture) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pc.PacketCaptureParameters != nil { + objectMap["properties"] = pc.PacketCaptureParameters + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for PacketCapture struct. func (pc *PacketCapture) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -8162,16 +9750,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 @@ -8240,6 +9830,24 @@ type PacketCaptureResult struct { *PacketCaptureResultProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for PacketCaptureResult. +func (pcr PacketCaptureResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pcr.Name != nil { + objectMap["name"] = pcr.Name + } + if pcr.ID != nil { + objectMap["id"] = pcr.ID + } + if pcr.Etag != nil { + objectMap["etag"] = pcr.Etag + } + if pcr.PacketCaptureResultProperties != nil { + objectMap["properties"] = pcr.PacketCaptureResultProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for PacketCaptureResult struct. func (pcr *PacketCaptureResult) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -8247,46 +9855,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 +9901,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 +9913,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 +9927,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 +9975,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 +10024,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 +10072,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 +10120,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 +10128,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 } - - 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 + if prf.ID != nil { + objectMap["id"] = prf.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 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 + } + 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 +10228,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 +10267,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,63 +10323,80 @@ 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. -func (p *Probe) 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 Probe. +func (p Probe) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if p.ProbePropertiesFormat != nil { + objectMap["properties"] = p.ProbePropertiesFormat } - 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 + 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.Etag != nil { + objectMap["etag"] = p.Etag + } + if p.ID != nil { + objectMap["id"] = p.ID } + return json.Marshal(objectMap) +} - v = m["etag"] - if v != nil { - var etag string - err = json.Unmarshal(*m["etag"], &etag) - if err != nil { - return err - } - p.Etag = &etag +// UnmarshalJSON is the custom unmarshaler for Probe struct. +func (p *Probe) 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 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 +10423,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 +10440,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 +10595,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 +10644,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 +10693,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 +10874,58 @@ 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"` +} + +// MarshalJSON is the custom marshaler for ResourceNavigationLink. +func (rnl ResourceNavigationLink) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rnl.ResourceNavigationLinkFormat != nil { + objectMap["properties"] = rnl.ResourceNavigationLinkFormat + } + if rnl.Name != nil { + objectMap["name"] = rnl.Name + } + if rnl.Etag != nil { + objectMap["etag"] = rnl.Etag + } + if rnl.ID != nil { + objectMap["id"] = rnl.ID + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ResourceNavigationLink struct. @@ -9084,46 +10935,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 +11000,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for Route. +func (r Route) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.RoutePropertiesFormat != nil { + objectMap["properties"] = r.RoutePropertiesFormat + } + if r.Name != nil { + objectMap["name"] = r.Name + } + if r.Etag != nil { + objectMap["etag"] = r.Etag + } + if r.ID != nil { + objectMap["id"] = r.ID + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for Route struct. @@ -9167,46 +11035,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 +11081,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 +11094,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 +11316,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 +11325,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 +11550,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 req *http.Request var resp *http.Response - resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), + if future.PollingURL() != "" { + req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) + if err != nil { + return + } + } else { + req = autorest.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 +11599,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 +11648,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 +11697,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 +11745,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 +11793,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 +11955,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 +12003,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 +12055,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 +12288,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 +12336,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 +12385,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 +12437,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 +12683,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 +12731,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 +12780,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 +12832,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for SecurityRule. +func (sr SecurityRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sr.SecurityRulePropertiesFormat != nil { + objectMap["properties"] = sr.SecurityRulePropertiesFormat + } + if sr.Name != nil { + objectMap["name"] = sr.Name + } + if sr.Etag != nil { + objectMap["etag"] = sr.Etag + } + if sr.ID != nil { + objectMap["id"] = sr.ID + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for SecurityRule struct. @@ -10650,46 +12867,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 +12921,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 +13073,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 +13121,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 +13176,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for Subnet. +func (s Subnet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.SubnetPropertiesFormat != nil { + objectMap["properties"] = s.SubnetPropertiesFormat + } + if s.Name != nil { + objectMap["name"] = s.Name + } + if s.Etag != nil { + objectMap["etag"] = s.Etag + } + if s.ID != nil { + objectMap["id"] = s.ID + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for Subnet struct. @@ -10943,46 +13211,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 +13383,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 +13396,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 +13444,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 +13489,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. @@ -11251,6 +13562,18 @@ type TroubleshootingParameters struct { *TroubleshootingProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for TroubleshootingParameters. +func (tp TroubleshootingParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tp.TargetResourceID != nil { + objectMap["targetResourceId"] = tp.TargetResourceID + } + if tp.TroubleshootingProperties != nil { + objectMap["properties"] = tp.TroubleshootingProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for TroubleshootingParameters struct. func (tp *TroubleshootingParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -11258,26 +13581,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 +13810,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 +13823,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 - } - 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 +// 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 } - - 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.Etag != nil { + objectMap["etag"] = vn.Etag } - - 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.ID != nil { + objectMap["id"] = vn.ID } - - 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.Name != nil { + objectMap["name"] = vn.Name } - - 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.Type != nil { + objectMap["type"] = vn.Type } - - 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.Location != nil { + objectMap["location"] = vn.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 +13940,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 +13953,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 +14064,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 +14077,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 +14188,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 +14201,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 +14488,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 +14501,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 +14550,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 +14599,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 +14648,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 +14697,70 @@ 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"` +} + +// MarshalJSON is the custom marshaler for VirtualNetworkGatewayIPConfiguration. +func (vngic VirtualNetworkGatewayIPConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vngic.VirtualNetworkGatewayIPConfigurationPropertiesFormat != nil { + objectMap["properties"] = vngic.VirtualNetworkGatewayIPConfigurationPropertiesFormat + } + if vngic.Name != nil { + objectMap["name"] = vngic.Name + } + if vngic.Etag != nil { + objectMap["etag"] = vngic.Etag + } + if vngic.ID != nil { + objectMap["id"] = vngic.ID + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for VirtualNetworkGatewayIPConfiguration struct. @@ -12251,46 +14770,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 +14826,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 +14895,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 +15072,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 +15121,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 +15170,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 +15219,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 +15268,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) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetAdvertisedRoutesFuture", "Result", resp, "Failure responding to request") + } return } @@ -12712,22 +15317,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 +15366,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 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.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 +15415,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 +15474,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 +15523,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 +15766,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for VirtualNetworkPeering. +func (vnp VirtualNetworkPeering) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vnp.VirtualNetworkPeeringPropertiesFormat != nil { + objectMap["properties"] = vnp.VirtualNetworkPeeringPropertiesFormat + } + if vnp.Name != nil { + objectMap["name"] = vnp.Name + } + if vnp.Etag != nil { + objectMap["etag"] = vnp.Etag + } + if vnp.ID != nil { + objectMap["id"] = vnp.ID + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for VirtualNetworkPeering struct. @@ -13093,53 +15801,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 + 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 + } } - vnp.ID = &ID } return nil } -// VirtualNetworkPeeringListResult response for ListSubnets API service call. Retrieves all subnets that belong to a -// virtual network. +// 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 +15981,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 +16030,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 +16099,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 +16148,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 +16197,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 +16285,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for VpnClientRevokedCertificate. +func (vcrc VpnClientRevokedCertificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vcrc.VpnClientRevokedCertificatePropertiesFormat != nil { + objectMap["properties"] = vcrc.VpnClientRevokedCertificatePropertiesFormat + } + if vcrc.Name != nil { + objectMap["name"] = vcrc.Name + } + if vcrc.Etag != nil { + objectMap["etag"] = vcrc.Etag + } + if vcrc.ID != nil { + objectMap["id"] = vcrc.ID + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for VpnClientRevokedCertificate struct. @@ -13509,46 +16320,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 +16375,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for VpnClientRootCertificate. +func (vcrc VpnClientRootCertificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vcrc.VpnClientRootCertificatePropertiesFormat != nil { + objectMap["properties"] = vcrc.VpnClientRootCertificatePropertiesFormat + } + if vcrc.Name != nil { + objectMap["name"] = vcrc.Name + } + if vcrc.Etag != nil { + objectMap["etag"] = vcrc.Etag + } + if vcrc.ID != nil { + objectMap["id"] = vcrc.ID + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for VpnClientRootCertificate struct. @@ -13582,46 +16410,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 +16475,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 +16487,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 +16620,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 +16668,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 +16717,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 +16766,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 +16814,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 +16863,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 +16912,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 +16961,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 +17010,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 +17059,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 +17107,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..5bcadba85943 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) @@ -85,7 +85,7 @@ func (client PacketCapturesClient) CreatePreparer(ctx context.Context, resourceG } 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/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}", pathParameters), @@ -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..b86e02ead56a 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) @@ -85,7 +85,7 @@ func (client PublicIPAddressesClient) CreateOrUpdatePreparer(ctx context.Context } 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/publicIPAddresses/{publicIpAddressName}", pathParameters), @@ -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) @@ -748,7 +748,7 @@ func (client PublicIPAddressesClient) UpdateTagsPreparer(ctx context.Context, re } 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/publicIPAddresses/{publicIpAddressName}", pathParameters), 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..c065aee2c106 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) @@ -85,7 +85,7 @@ func (client RouteFilterRulesClient) CreateOrUpdatePreparer(ctx context.Context, } 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/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}", pathParameters), @@ -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 { @@ -389,7 +389,7 @@ func (client RouteFilterRulesClient) UpdatePreparer(ctx context.Context, resourc } 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/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}", pathParameters), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/routefilters.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/routefilters.go index 648c4574100e..fbab9c77ef64 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/routefilters.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/routefilters.go @@ -73,7 +73,7 @@ func (client RouteFiltersClient) CreateOrUpdatePreparer(ctx context.Context, res } 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/routeFilters/{routeFilterName}", pathParameters), @@ -464,7 +464,7 @@ func (client RouteFiltersClient) UpdatePreparer(ctx context.Context, resourceGro } 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/routeFilters/{routeFilterName}", pathParameters), 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..15aaf8da4c0a 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 { @@ -74,7 +74,7 @@ func (client RoutesClient) CreateOrUpdatePreparer(ctx context.Context, resourceG } 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/routeTables/{routeTableName}/routes/{routeName}", pathParameters), @@ -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..96f09cc83b87 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 { @@ -73,7 +73,7 @@ func (client RouteTablesClient) CreateOrUpdatePreparer(ctx context.Context, reso } 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/routeTables/{routeTableName}", pathParameters), @@ -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 { @@ -464,7 +464,7 @@ func (client RouteTablesClient) UpdateTagsPreparer(ctx context.Context, resource } 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/routeTables/{routeTableName}", pathParameters), 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..45bd81d8d910 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 { @@ -73,7 +73,7 @@ func (client SecurityGroupsClient) CreateOrUpdatePreparer(ctx context.Context, r } 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/networkSecurityGroups/{networkSecurityGroupName}", pathParameters), @@ -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 { @@ -465,7 +465,7 @@ func (client SecurityGroupsClient) UpdateTagsPreparer(ctx context.Context, resou } 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/networkSecurityGroups/{networkSecurityGroupName}", pathParameters), 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..9b383fa6b263 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 { @@ -75,7 +75,7 @@ func (client SecurityRulesClient) CreateOrUpdatePreparer(ctx context.Context, re } 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/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", pathParameters), @@ -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/subnets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/subnets.go index 4a8b41d3fdf0..aff59d8d54fd 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/subnets.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network/subnets.go @@ -75,7 +75,7 @@ func (client SubnetsClient) CreateOrUpdatePreparer(ctx context.Context, resource } 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/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", pathParameters), 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..c1a9267b83f6 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) @@ -89,7 +89,7 @@ func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdatePreparer(ctx } 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/connections/{virtualNetworkGatewayConnectionName}", pathParameters), @@ -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) @@ -469,7 +469,7 @@ func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKeyPreparer(ctx } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset", pathParameters), @@ -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) @@ -549,7 +549,7 @@ func (client VirtualNetworkGatewayConnectionsClient) SetSharedKeyPreparer(ctx co } 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/connections/{virtualNetworkGatewayConnectionName}/sharedkey", pathParameters), @@ -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 { @@ -620,7 +621,7 @@ func (client VirtualNetworkGatewayConnectionsClient) UpdateTagsPreparer(ctx cont } 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/connections/{virtualNetworkGatewayConnectionName}", pathParameters), 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..1d4f2672b52a 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) @@ -80,7 +80,7 @@ func (client VirtualNetworkGatewaysClient) CreateOrUpdatePreparer(ctx context.Co } 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/virtualNetworkGateways/{virtualNetworkGatewayName}", pathParameters), @@ -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 { @@ -220,7 +221,7 @@ func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackagePreparer(ctx } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage", pathParameters), @@ -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 { @@ -292,7 +294,7 @@ func (client VirtualNetworkGatewaysClient) GenerateVpnProfilePreparer(ctx contex } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile", pathParameters), @@ -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 { @@ -1041,7 +1043,7 @@ func (client VirtualNetworkGatewaysClient) UpdateTagsPreparer(ctx context.Contex } 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/virtualNetworkGateways/{virtualNetworkGatewayName}", pathParameters), @@ -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 { @@ -1119,7 +1121,7 @@ func (client VirtualNetworkGatewaysClient) VpnDeviceConfigurationScriptPreparer( } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/vpndeviceconfigurationscript", pathParameters), 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..1f9badee0b69 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 { @@ -75,7 +75,7 @@ func (client VirtualNetworkPeeringsClient) CreateOrUpdatePreparer(ctx context.Co } 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/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", pathParameters), 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..e98e7155fd59 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 @@ -143,7 +143,7 @@ func (client VirtualNetworksClient) CreateOrUpdatePreparer(ctx context.Context, } 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/virtualNetworks/{virtualNetworkName}", pathParameters), @@ -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 { @@ -628,7 +628,7 @@ func (client VirtualNetworksClient) UpdateTagsPreparer(ctx context.Context, reso } 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/virtualNetworks/{virtualNetworkName}", pathParameters), 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..e09c6dca1052 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) @@ -83,7 +83,7 @@ func (client WatchersClient) CheckConnectivityPreparer(ctx context.Context, reso } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck", pathParameters), @@ -160,7 +160,7 @@ func (client WatchersClient) CreateOrUpdatePreparer(ctx context.Context, resourc } 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/networkWatchers/{networkWatcherName}", pathParameters), @@ -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) @@ -366,7 +366,7 @@ func (client WatchersClient) GetAzureReachabilityReportPreparer(ctx context.Cont } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/azureReachabilityReport", pathParameters), @@ -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) @@ -443,7 +443,7 @@ func (client WatchersClient) GetFlowLogStatusPreparer(ctx context.Context, resou } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus", pathParameters), @@ -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) @@ -522,7 +522,7 @@ func (client WatchersClient) GetNextHopPreparer(ctx context.Context, resourceGro } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop", pathParameters), @@ -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) @@ -605,7 +605,7 @@ func (client WatchersClient) GetTopologyPreparer(ctx context.Context, resourceGr } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology", pathParameters), @@ -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) @@ -678,7 +678,7 @@ func (client WatchersClient) GetTroubleshootingPreparer(ctx context.Context, res } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot", pathParameters), @@ -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) @@ -755,7 +755,7 @@ func (client WatchersClient) GetTroubleshootingResultPreparer(ctx context.Contex } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult", pathParameters), @@ -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) @@ -832,7 +832,7 @@ func (client WatchersClient) GetVMSecurityRulesPreparer(ctx context.Context, res } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView", pathParameters), @@ -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 { @@ -1030,7 +1030,7 @@ func (client WatchersClient) ListAvailableProvidersPreparer(ctx context.Context, } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/availableProvidersList", pathParameters), @@ -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) @@ -1111,7 +1111,7 @@ func (client WatchersClient) SetFlowLogConfigurationPreparer(ctx context.Context } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog", pathParameters), @@ -1188,7 +1188,7 @@ func (client WatchersClient) UpdateTagsPreparer(ctx context.Context, resourceGro } 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/networkWatchers/{networkWatcherName}", pathParameters), @@ -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) @@ -1261,7 +1261,7 @@ func (client WatchersClient) VerifyIPFlowPreparer(ctx context.Context, resourceG } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify", pathParameters), 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..aa4c93cd407d 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) @@ -92,7 +92,7 @@ func (client DataSourcesClient) CreateOrUpdatePreparer(ctx context.Context, reso } 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.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}", pathParameters), @@ -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..b260876d8222 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) @@ -93,7 +93,7 @@ func (client LinkedServicesClient) CreateOrUpdatePreparer(ctx context.Context, r } 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.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}", pathParameters), @@ -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..0b88290b2e9f 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 @@ -62,6 +62,11 @@ const ( WindowsPerformanceCounter DataSourceKind = "WindowsPerformanceCounter" ) +// PossibleDataSourceKindValues returns an array of possible values for the DataSourceKind const type. +func PossibleDataSourceKindValues() []DataSourceKind { + return []DataSourceKind{AzureActivityLog, ChangeTrackingCustomRegistry, ChangeTrackingDefaultPath, ChangeTrackingDefaultRegistry, ChangeTrackingPath, CustomLog, CustomLogCollection, GenericDataSource, IISLogs, LinuxPerformanceCollection, LinuxPerformanceObject, LinuxSyslog, LinuxSyslogCollection, WindowsEvent, WindowsPerformanceCounter} +} + // EntityStatus enumerates the values for entity status. type EntityStatus string @@ -80,15 +85,10 @@ const ( Succeeded EntityStatus = "Succeeded" ) -// SearchSortEnum enumerates the values for search sort enum. -type SearchSortEnum string - -const ( - // Asc ... - Asc SearchSortEnum = "asc" - // Desc ... - Desc SearchSortEnum = "desc" -) +// PossibleEntityStatusValues returns an array of possible values for the EntityStatus const type. +func PossibleEntityStatusValues() []EntityStatus { + return []EntityStatus{Canceled, Creating, Deleting, Failed, ProvisioningAccount, Succeeded} +} // SkuNameEnum enumerates the values for sku name enum. type SkuNameEnum string @@ -108,27 +108,20 @@ 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"` +// PossibleSkuNameEnumValues returns an array of possible values for the SkuNameEnum const type. +func PossibleSkuNameEnumValues() []SkuNameEnum { + return []SkuNameEnum{Free, PerNode, Premium, Standalone, Standard, Unlimited} } // 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 +129,32 @@ 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 + } + if ds.Kind != "" { + 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 +271,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 +287,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 +318,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 - } - ls.LinkedServiceProperties = &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 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.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,36 +384,27 @@ 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. *ManagementGroupProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for ManagementGroup. +func (mg ManagementGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mg.ManagementGroupProperties != nil { + objectMap["properties"] = mg.ManagementGroupProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for ManagementGroup struct. func (mg *ManagementGroup) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -388,16 +412,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 +457,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 +507,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 } -// 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"` +// 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"` } -// 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"` +// 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) } -// 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"` +// 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"` +} + +// 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 +676,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 +689,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 +834,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 +847,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..141a5eddff9e 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) @@ -89,7 +89,7 @@ func (client WorkspacesClient) CreateOrUpdatePreparer(ctx context.Context, resou } 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.OperationalInsights/workspaces/{workspaceName}", pathParameters), @@ -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.AsContentType("application/json; charset=utf-8"), + 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..f998f2b803ff 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) @@ -94,7 +95,7 @@ func (client ManagementAssociationsClient) CreateOrUpdatePreparer(ctx context.Co } 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/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.OperationsManagement/ManagementAssociations/{managementAssociationName}", pathParameters), @@ -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..a12703784566 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) @@ -95,7 +95,7 @@ func (client ManagementConfigurationsClient) CreateOrUpdatePreparer(ctx context. } 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.OperationsManagement/ManagementConfigurations/{managementConfigurationName}", pathParameters), @@ -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..d5ae4a51718f 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) @@ -91,7 +91,7 @@ func (client SolutionsClient) CreateOrUpdatePreparer(ctx context.Context, resour } 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.OperationsManagement/solutions/{solutionName}", pathParameters), @@ -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..970bbb831218 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) @@ -85,7 +85,7 @@ func (client CheckNameAvailabilityClient) ExecutePreparer(ctx context.Context, n } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/checkNameAvailability", pathParameters), 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..91008239bbdc 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 { @@ -77,7 +77,7 @@ func (client ConfigurationsClient) CreateOrUpdatePreparer(ctx context.Context, r } 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.DBforPostgreSQL/servers/{serverName}/configurations/{configurationName}", pathParameters), @@ -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..37933fe3a8c0 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 { @@ -77,7 +76,7 @@ func (client DatabasesClient) CreateOrUpdatePreparer(ctx context.Context, resour } 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.DBforPostgreSQL/servers/{serverName}/databases/{databaseName}", pathParameters), @@ -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..e7a72bee7cbb 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) @@ -89,7 +89,7 @@ func (client FirewallRulesClient) CreateOrUpdatePreparer(ctx context.Context, re } 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.DBforPostgreSQL/servers/{serverName}/firewallRules/{firewallRuleName}", pathParameters), @@ -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..5306cbd160bb 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" ) @@ -38,6 +37,11 @@ const ( CreateModeServerPropertiesForCreate CreateMode = "ServerPropertiesForCreate" ) +// PossibleCreateModeValues returns an array of possible values for the CreateMode const type. +func PossibleCreateModeValues() []CreateMode { + return []CreateMode{CreateModeDefault, CreateModePointInTimeRestore, CreateModeServerPropertiesForCreate} +} + // OperationOrigin enumerates the values for operation origin. type OperationOrigin string @@ -50,6 +54,11 @@ const ( User OperationOrigin = "user" ) +// PossibleOperationOriginValues returns an array of possible values for the OperationOrigin const type. +func PossibleOperationOriginValues() []OperationOrigin { + return []OperationOrigin{NotSpecified, System, User} +} + // ServerState enumerates the values for server state. type ServerState string @@ -62,6 +71,11 @@ const ( Ready ServerState = "Ready" ) +// PossibleServerStateValues returns an array of possible values for the ServerState const type. +func PossibleServerStateValues() []ServerState { + return []ServerState{Disabled, Dropping, Ready} +} + // ServerVersion enumerates the values for server version. type ServerVersion string @@ -72,6 +86,11 @@ const ( NineFullStopSix ServerVersion = "9.6" ) +// PossibleServerVersionValues returns an array of possible values for the ServerVersion const type. +func PossibleServerVersionValues() []ServerVersion { + return []ServerVersion{NineFullStopFive, NineFullStopSix} +} + // SkuTier enumerates the values for sku tier. type SkuTier string @@ -82,6 +101,11 @@ const ( Standard SkuTier = "Standard" ) +// PossibleSkuTierValues returns an array of possible values for the SkuTier const type. +func PossibleSkuTierValues() []SkuTier { + return []SkuTier{Basic, Standard} +} + // SslEnforcementEnum enumerates the values for ssl enforcement enum. type SslEnforcementEnum string @@ -92,33 +116,40 @@ 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" -) +// PossibleSslEnforcementEnumValues returns an array of possible values for the SslEnforcementEnum const type. +func PossibleSslEnforcementEnumValues() []SslEnforcementEnum { + return []SslEnforcementEnum{SslEnforcementEnumDisabled, SslEnforcementEnumEnabled} +} // 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"` +} + +// MarshalJSON is the custom marshaler for Configuration. +func (c Configuration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.ConfigurationProperties != nil { + objectMap["properties"] = c.ConfigurationProperties + } + if c.ID != nil { + objectMap["id"] = c.ID + } + if c.Name != nil { + objectMap["name"] = c.Name + } + if c.Type != nil { + objectMap["type"] = c.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for Configuration struct. @@ -128,46 +159,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 +239,71 @@ 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"` +} + +// MarshalJSON is the custom marshaler for Database. +func (d Database) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if d.DatabaseProperties != nil { + objectMap["properties"] = d.DatabaseProperties + } + if d.ID != nil { + objectMap["id"] = d.ID + } + if d.Name != nil { + objectMap["name"] = d.Name + } + if d.Type != nil { + objectMap["type"] = d.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for Database struct. @@ -248,46 +313,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 - } - 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 + 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.Type = &typeVar } return nil @@ -308,7 +372,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 +385,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 +433,71 @@ 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"` +} + +// MarshalJSON is the custom marshaler for FirewallRule. +func (fr FirewallRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fr.FirewallRuleProperties != nil { + objectMap["properties"] = fr.FirewallRuleProperties + } + if fr.ID != nil { + objectMap["id"] = fr.ID + } + if fr.Name != nil { + objectMap["name"] = fr.Name + } + if fr.Type != nil { + objectMap["type"] = fr.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for FirewallRule struct. @@ -390,46 +507,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 - } - fr.FirewallRuleProperties = &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 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.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 +579,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 +627,70 @@ 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"` +} + +// MarshalJSON is the custom marshaler for LogFile. +func (lf LogFile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lf.LogFileProperties != nil { + objectMap["properties"] = lf.LogFileProperties + } + if lf.ID != nil { + objectMap["id"] = lf.ID + } + if lf.Name != nil { + objectMap["name"] = lf.Name + } + if lf.Type != nil { + objectMap["type"] = lf.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for LogFile struct. @@ -532,46 +700,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 +795,25 @@ 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 + } + if o.Origin != "" { + 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 +877,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 +1007,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 +1033,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 +1162,20 @@ 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 + } + if spfc.Version != "" { + objectMap["version"] = spfc.Version + } + if spfc.SslEnforcement != "" { + objectMap["sslEnforcement"] = spfc.SslEnforcement + } + if spfc.CreateMode != "" { + objectMap["createMode"] = spfc.CreateMode + } + return json.Marshal(objectMap) } // AsServerPropertiesForDefaultCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForCreate. @@ -969,6 +1200,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 +1212,31 @@ 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 + } + if spfdc.Version != "" { + objectMap["version"] = spfdc.Version + } + if spfdc.SslEnforcement != "" { + objectMap["sslEnforcement"] = spfdc.SslEnforcement + } + if spfdc.CreateMode != "" { + objectMap["createMode"] = spfdc.CreateMode + } + return json.Marshal(objectMap) } // AsServerPropertiesForDefaultCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForDefaultCreate. @@ -1016,6 +1261,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 +1273,31 @@ 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 + } + if spfr.Version != "" { + objectMap["version"] = spfr.Version + } + if spfr.SslEnforcement != "" { + objectMap["sslEnforcement"] = spfr.SslEnforcement + } + if spfr.CreateMode != "" { + objectMap["createMode"] = spfr.CreateMode + } + return json.Marshal(objectMap) } // AsServerPropertiesForDefaultCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForRestore. @@ -1073,22 +1332,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 +1380,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 +1428,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 +1471,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 +1496,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 + 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.Sku = &sku - } - - v = m["properties"] - if v != nil { - var properties ServerUpdateParametersProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - 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 +1559,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 - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - vnr.Type = &typeVar - } - - 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 + if tr.Name != nil { + objectMap["name"] = tr.Name } - err := iter.page.Next() - if err != nil { - iter.i-- - return err + if tr.Type != nil { + objectMap["type"] = tr.Type } - 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..f49618a34d72 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) @@ -90,7 +90,7 @@ func (client ServersClient) CreatePreparer(ctx context.Context, resourceGroupNam } 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.DBforPostgreSQL/servers/{serverName}", pathParameters), @@ -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) @@ -426,7 +426,7 @@ func (client ServersClient) UpdatePreparer(ctx context.Context, resourceGroupNam } 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.DBforPostgreSQL/servers/{serverName}", pathParameters), 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/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..67aadb354a5c 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) @@ -90,7 +91,7 @@ func (client FirewallRuleClient) CreateOrUpdatePreparer(ctx context.Context, res } 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.Cache/Redis/{cacheName}/firewallRules/{ruleName}", pathParameters), @@ -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..93b95e33918b 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 @@ -49,6 +49,11 @@ const ( Weekend DayOfWeek = "Weekend" ) +// PossibleDayOfWeekValues returns an array of possible values for the DayOfWeek const type. +func PossibleDayOfWeekValues() []DayOfWeek { + return []DayOfWeek{Everyday, Friday, Monday, Saturday, Sunday, Thursday, Tuesday, Wednesday, Weekend} +} + // KeyType enumerates the values for key type. type KeyType string @@ -59,6 +64,11 @@ const ( Secondary KeyType = "Secondary" ) +// PossibleKeyTypeValues returns an array of possible values for the KeyType const type. +func PossibleKeyTypeValues() []KeyType { + return []KeyType{Primary, Secondary} +} + // RebootType enumerates the values for reboot type. type RebootType string @@ -71,6 +81,11 @@ const ( SecondaryNode RebootType = "SecondaryNode" ) +// PossibleRebootTypeValues returns an array of possible values for the RebootType const type. +func PossibleRebootTypeValues() []RebootType { + return []RebootType{AllNodes, PrimaryNode, SecondaryNode} +} + // SkuFamily enumerates the values for sku family. type SkuFamily string @@ -81,6 +96,11 @@ const ( P SkuFamily = "P" ) +// PossibleSkuFamilyValues returns an array of possible values for the SkuFamily const type. +func PossibleSkuFamilyValues() []SkuFamily { + return []SkuFamily{C, P} +} + // SkuName enumerates the values for sku name. type SkuName string @@ -93,6 +113,11 @@ const ( Standard SkuName = "Standard" ) +// PossibleSkuNameValues returns an array of possible values for the SkuName const type. +func PossibleSkuNameValues() []SkuName { + return []SkuName{Basic, Premium, Standard} +} + // AccessKeys redis cache access keys. type AccessKeys struct { autorest.Response `json:"-"` @@ -102,8 +127,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 +188,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 +286,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 +435,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) @@ -232,6 +449,24 @@ type FirewallRule struct { *FirewallRuleProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for FirewallRule. +func (fr FirewallRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fr.ID != nil { + objectMap["id"] = fr.ID + } + if fr.Name != nil { + objectMap["name"] = fr.Name + } + if fr.Type != nil { + objectMap["type"] = fr.Type + } + if fr.FirewallRuleProperties != nil { + objectMap["properties"] = fr.FirewallRuleProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for FirewallRule struct. func (fr *FirewallRule) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -239,46 +474,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 +635,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 +813,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. @@ -649,6 +931,27 @@ type PatchSchedule struct { *ScheduleEntries `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for PatchSchedule. +func (ps PatchSchedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ps.ID != nil { + objectMap["id"] = ps.ID + } + if ps.Name != nil { + objectMap["name"] = ps.Name + } + if ps.Type != nil { + objectMap["type"] = ps.Type + } + if ps.Location != nil { + objectMap["location"] = ps.Location + } + if ps.ScheduleEntries != nil { + objectMap["properties"] = ps.ScheduleEntries + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for PatchSchedule struct. func (ps *PatchSchedule) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -656,56 +959,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 + 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.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 - } - ps.ScheduleEntries = &properties } return nil @@ -714,11 +1015,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 +1028,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 - } - if !done { - return rt, autorest.NewError("redis.RedisCreateFuture", "Result", "asynchronous operation has not completed") - } - if future.PollingMethod() == azure.PollingLocation { - rt, err = client.CreateResponder(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 - } - 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 +// 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 ar, autorest.NewError("redis.RedisDeleteFuture", "Result", "asynchronous operation has not completed") + if p.EnableNonSslPort != nil { + objectMap["enableNonSslPort"] = p.EnableNonSslPort } - if future.PollingMethod() == azure.PollingLocation { - ar, err = client.DeleteResponder(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 + if p.ShardCount != nil { + objectMap["shardCount"] = p.ShardCount } - 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 p.SubnetID != nil { + objectMap["subnetId"] = p.SubnetID } - if !done { - return ar, autorest.NewError("redis.RedisExportDataFuture", "Result", "asynchronous operation has not completed") + if p.StaticIP != nil { + objectMap["staticIP"] = p.StaticIP } - 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 +1077,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 +1117,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 +1190,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 +1317,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 +1339,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 +1367,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..ad1c62779dd9 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) @@ -87,7 +87,7 @@ func (client PatchSchedulesClient) CreateOrUpdatePreparer(ctx context.Context, r } 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.Cache/Redis/{name}/patchSchedules/default", pathParameters), 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..a4f61075d05d 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) @@ -83,7 +83,7 @@ func (client Client) CreatePreparer(ctx context.Context, resourceGroupName strin } 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.Cache/Redis/{name}", pathParameters), @@ -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) @@ -228,7 +228,7 @@ func (client Client) ExportDataPreparer(ctx context.Context, resourceGroupName s } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/export", pathParameters), @@ -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 { @@ -305,7 +305,7 @@ func (client Client) ForceRebootPreparer(ctx context.Context, resourceGroupName } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/forceReboot", pathParameters), @@ -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) @@ -440,7 +440,7 @@ func (client Client) ImportDataPreparer(ctx context.Context, resourceGroupName s } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/import", pathParameters), @@ -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 { @@ -765,7 +765,7 @@ func (client Client) RegenerateKeyPreparer(ctx context.Context, resourceGroupNam } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/regenerateKey", pathParameters), @@ -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 { @@ -834,7 +834,7 @@ func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName strin } 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.Cache/Redis/{name}", pathParameters), 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/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-06-01/subscriptions/models.go index d859119740c0..d7a3c9373424 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-06-01/subscriptions/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-06-01/subscriptions/models.go @@ -35,6 +35,11 @@ const ( On SpendingLimit = "On" ) +// PossibleSpendingLimitValues returns an array of possible values for the SpendingLimit const type. +func PossibleSpendingLimitValues() []SpendingLimit { + return []SpendingLimit{CurrentPeriodOff, Off, On} +} + // State enumerates the values for state. type State string @@ -51,6 +56,11 @@ const ( Warned State = "Warned" ) +// PossibleStateValues returns an array of possible values for the State const type. +func PossibleStateValues() []State { + return []State{Deleted, Disabled, Enabled, PastDue, Warned} +} + // ListResult subscription list operation response. type ListResult struct { autorest.Response `json:"-"` 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..f5253b4c72b7 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) @@ -95,7 +95,7 @@ func (client ManagementLocksClient) CreateOrUpdateAtResourceGroupLevelPreparer(c } 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.Authorization/locks/{lockName}", pathParameters), @@ -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) @@ -183,7 +183,7 @@ func (client ManagementLocksClient) CreateOrUpdateAtResourceLevelPreparer(ctx co } 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/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}", pathParameters), @@ -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) @@ -260,7 +260,7 @@ func (client ManagementLocksClient) CreateOrUpdateAtSubscriptionLevelPreparer(ct } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}", pathParameters), @@ -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) @@ -336,7 +337,7 @@ func (client ManagementLocksClient) CreateOrUpdateByScopePreparer(ctx context.Co } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/{scope}/providers/Microsoft.Authorization/locks/{lockName}", pathParameters), @@ -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..776ebe1af6ac 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 @@ -36,6 +36,11 @@ const ( ReadOnly LockLevel = "ReadOnly" ) +// PossibleLockLevelValues returns an array of possible values for the LockLevel const type. +func PossibleLockLevelValues() []LockLevel { + return []LockLevel{CanNotDelete, NotSpecified, ReadOnly} +} + // ManagementLockListResult the list of locks. type ManagementLockListResult struct { autorest.Response `json:"-"` @@ -151,6 +156,24 @@ type ManagementLockObject struct { Name *string `json:"name,omitempty"` } +// MarshalJSON is the custom marshaler for ManagementLockObject. +func (mlo ManagementLockObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mlo.ManagementLockProperties != nil { + objectMap["properties"] = mlo.ManagementLockProperties + } + if mlo.ID != nil { + objectMap["id"] = mlo.ID + } + if mlo.Type != nil { + objectMap["type"] = mlo.Type + } + if mlo.Name != nil { + objectMap["name"] = mlo.Name + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for ManagementLockObject struct. func (mlo *ManagementLockObject) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -158,46 +181,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 - } - 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 + 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.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/2016-12-01/policy/assignments.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-12-01/policy/assignments.go index 807ba2b0bdf0..379c11663deb 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-12-01/policy/assignments.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-12-01/policy/assignments.go @@ -44,8 +44,8 @@ func NewAssignmentsClientWithBaseURI(baseURI string, subscriptionID string) Assi // Create policy assignments are inherited by child resources. For example, when you apply a policy to a resource group // that policy is assigned to all resources in the group. // -// scope is the scope of the policy assignment. policyAssignmentName is the name of the policy assignment. parameters -// is parameters for the policy assignment. +// scope is the scope of the policy assignment. policyAssignmentName is the name of the policy assignment. +// parameters is parameters for the policy assignment. func (client AssignmentsClient) Create(ctx context.Context, scope string, policyAssignmentName string, parameters Assignment) (result Assignment, err error) { req, err := client.CreatePreparer(ctx, scope, policyAssignmentName, parameters) if err != nil { @@ -81,7 +81,7 @@ func (client AssignmentsClient) CreatePreparer(ctx context.Context, scope string } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}", pathParameters), @@ -118,8 +118,8 @@ func (client AssignmentsClient) CreateResponder(resp *http.Response) (result Ass // for resources. // // policyAssignmentID is the ID of the policy assignment to create. Use the format -// '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. parameters is parameters -// for policy assignment. +// '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'. parameters is +// parameters for policy assignment. func (client AssignmentsClient) CreateByID(ctx context.Context, policyAssignmentID string, parameters Assignment) (result Assignment, err error) { req, err := client.CreateByIDPreparer(ctx, policyAssignmentID, parameters) if err != nil { @@ -154,7 +154,7 @@ func (client AssignmentsClient) CreateByIDPreparer(ctx context.Context, policyAs } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/{policyAssignmentId}", pathParameters), @@ -185,7 +185,8 @@ func (client AssignmentsClient) CreateByIDResponder(resp *http.Response) (result // Delete deletes a policy assignment. // -// scope is the scope of the policy assignment. policyAssignmentName is the name of the policy assignment to delete. +// scope is the scope of the policy assignment. policyAssignmentName is the name of the policy assignment to +// delete. func (client AssignmentsClient) Delete(ctx context.Context, scope string, policyAssignmentName string) (result Assignment, err error) { req, err := client.DeletePreparer(ctx, scope, policyAssignmentName) if err != nil { @@ -547,16 +548,16 @@ func (client AssignmentsClient) ListComplete(ctx context.Context, filter string) // ListForResource gets policy assignments for a resource. // // resourceGroupName is the name of the resource group containing the resource. The name is case insensitive. -// resourceProviderNamespace is the namespace of the resource provider. parentResourcePath is the parent resource path. -// resourceType is the resource type. resourceName is the name of the resource with policy assignments. filter is the -// filter to apply on the operation. +// resourceProviderNamespace is the namespace of the resource provider. parentResourcePath is the parent resource +// path. resourceType is the resource type. resourceName is the name of the resource with policy assignments. +// filter is the filter to apply on the operation. func (client AssignmentsClient) ListForResource(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, filter string) (result AssignmentListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "policy.AssignmentsClient", "ListForResource") + return result, validation.NewError("policy.AssignmentsClient", "ListForResource", err.Error()) } result.fn = client.listForResourceNextResults @@ -657,15 +658,15 @@ func (client AssignmentsClient) ListForResourceComplete(ctx context.Context, res // ListForResourceGroup gets policy assignments for the resource group. // -// resourceGroupName is the name of the resource group that contains policy assignments. filter is the filter to apply -// on the operation. +// resourceGroupName is the name of the resource group that contains policy assignments. filter is the filter to +// apply on the operation. func (client AssignmentsClient) ListForResourceGroup(ctx context.Context, resourceGroupName string, filter string) (result AssignmentListResultPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "policy.AssignmentsClient", "ListForResourceGroup") + return result, validation.NewError("policy.AssignmentsClient", "ListForResourceGroup", err.Error()) } result.fn = client.listForResourceGroupNextResults diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-12-01/policy/definitions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-12-01/policy/definitions.go index 6f362d187996..ee27acc17a0a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-12-01/policy/definitions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-12-01/policy/definitions.go @@ -42,7 +42,8 @@ func NewDefinitionsClientWithBaseURI(baseURI string, subscriptionID string) Defi // CreateOrUpdate creates or updates a policy definition. // -// policyDefinitionName is the name of the policy definition to create. parameters is the policy definition properties. +// policyDefinitionName is the name of the policy definition to create. parameters is the policy definition +// properties. func (client DefinitionsClient) CreateOrUpdate(ctx context.Context, policyDefinitionName string, parameters Definition) (result Definition, err error) { req, err := client.CreateOrUpdatePreparer(ctx, policyDefinitionName, parameters) if err != nil { @@ -78,7 +79,7 @@ func (client DefinitionsClient) CreateOrUpdatePreparer(ctx context.Context, poli } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", pathParameters), @@ -109,8 +110,8 @@ func (client DefinitionsClient) CreateOrUpdateResponder(resp *http.Response) (re // CreateOrUpdateAtManagementGroup creates or updates a policy definition at management group level. // -// policyDefinitionName is the name of the policy definition to create. parameters is the policy definition properties. -// managementGroupID is the ID of the management group. +// policyDefinitionName is the name of the policy definition to create. parameters is the policy definition +// properties. managementGroupID is the ID of the management group. func (client DefinitionsClient) CreateOrUpdateAtManagementGroup(ctx context.Context, policyDefinitionName string, parameters Definition, managementGroupID string) (result Definition, err error) { req, err := client.CreateOrUpdateAtManagementGroupPreparer(ctx, policyDefinitionName, parameters, managementGroupID) if err != nil { @@ -146,7 +147,7 @@ func (client DefinitionsClient) CreateOrUpdateAtManagementGroupPreparer(ctx cont } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", pathParameters), @@ -241,8 +242,8 @@ func (client DefinitionsClient) DeleteResponder(resp *http.Response) (result aut // DeleteAtManagementGroup deletes a policy definition at management group level. // -// policyDefinitionName is the name of the policy definition to delete. managementGroupID is the ID of the management -// group. +// policyDefinitionName is the name of the policy definition to delete. managementGroupID is the ID of the +// management group. func (client DefinitionsClient) DeleteAtManagementGroup(ctx context.Context, policyDefinitionName string, managementGroupID string) (result autorest.Response, err error) { req, err := client.DeleteAtManagementGroupPreparer(ctx, policyDefinitionName, managementGroupID) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-12-01/policy/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-12-01/policy/models.go index 38b2d8900207..a20a55c077f1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-12-01/policy/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-12-01/policy/models.go @@ -36,6 +36,11 @@ const ( NotSpecified Mode = "NotSpecified" ) +// PossibleModeValues returns an array of possible values for the Mode const type. +func PossibleModeValues() []Mode { + return []Mode{All, Indexed, NotSpecified} +} + // Type enumerates the values for type. type Type string @@ -48,6 +53,11 @@ const ( TypeNotSpecified Type = "NotSpecified" ) +// PossibleTypeValues returns an array of possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{TypeBuiltIn, TypeCustom, TypeNotSpecified} +} + // Assignment the policy assignment. type Assignment struct { autorest.Response `json:"-"` @@ -61,6 +71,24 @@ type Assignment struct { Name *string `json:"name,omitempty"` } +// MarshalJSON is the custom marshaler for Assignment. +func (a Assignment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.AssignmentProperties != nil { + objectMap["properties"] = a.AssignmentProperties + } + if a.ID != nil { + objectMap["id"] = a.ID + } + if a.Type != nil { + objectMap["type"] = a.Type + } + if a.Name != nil { + objectMap["name"] = a.Name + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for Assignment struct. func (a *Assignment) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -68,46 +96,45 @@ func (a *Assignment) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties AssignmentProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - a.AssignmentProperties = &properties - } - - 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["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - a.Type = &typeVar - } - - 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 assignmentProperties AssignmentProperties + err = json.Unmarshal(*v, &assignmentProperties) + if err != nil { + return err + } + a.AssignmentProperties = &assignmentProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + a.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + a.Type = &typeVar + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + a.Name = &name + } } - a.Name = &name } return nil @@ -224,7 +251,7 @@ type AssignmentProperties struct { // Scope - The scope for the policy assignment. Scope *string `json:"scope,omitempty"` // Parameters - Required if a parameter is used in policy rule. - Parameters *map[string]interface{} `json:"parameters,omitempty"` + Parameters interface{} `json:"parameters,omitempty"` // Description - This message will be part of response in case of policy violation. Description *string `json:"description,omitempty"` } @@ -240,6 +267,21 @@ type Definition struct { Name *string `json:"name,omitempty"` } +// MarshalJSON is the custom marshaler for Definition. +func (d Definition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if d.DefinitionProperties != nil { + objectMap["properties"] = d.DefinitionProperties + } + if d.ID != nil { + objectMap["id"] = d.ID + } + if d.Name != nil { + objectMap["name"] = d.Name + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for Definition struct. func (d *Definition) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -247,36 +289,36 @@ func (d *Definition) UnmarshalJSON(body []byte) error { if err != nil { return err } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties DefinitionProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - d.DefinitionProperties = &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 + for k, v := range m { + switch k { + case "properties": + if v != nil { + var definitionProperties DefinitionProperties + err = json.Unmarshal(*v, &definitionProperties) + if err != nil { + return err + } + d.DefinitionProperties = &definitionProperties + } + 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 + } } - d.Name = &name } return nil @@ -395,9 +437,9 @@ type DefinitionProperties struct { // Description - The policy definition description. Description *string `json:"description,omitempty"` // PolicyRule - The policy rule. - PolicyRule *map[string]interface{} `json:"policyRule,omitempty"` + PolicyRule interface{} `json:"policyRule,omitempty"` // Metadata - The policy definition metadata. - Metadata *map[string]interface{} `json:"metadata,omitempty"` + Metadata interface{} `json:"metadata,omitempty"` // Parameters - Required if a parameter is used in policy rule. - Parameters *map[string]interface{} `json:"parameters,omitempty"` + Parameters interface{} `json:"parameters,omitempty"` } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-12-01/policy/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-12-01/policy/version.go index f76547fffde2..a7f47e4d482c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-12-01/policy/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-12-01/policy/version.go @@ -1,5 +1,7 @@ package policy +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 policy // 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 + " policy/2016-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/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..17e338c23f45 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) @@ -252,7 +252,7 @@ func (client DeploymentsClient) CreateOrUpdatePreparer(ctx context.Context, reso } 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.Resources/deployments/{deploymentName}", pathParameters), @@ -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) @@ -702,7 +702,7 @@ func (client DeploymentsClient) ValidatePreparer(ctx context.Context, resourceGr } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/validate", pathParameters), 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..519ba3ada919 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) @@ -161,7 +161,7 @@ func (client GroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceG } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", pathParameters), @@ -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) @@ -312,7 +312,7 @@ func (client GroupsClient) ExportTemplatePreparer(ctx context.Context, resourceG } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/exportTemplate", pathParameters), @@ -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) @@ -561,7 +561,7 @@ func (client GroupsClient) UpdatePreparer(ctx context.Context, resourceGroupName } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", pathParameters), 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..fcf231f52dd4 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" @@ -35,6 +36,11 @@ const ( Incremental DeploymentMode = "Incremental" ) +// PossibleDeploymentModeValues returns an array of possible values for the DeploymentMode const type. +func PossibleDeploymentModeValues() []DeploymentMode { + return []DeploymentMode{Complete, Incremental} +} + // ResourceIdentityType enumerates the values for resource identity type. type ResourceIdentityType string @@ -43,6 +49,11 @@ const ( SystemAssigned ResourceIdentityType = "SystemAssigned" ) +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{SystemAssigned} +} + // AliasPathType the type of the paths for alias. type AliasPathType struct { // Path - The path of an alias. @@ -69,12 +80,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 +300,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 +444,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 +558,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 +580,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 +612,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 +660,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 +716,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 +728,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 +795,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 +954,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 +993,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 +1167,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 +1233,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 +1377,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 +1412,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 +// 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 !done { - return gr, autorest.NewError("resources.ResourcesCreateOrUpdateByIDFuture", "Result", "asynchronous operation has not completed") + if r.Name != nil { + objectMap["name"] = r.Name } - 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 - } - 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.Type != nil { + objectMap["type"] = r.Type } - if !done { - return gr, autorest.NewError("resources.ResourcesCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + if r.Location != nil { + objectMap["location"] = r.Location } - if future.PollingMethod() == azure.PollingLocation { - gr, 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 + 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 +1609,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..1e6765e3f2c5 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) @@ -233,7 +234,7 @@ func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupNa } 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/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", pathParameters), @@ -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) @@ -310,7 +312,7 @@ func (client Client) CreateOrUpdateByIDPreparer(ctx context.Context, resourceID } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/{resourceId}", pathParameters), @@ -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) @@ -894,7 +899,7 @@ func (client Client) MoveResourcesPreparer(ctx context.Context, sourceResourceGr } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources", pathParameters), @@ -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) @@ -977,7 +982,7 @@ func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName strin } 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/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", pathParameters), @@ -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") @@ -1047,7 +1053,7 @@ func (client Client) UpdateByIDPreparer(ctx context.Context, resourceID string, } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/{resourceId}", pathParameters), @@ -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) @@ -1129,7 +1135,7 @@ func (client Client) ValidateMoveResourcesPreparer(ctx context.Context, sourceRe } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/validateMoveResources", pathParameters), @@ -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..e3ed75145b22 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 { @@ -79,7 +79,7 @@ func (client JobCollectionsClient) CreateOrUpdatePreparer(ctx context.Context, r } 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.Scheduler/jobCollections/{jobCollectionName}", pathParameters), @@ -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 { @@ -598,7 +598,7 @@ func (client JobCollectionsClient) PatchPreparer(ctx context.Context, resourceGr } 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.Scheduler/jobCollections/{jobCollectionName}", pathParameters), 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..67d942e755fb 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 { @@ -81,7 +81,7 @@ func (client JobsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGro } 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.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}", pathParameters), @@ -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 { @@ -513,7 +515,7 @@ func (client JobsClient) PatchPreparer(ctx context.Context, resourceGroupName st } 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.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}", pathParameters), @@ -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..05df9ac07583 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 @@ -46,6 +46,11 @@ const ( Wednesday DayOfWeek = "Wednesday" ) +// PossibleDayOfWeekValues returns an array of possible values for the DayOfWeek const type. +func PossibleDayOfWeekValues() []DayOfWeek { + return []DayOfWeek{Friday, Monday, Saturday, Sunday, Thursday, Tuesday, Wednesday} +} + // JobActionType enumerates the values for job action type. type JobActionType string @@ -62,6 +67,11 @@ const ( StorageQueue JobActionType = "StorageQueue" ) +// PossibleJobActionTypeValues returns an array of possible values for the JobActionType const type. +func PossibleJobActionTypeValues() []JobActionType { + return []JobActionType{HTTP, HTTPS, ServiceBusQueue, ServiceBusTopic, StorageQueue} +} + // JobCollectionState enumerates the values for job collection state. type JobCollectionState string @@ -76,6 +86,11 @@ const ( Suspended JobCollectionState = "Suspended" ) +// PossibleJobCollectionStateValues returns an array of possible values for the JobCollectionState const type. +func PossibleJobCollectionStateValues() []JobCollectionState { + return []JobCollectionState{Deleted, Disabled, Enabled, Suspended} +} + // JobExecutionStatus enumerates the values for job execution status. type JobExecutionStatus string @@ -88,6 +103,11 @@ const ( Postponed JobExecutionStatus = "Postponed" ) +// PossibleJobExecutionStatusValues returns an array of possible values for the JobExecutionStatus const type. +func PossibleJobExecutionStatusValues() []JobExecutionStatus { + return []JobExecutionStatus{Completed, Failed, Postponed} +} + // JobHistoryActionName enumerates the values for job history action name. type JobHistoryActionName string @@ -98,6 +118,11 @@ const ( MainAction JobHistoryActionName = "MainAction" ) +// PossibleJobHistoryActionNameValues returns an array of possible values for the JobHistoryActionName const type. +func PossibleJobHistoryActionNameValues() []JobHistoryActionName { + return []JobHistoryActionName{ErrorAction, MainAction} +} + // JobScheduleDay enumerates the values for job schedule day. type JobScheduleDay string @@ -118,6 +143,11 @@ const ( JobScheduleDayWednesday JobScheduleDay = "Wednesday" ) +// PossibleJobScheduleDayValues returns an array of possible values for the JobScheduleDay const type. +func PossibleJobScheduleDayValues() []JobScheduleDay { + return []JobScheduleDay{JobScheduleDayFriday, JobScheduleDayMonday, JobScheduleDaySaturday, JobScheduleDaySunday, JobScheduleDayThursday, JobScheduleDayTuesday, JobScheduleDayWednesday} +} + // JobState enumerates the values for job state. type JobState string @@ -132,6 +162,11 @@ const ( JobStateFaulted JobState = "Faulted" ) +// PossibleJobStateValues returns an array of possible values for the JobState const type. +func PossibleJobStateValues() []JobState { + return []JobState{JobStateCompleted, JobStateDisabled, JobStateEnabled, JobStateFaulted} +} + // RecurrenceFrequency enumerates the values for recurrence frequency. type RecurrenceFrequency string @@ -148,6 +183,11 @@ const ( Week RecurrenceFrequency = "Week" ) +// PossibleRecurrenceFrequencyValues returns an array of possible values for the RecurrenceFrequency const type. +func PossibleRecurrenceFrequencyValues() []RecurrenceFrequency { + return []RecurrenceFrequency{Day, Hour, Minute, Month, Week} +} + // RetryType enumerates the values for retry type. type RetryType string @@ -158,6 +198,11 @@ const ( None RetryType = "None" ) +// PossibleRetryTypeValues returns an array of possible values for the RetryType const type. +func PossibleRetryTypeValues() []RetryType { + return []RetryType{Fixed, None} +} + // ServiceBusAuthenticationType enumerates the values for service bus authentication type. type ServiceBusAuthenticationType string @@ -168,6 +213,11 @@ const ( SharedAccessKey ServiceBusAuthenticationType = "SharedAccessKey" ) +// PossibleServiceBusAuthenticationTypeValues returns an array of possible values for the ServiceBusAuthenticationType const type. +func PossibleServiceBusAuthenticationTypeValues() []ServiceBusAuthenticationType { + return []ServiceBusAuthenticationType{NotSpecified, SharedAccessKey} +} + // ServiceBusTransportType enumerates the values for service bus transport type. type ServiceBusTransportType string @@ -180,6 +230,11 @@ const ( ServiceBusTransportTypeNotSpecified ServiceBusTransportType = "NotSpecified" ) +// PossibleServiceBusTransportTypeValues returns an array of possible values for the ServiceBusTransportType const type. +func PossibleServiceBusTransportTypeValues() []ServiceBusTransportType { + return []ServiceBusTransportType{ServiceBusTransportTypeAMQP, ServiceBusTransportTypeNetMessaging, ServiceBusTransportTypeNotSpecified} +} + // SkuDefinition enumerates the values for sku definition. type SkuDefinition string @@ -194,6 +249,11 @@ const ( Standard SkuDefinition = "Standard" ) +// PossibleSkuDefinitionValues returns an array of possible values for the SkuDefinition const type. +func PossibleSkuDefinitionValues() []SkuDefinition { + return []SkuDefinition{Free, P10Premium, P20Premium, Standard} +} + // Type enumerates the values for type. type Type string @@ -208,25 +268,35 @@ const ( TypeHTTPAuthentication Type = "HttpAuthentication" ) +// PossibleTypeValues returns an array of possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{TypeActiveDirectoryOAuth, TypeBasic, TypeClientCertificate, TypeHTTPAuthentication} +} + // 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 + } + if ba.Type != "" { + objectMap["type"] = ba.Type + } + return json.Marshal(objectMap) } // AsClientCertAuthentication is the BasicHTTPAuthentication implementation for BasicAuthentication. @@ -256,8 +326,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 +336,33 @@ 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 + } + if cca.Type != "" { + objectMap["type"] = cca.Type + } + return json.Marshal(objectMap) } // AsClientCertAuthentication is the BasicHTTPAuthentication implementation for ClientCertAuthentication. @@ -306,7 +390,7 @@ func (cca ClientCertAuthentication) AsBasicHTTPAuthentication() (BasicHTTPAuthen return &cca, true } -// BasicHTTPAuthentication +// BasicHTTPAuthentication ... type BasicHTTPAuthentication interface { AsClientCertAuthentication() (*ClientCertAuthentication, bool) AsBasicAuthentication() (*BasicAuthentication, bool) @@ -314,7 +398,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 +452,11 @@ 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{}) + if ha.Type != "" { + objectMap["type"] = ha.Type + } + return json.Marshal(objectMap) } // AsClientCertAuthentication is the BasicHTTPAuthentication implementation for HTTPAuthentication. @@ -412,7 +495,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 +524,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 + 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.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 - } - hr.Headers = &headers } return nil @@ -506,11 +606,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 +769,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 +818,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 +866,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 +1252,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 +1260,30 @@ 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 + } + if oaa.Type != "" { + objectMap["type"] = oaa.Type + } + return json.Marshal(objectMap) } // AsClientCertAuthentication is the BasicHTTPAuthentication implementation for OAuthAuthentication. @@ -1181,7 +1368,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 +1377,118 @@ 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 + } + if sbm.TransportType != "" { + 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 + } + if sbqm.TransportType != "" { + 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 + } + if sbtm.TransportType != "" { + 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..15f10f1068bb 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 @@ -34,6 +34,11 @@ const ( Secondary AdminKeyKind = "secondary" ) +// PossibleAdminKeyKindValues returns an array of possible values for the AdminKeyKind const type. +func PossibleAdminKeyKindValues() []AdminKeyKind { + return []AdminKeyKind{Primary, Secondary} +} + // HostingMode enumerates the values for hosting mode. type HostingMode string @@ -44,6 +49,11 @@ const ( HighDensity HostingMode = "highDensity" ) +// PossibleHostingModeValues returns an array of possible values for the HostingMode const type. +func PossibleHostingModeValues() []HostingMode { + return []HostingMode{Default, HighDensity} +} + // ProvisioningState enumerates the values for provisioning state. type ProvisioningState string @@ -56,6 +66,11 @@ const ( Succeeded ProvisioningState = "succeeded" ) +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{Failed, Provisioning, Succeeded} +} + // ServiceStatus enumerates the values for service status. type ServiceStatus string @@ -74,6 +89,11 @@ const ( ServiceStatusRunning ServiceStatus = "running" ) +// PossibleServiceStatusValues returns an array of possible values for the ServiceStatus const type. +func PossibleServiceStatusValues() []ServiceStatus { + return []ServiceStatus{ServiceStatusDegraded, ServiceStatusDeleting, ServiceStatusDisabled, ServiceStatusError, ServiceStatusProvisioning, ServiceStatusRunning} +} + // SkuName enumerates the values for sku name. type SkuName string @@ -90,6 +110,11 @@ const ( Standard3 SkuName = "standard3" ) +// PossibleSkuNameValues returns an array of possible values for the SkuName const type. +func PossibleSkuNameValues() []SkuName { + return []SkuName{Basic, Free, Standard, Standard2, Standard3} +} + // UnavailableNameReason enumerates the values for unavailable name reason. type UnavailableNameReason string @@ -100,6 +125,11 @@ const ( Invalid UnavailableNameReason = "Invalid" ) +// PossibleUnavailableNameReasonValues returns an array of possible values for the UnavailableNameReason const type. +func PossibleUnavailableNameReasonValues() []UnavailableNameReason { + return []UnavailableNameReason{AlreadyExists, Invalid} +} + // AdminKeyResult response containing the primary and secondary admin API keys for a given Azure Search service. type AdminKeyResult struct { autorest.Response `json:"-"` @@ -130,6 +160,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 +183,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 +230,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 +404,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 +417,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..23b70cf2cce6 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) @@ -88,7 +88,7 @@ func (client ServicesClient) CheckNameAvailabilityPreparer(ctx context.Context, } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Search/checkNameAvailability", pathParameters), @@ -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) @@ -178,7 +178,7 @@ func (client ServicesClient) CreateOrUpdatePreparer(ctx context.Context, resourc } 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.Search/searchServices/{searchServiceName}", pathParameters), @@ -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.AsContentType("application/json; charset=utf-8"), + 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..385acea7ea44 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) @@ -173,7 +173,7 @@ func (client DisasterRecoveryConfigsClient) CheckNameAvailabilityMethodPreparer( } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/CheckNameAvailability", pathParameters), @@ -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) @@ -257,7 +257,7 @@ func (client DisasterRecoveryConfigsClient) CreateOrUpdatePreparer(ctx context.C } 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.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}", pathParameters), @@ -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..9ea717acc832 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 @@ -38,6 +38,11 @@ const ( Send AccessRights = "Send" ) +// PossibleAccessRightsValues returns an array of possible values for the AccessRights const type. +func PossibleAccessRightsValues() []AccessRights { + return []AccessRights{Listen, Manage, Send} +} + // EncodingCaptureDescription enumerates the values for encoding capture description. type EncodingCaptureDescription string @@ -48,6 +53,11 @@ const ( AvroDeflate EncodingCaptureDescription = "AvroDeflate" ) +// PossibleEncodingCaptureDescriptionValues returns an array of possible values for the EncodingCaptureDescription const type. +func PossibleEncodingCaptureDescriptionValues() []EncodingCaptureDescription { + return []EncodingCaptureDescription{Avro, AvroDeflate} +} + // EntityStatus enumerates the values for entity status. type EntityStatus string @@ -72,6 +82,11 @@ const ( Unknown EntityStatus = "Unknown" ) +// PossibleEntityStatusValues returns an array of possible values for the EntityStatus const type. +func PossibleEntityStatusValues() []EntityStatus { + return []EntityStatus{Active, Creating, Deleting, Disabled, ReceiveDisabled, Renaming, Restoring, SendDisabled, Unknown} +} + // FilterType enumerates the values for filter type. type FilterType string @@ -82,6 +97,11 @@ const ( FilterTypeSQLFilter FilterType = "SqlFilter" ) +// PossibleFilterTypeValues returns an array of possible values for the FilterType const type. +func PossibleFilterTypeValues() []FilterType { + return []FilterType{FilterTypeCorrelationFilter, FilterTypeSQLFilter} +} + // KeyType enumerates the values for key type. type KeyType string @@ -92,6 +112,11 @@ const ( SecondaryKey KeyType = "SecondaryKey" ) +// PossibleKeyTypeValues returns an array of possible values for the KeyType const type. +func PossibleKeyTypeValues() []KeyType { + return []KeyType{PrimaryKey, SecondaryKey} +} + // ProvisioningStateDR enumerates the values for provisioning state dr. type ProvisioningStateDR string @@ -104,6 +129,11 @@ const ( Succeeded ProvisioningStateDR = "Succeeded" ) +// PossibleProvisioningStateDRValues returns an array of possible values for the ProvisioningStateDR const type. +func PossibleProvisioningStateDRValues() []ProvisioningStateDR { + return []ProvisioningStateDR{Accepted, Failed, Succeeded} +} + // RoleDisasterRecovery enumerates the values for role disaster recovery. type RoleDisasterRecovery string @@ -116,6 +146,11 @@ const ( Secondary RoleDisasterRecovery = "Secondary" ) +// PossibleRoleDisasterRecoveryValues returns an array of possible values for the RoleDisasterRecovery const type. +func PossibleRoleDisasterRecoveryValues() []RoleDisasterRecovery { + return []RoleDisasterRecovery{Primary, PrimaryNotReplicating, Secondary} +} + // SkuName enumerates the values for sku name. type SkuName string @@ -128,6 +163,11 @@ const ( Standard SkuName = "Standard" ) +// PossibleSkuNameValues returns an array of possible values for the SkuName const type. +func PossibleSkuNameValues() []SkuName { + return []SkuName{Basic, Premium, Standard} +} + // SkuTier enumerates the values for sku tier. type SkuTier string @@ -140,6 +180,11 @@ const ( SkuTierStandard SkuTier = "Standard" ) +// PossibleSkuTierValues returns an array of possible values for the SkuTier const type. +func PossibleSkuTierValues() []SkuTier { + return []SkuTier{SkuTierBasic, SkuTierPremium, SkuTierStandard} +} + // UnavailableReason enumerates the values for unavailable reason. type UnavailableReason string @@ -158,6 +203,11 @@ const ( TooManyNamespaceInCurrentSubscription UnavailableReason = "TooManyNamespaceInCurrentSubscription" ) +// PossibleUnavailableReasonValues returns an array of possible values for the UnavailableReason const type. +func PossibleUnavailableReasonValues() []UnavailableReason { + return []UnavailableReason{InvalidName, NameInLockdown, NameInUse, None, SubscriptionIsDisabled, TooManyNamespaceInCurrentSubscription} +} + // AccessKeys namespace/ServiceBus Connection String type AccessKeys struct { autorest.Response `json:"-"` @@ -177,8 +227,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 +241,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for ArmDisasterRecovery. +func (adr ArmDisasterRecovery) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if adr.ArmDisasterRecoveryProperties != nil { + objectMap["properties"] = adr.ArmDisasterRecoveryProperties + } + if adr.ID != nil { + objectMap["id"] = adr.ID + } + if adr.Name != nil { + objectMap["name"] = adr.Name + } + if adr.Type != nil { + objectMap["type"] = adr.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ArmDisasterRecovery struct. @@ -208,46 +276,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 + 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.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 - } - adr.Type = &typeVar } return nil @@ -355,7 +422,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"` @@ -406,6 +474,8 @@ type CheckNameAvailabilityResult struct { // CorrelationFilter represents the correlation filter expression. type CorrelationFilter struct { + // Properties - dictionary object for custom filters + Properties map[string]*string `json:"properties"` // CorrelationID - Identifier of the correlation. CorrelationID *string `json:"correlationId,omitempty"` // MessageID - Identifier of the message. @@ -426,6 +496,42 @@ type CorrelationFilter struct { RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` } +// MarshalJSON is the custom marshaler for CorrelationFilter. +func (cf CorrelationFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cf.Properties != nil { + objectMap["properties"] = cf.Properties + } + if cf.CorrelationID != nil { + objectMap["correlationId"] = cf.CorrelationID + } + if cf.MessageID != nil { + objectMap["messageId"] = cf.MessageID + } + if cf.To != nil { + objectMap["to"] = cf.To + } + if cf.ReplyTo != nil { + objectMap["replyTo"] = cf.ReplyTo + } + if cf.Label != nil { + objectMap["label"] = cf.Label + } + if cf.SessionID != nil { + objectMap["sessionId"] = cf.SessionID + } + if cf.ReplyToSessionID != nil { + objectMap["replyToSessionId"] = cf.ReplyToSessionID + } + if cf.ContentType != nil { + objectMap["contentType"] = cf.ContentType + } + if cf.RequiresPreprocessing != nil { + objectMap["requiresPreprocessing"] = cf.RequiresPreprocessing + } + return json.Marshal(objectMap) +} + // Destination capture storage details for capture description type Destination struct { // Name - Name for capture destination @@ -434,6 +540,18 @@ type Destination struct { *DestinationProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for Destination. +func (d Destination) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if d.Name != nil { + objectMap["name"] = d.Name + } + if d.DestinationProperties != nil { + objectMap["properties"] = d.DestinationProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for Destination struct. func (d *Destination) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -441,33 +559,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 +596,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 +607,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for Eventhub. +func (e Eventhub) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if e.EventhubProperties != nil { + objectMap["properties"] = e.EventhubProperties + } + if e.ID != nil { + objectMap["id"] = e.ID + } + if e.Name != nil { + objectMap["name"] = e.Name + } + if e.Type != nil { + objectMap["type"] = e.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for Eventhub struct. @@ -505,46 +642,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 - } - 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 + 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.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 +820,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 +833,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 +881,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 +935,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 +1040,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 +1086,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 +1188,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 +1209,68 @@ 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"` +} + +// MarshalJSON is the custom marshaler for Rule. +func (r Rule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.Ruleproperties != nil { + objectMap["properties"] = r.Ruleproperties + } + if r.ID != nil { + objectMap["id"] = r.ID + } + if r.Name != nil { + objectMap["name"] = r.Name + } + if r.Type != nil { + objectMap["type"] = r.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for Rule struct. @@ -1045,46 +1280,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 +1441,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for SBAuthorizationRule. +func (sar SBAuthorizationRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sar.SBAuthorizationRuleProperties != nil { + objectMap["properties"] = sar.SBAuthorizationRuleProperties + } + if sar.ID != nil { + objectMap["id"] = sar.ID + } + if sar.Name != nil { + objectMap["name"] = sar.Name + } + if sar.Type != nil { + objectMap["type"] = sar.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for SBAuthorizationRule struct. @@ -1224,46 +1476,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 - } - sar.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 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.Type = &typeVar } return nil @@ -1380,99 +1631,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 +1870,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 +1994,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for SBQueue. +func (sq SBQueue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sq.SBQueueProperties != nil { + objectMap["properties"] = sq.SBQueueProperties + } + if sq.ID != nil { + objectMap["id"] = sq.ID + } + if sq.Name != nil { + objectMap["name"] = sq.Name + } + if sq.Type != nil { + objectMap["type"] = sq.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for SBQueue struct. @@ -1714,46 +2029,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 - } - sq.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 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.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 @@ -1893,6 +2207,8 @@ type SBQueueProperties struct { MaxDeliveryCount *int32 `json:"maxDeliveryCount,omitempty"` // Status - Enumerates the possible values for the status of a messaging entity. Possible values include: 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown' Status EntityStatus `json:"status,omitempty"` + // EnableBatchedOperations - Value that indicates whether server-side batched operations are enabled. + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` // AutoDeleteOnIdle - ISO 8061 timeSpan idle interval after which the queue is automatically deleted. The minimum duration is 5 minutes. AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` // EnablePartitioning - A value that indicates whether the queue is to be partitioned across multiple message brokers. @@ -1918,14 +2234,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for SBSubscription. +func (ss SBSubscription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ss.SBSubscriptionProperties != nil { + objectMap["properties"] = ss.SBSubscriptionProperties + } + if ss.ID != nil { + objectMap["id"] = ss.ID + } + if ss.Name != nil { + objectMap["name"] = ss.Name + } + if ss.Type != nil { + objectMap["type"] = ss.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for SBSubscription struct. @@ -1935,46 +2269,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 +2433,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 +2456,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for SBTopic. +func (st SBTopic) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if st.SBTopicProperties != nil { + objectMap["properties"] = st.SBTopicProperties + } + if st.ID != nil { + objectMap["id"] = st.ID + } + if st.Name != nil { + objectMap["name"] = st.Name + } + if st.Type != nil { + objectMap["type"] = st.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for SBTopic struct. @@ -2138,46 +2491,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 + 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.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 - } - 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 +2673,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 +2697,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..9ccdc5e617c5 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) @@ -83,7 +83,7 @@ func (client NamespacesClient) CheckNameAvailabilityMethodPreparer(ctx context.C } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/CheckNameAvailability", pathParameters), @@ -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) @@ -154,7 +154,7 @@ func (client NamespacesClient) CreateOrUpdatePreparer(ctx context.Context, resou } 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.ServiceBus/namespaces/{namespaceName}", pathParameters), @@ -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) @@ -248,7 +248,7 @@ func (client NamespacesClient) CreateOrUpdateAuthorizationRulePreparer(ctx conte } 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.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}", pathParameters), @@ -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) @@ -1021,7 +1024,7 @@ func (client NamespacesClient) RegenerateKeysPreparer(ctx context.Context, resou } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys", pathParameters), @@ -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) @@ -1101,7 +1104,7 @@ func (client NamespacesClient) UpdatePreparer(ctx context.Context, resourceGroup } 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.ServiceBus/namespaces/{namespaceName}", pathParameters), 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..99c25e9dbd98 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) @@ -93,7 +93,7 @@ func (client QueuesClient) CreateOrUpdatePreparer(ctx context.Context, resourceG } 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.ServiceBus/namespaces/{namespaceName}/queues/{queueName}", pathParameters), @@ -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) @@ -183,7 +183,7 @@ func (client QueuesClient) CreateOrUpdateAuthorizationRulePreparer(ctx context.C } 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.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}", pathParameters), @@ -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) @@ -892,7 +893,7 @@ func (client QueuesClient) RegenerateKeysPreparer(ctx context.Context, resourceG } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}/regenerateKeys", pathParameters), 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..6a6892fb8afe 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) @@ -102,7 +102,7 @@ func (client RulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGr } 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.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName}", pathParameters), @@ -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..7e6fd5a4ae08 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) @@ -98,7 +98,7 @@ func (client SubscriptionsClient) CreateOrUpdatePreparer(ctx context.Context, re } 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.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}", pathParameters), @@ -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..32fa0fd7d6d9 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) @@ -93,7 +93,7 @@ func (client TopicsClient) CreateOrUpdatePreparer(ctx context.Context, resourceG } 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.ServiceBus/namespaces/{namespaceName}/topics/{topicName}", pathParameters), @@ -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) @@ -183,7 +183,7 @@ func (client TopicsClient) CreateOrUpdateAuthorizationRulePreparer(ctx context.C } 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.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}", pathParameters), @@ -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) @@ -892,7 +893,7 @@ func (client TopicsClient) RegenerateKeysPreparer(ctx context.Context, resourceG } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}/regenerateKeys", pathParameters), 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..0d976685371b 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), @@ -88,7 +87,7 @@ func (client BackupLongTermRetentionPoliciesClient) CreateOrUpdatePreparer(ctx c } 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.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{backupLongTermRetentionPolicyName}", pathParameters), @@ -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..1a67bbc0210c 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), @@ -87,7 +86,7 @@ func (client BackupLongTermRetentionVaultsClient) CreateOrUpdatePreparer(ctx con } 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.Sql/servers/{serverName}/backupLongTermRetentionVaults/{backupLongTermRetentionVaultName}", pathParameters), @@ -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..8770fc0e82a9 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), @@ -86,7 +86,7 @@ func (client DatabaseBlobAuditingPoliciesClient) CreateOrUpdatePreparer(ctx cont } 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.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/{blobAuditingPolicyName}", pathParameters), @@ -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..164f6b989b2a 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), @@ -88,7 +87,7 @@ func (client DatabasesClient) CreateImportOperationPreparer(ctx context.Context, } 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.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}", pathParameters), @@ -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 { @@ -162,7 +161,7 @@ func (client DatabasesClient) CreateOrUpdatePreparer(ctx context.Context, resour } 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.Sql/servers/{serverName}/databases/{databaseName}", pathParameters), @@ -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) @@ -312,7 +311,7 @@ func (client DatabasesClient) ExportPreparer(ctx context.Context, resourceGroupN } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export", pathParameters), @@ -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) @@ -604,7 +603,7 @@ func (client DatabasesClient) ImportPreparer(ctx context.Context, resourceGroupN } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import", pathParameters), @@ -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 { @@ -1169,7 +1168,7 @@ func (client DatabasesClient) UpdatePreparer(ctx context.Context, resourceGroupN } 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.Sql/servers/{serverName}/databases/{databaseName}", pathParameters), 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..fdb9dee3f2c9 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), } @@ -86,7 +86,7 @@ func (client DatabaseThreatDetectionPoliciesClient) CreateOrUpdatePreparer(ctx c } 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.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}", pathParameters), @@ -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..d462b4be078f 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), @@ -85,7 +84,7 @@ func (client DataMaskingPoliciesClient) CreateOrUpdatePreparer(ctx context.Conte } 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.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}", pathParameters), @@ -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..5eb74d5df714 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), @@ -98,7 +97,7 @@ func (client DataMaskingRulesClient) CreateOrUpdatePreparer(ctx context.Context, } 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.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules/{dataMaskingRuleName}", pathParameters), @@ -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..c56f6a3e5738 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 { @@ -78,7 +78,7 @@ func (client ElasticPoolsClient) CreateOrUpdatePreparer(ctx context.Context, res } 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.Sql/servers/{serverName}/elasticPools/{elasticPoolName}", pathParameters), @@ -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 { @@ -494,7 +494,7 @@ func (client ElasticPoolsClient) UpdatePreparer(ctx context.Context, resourceGro } 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.Sql/servers/{serverName}/elasticPools/{elasticPoolName}", pathParameters), 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..6f96e37ce1fc 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), @@ -77,7 +77,7 @@ func (client EncryptionProtectorsClient) CreateOrUpdatePreparer(ctx context.Cont } 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.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}", pathParameters), @@ -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..06b0ae818b14 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) @@ -87,7 +87,7 @@ func (client FailoverGroupsClient) CreateOrUpdatePreparer(ctx context.Context, r } 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.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}", pathParameters), @@ -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 { @@ -537,7 +538,7 @@ func (client FailoverGroupsClient) UpdatePreparer(ctx context.Context, resourceG } 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.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}", pathParameters), 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..39889599b694 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) @@ -93,7 +93,7 @@ func (client FirewallRulesClient) CreateOrUpdatePreparer(ctx context.Context, re } 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.Sql/servers/{serverName}/firewallRules/{firewallRuleName}", pathParameters), @@ -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..fc98307265c5 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), @@ -92,7 +91,7 @@ func (client GeoBackupPoliciesClient) CreateOrUpdatePreparer(ctx context.Context } 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.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}", pathParameters), @@ -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..1d14c39e10f3 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 @@ -37,6 +37,11 @@ const ( SQL AuthenticationType = "SQL" ) +// PossibleAuthenticationTypeValues returns an array of possible values for the AuthenticationType const type. +func PossibleAuthenticationTypeValues() []AuthenticationType { + return []AuthenticationType{ADPassword, SQL} +} + // BackupLongTermRetentionPolicyState enumerates the values for backup long term retention policy state. type BackupLongTermRetentionPolicyState string @@ -47,6 +52,11 @@ const ( Enabled BackupLongTermRetentionPolicyState = "Enabled" ) +// PossibleBackupLongTermRetentionPolicyStateValues returns an array of possible values for the BackupLongTermRetentionPolicyState const type. +func PossibleBackupLongTermRetentionPolicyStateValues() []BackupLongTermRetentionPolicyState { + return []BackupLongTermRetentionPolicyState{Disabled, Enabled} +} + // BlobAuditingPolicyState enumerates the values for blob auditing policy state. type BlobAuditingPolicyState string @@ -57,6 +67,11 @@ const ( BlobAuditingPolicyStateEnabled BlobAuditingPolicyState = "Enabled" ) +// PossibleBlobAuditingPolicyStateValues returns an array of possible values for the BlobAuditingPolicyState const type. +func PossibleBlobAuditingPolicyStateValues() []BlobAuditingPolicyState { + return []BlobAuditingPolicyState{BlobAuditingPolicyStateDisabled, BlobAuditingPolicyStateEnabled} +} + // CapabilityStatus enumerates the values for capability status. type CapabilityStatus string @@ -71,6 +86,11 @@ const ( CapabilityStatusVisible CapabilityStatus = "Visible" ) +// PossibleCapabilityStatusValues returns an array of possible values for the CapabilityStatus const type. +func PossibleCapabilityStatusValues() []CapabilityStatus { + return []CapabilityStatus{CapabilityStatusAvailable, CapabilityStatusDefault, CapabilityStatusDisabled, CapabilityStatusVisible} +} + // CheckNameAvailabilityReason enumerates the values for check name availability reason. type CheckNameAvailabilityReason string @@ -81,6 +101,11 @@ const ( Invalid CheckNameAvailabilityReason = "Invalid" ) +// PossibleCheckNameAvailabilityReasonValues returns an array of possible values for the CheckNameAvailabilityReason const type. +func PossibleCheckNameAvailabilityReasonValues() []CheckNameAvailabilityReason { + return []CheckNameAvailabilityReason{AlreadyExists, Invalid} +} + // CreateMode enumerates the values for create mode. type CreateMode string @@ -103,6 +128,11 @@ const ( RestoreLongTermRetentionBackup CreateMode = "RestoreLongTermRetentionBackup" ) +// PossibleCreateModeValues returns an array of possible values for the CreateMode const type. +func PossibleCreateModeValues() []CreateMode { + return []CreateMode{Copy, Default, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, Restore, RestoreLongTermRetentionBackup} +} + // DatabaseEdition enumerates the values for database edition. type DatabaseEdition string @@ -131,6 +161,11 @@ const ( Web DatabaseEdition = "Web" ) +// PossibleDatabaseEditionValues returns an array of possible values for the DatabaseEdition const type. +func PossibleDatabaseEditionValues() []DatabaseEdition { + return []DatabaseEdition{Basic, Business, DataWarehouse, Free, Premium, PremiumRS, Standard, Stretch, System, System2, Web} +} + // DataMaskingFunction enumerates the values for data masking function. type DataMaskingFunction string @@ -149,6 +184,11 @@ const ( DataMaskingFunctionText DataMaskingFunction = "Text" ) +// PossibleDataMaskingFunctionValues returns an array of possible values for the DataMaskingFunction const type. +func PossibleDataMaskingFunctionValues() []DataMaskingFunction { + return []DataMaskingFunction{DataMaskingFunctionCCN, DataMaskingFunctionDefault, DataMaskingFunctionEmail, DataMaskingFunctionNumber, DataMaskingFunctionSSN, DataMaskingFunctionText} +} + // DataMaskingRuleState enumerates the values for data masking rule state. type DataMaskingRuleState string @@ -159,6 +199,11 @@ const ( DataMaskingRuleStateEnabled DataMaskingRuleState = "Enabled" ) +// PossibleDataMaskingRuleStateValues returns an array of possible values for the DataMaskingRuleState const type. +func PossibleDataMaskingRuleStateValues() []DataMaskingRuleState { + return []DataMaskingRuleState{DataMaskingRuleStateDisabled, DataMaskingRuleStateEnabled} +} + // DataMaskingState enumerates the values for data masking state. type DataMaskingState string @@ -169,6 +214,11 @@ const ( DataMaskingStateEnabled DataMaskingState = "Enabled" ) +// PossibleDataMaskingStateValues returns an array of possible values for the DataMaskingState const type. +func PossibleDataMaskingStateValues() []DataMaskingState { + return []DataMaskingState{DataMaskingStateDisabled, DataMaskingStateEnabled} +} + // ElasticPoolEdition enumerates the values for elastic pool edition. type ElasticPoolEdition string @@ -181,6 +231,11 @@ const ( ElasticPoolEditionStandard ElasticPoolEdition = "Standard" ) +// PossibleElasticPoolEditionValues returns an array of possible values for the ElasticPoolEdition const type. +func PossibleElasticPoolEditionValues() []ElasticPoolEdition { + return []ElasticPoolEdition{ElasticPoolEditionBasic, ElasticPoolEditionPremium, ElasticPoolEditionStandard} +} + // ElasticPoolState enumerates the values for elastic pool state. type ElasticPoolState string @@ -193,6 +248,11 @@ const ( ElasticPoolStateReady ElasticPoolState = "Ready" ) +// PossibleElasticPoolStateValues returns an array of possible values for the ElasticPoolState const type. +func PossibleElasticPoolStateValues() []ElasticPoolState { + return []ElasticPoolState{ElasticPoolStateCreating, ElasticPoolStateDisabled, ElasticPoolStateReady} +} + // FailoverGroupReplicationRole enumerates the values for failover group replication role. type FailoverGroupReplicationRole string @@ -203,6 +263,11 @@ const ( Secondary FailoverGroupReplicationRole = "Secondary" ) +// PossibleFailoverGroupReplicationRoleValues returns an array of possible values for the FailoverGroupReplicationRole const type. +func PossibleFailoverGroupReplicationRoleValues() []FailoverGroupReplicationRole { + return []FailoverGroupReplicationRole{Primary, Secondary} +} + // GeoBackupPolicyState enumerates the values for geo backup policy state. type GeoBackupPolicyState string @@ -213,6 +278,11 @@ const ( GeoBackupPolicyStateEnabled GeoBackupPolicyState = "Enabled" ) +// PossibleGeoBackupPolicyStateValues returns an array of possible values for the GeoBackupPolicyState const type. +func PossibleGeoBackupPolicyStateValues() []GeoBackupPolicyState { + return []GeoBackupPolicyState{GeoBackupPolicyStateDisabled, GeoBackupPolicyStateEnabled} +} + // IdentityType enumerates the values for identity type. type IdentityType string @@ -221,6 +291,11 @@ const ( SystemAssigned IdentityType = "SystemAssigned" ) +// PossibleIdentityTypeValues returns an array of possible values for the IdentityType const type. +func PossibleIdentityTypeValues() []IdentityType { + return []IdentityType{SystemAssigned} +} + // MaxSizeUnits enumerates the values for max size units. type MaxSizeUnits string @@ -235,6 +310,11 @@ const ( Terabytes MaxSizeUnits = "Terabytes" ) +// PossibleMaxSizeUnitsValues returns an array of possible values for the MaxSizeUnits const type. +func PossibleMaxSizeUnitsValues() []MaxSizeUnits { + return []MaxSizeUnits{Gigabytes, Megabytes, Petabytes, Terabytes} +} + // OperationOrigin enumerates the values for operation origin. type OperationOrigin string @@ -245,6 +325,11 @@ const ( OperationOriginUser OperationOrigin = "user" ) +// PossibleOperationOriginValues returns an array of possible values for the OperationOrigin const type. +func PossibleOperationOriginValues() []OperationOrigin { + return []OperationOrigin{OperationOriginSystem, OperationOriginUser} +} + // PerformanceLevelUnit enumerates the values for performance level unit. type PerformanceLevelUnit string @@ -253,6 +338,11 @@ const ( DTU PerformanceLevelUnit = "DTU" ) +// PossiblePerformanceLevelUnitValues returns an array of possible values for the PerformanceLevelUnit const type. +func PossiblePerformanceLevelUnitValues() []PerformanceLevelUnit { + return []PerformanceLevelUnit{DTU} +} + // PrimaryAggregationType enumerates the values for primary aggregation type. type PrimaryAggregationType string @@ -271,6 +361,11 @@ const ( Total PrimaryAggregationType = "Total" ) +// PossiblePrimaryAggregationTypeValues returns an array of possible values for the PrimaryAggregationType const type. +func PossiblePrimaryAggregationTypeValues() []PrimaryAggregationType { + return []PrimaryAggregationType{Average, Count, Maximum, Minimum, None, Total} +} + // ReadOnlyEndpointFailoverPolicy enumerates the values for read only endpoint failover policy. type ReadOnlyEndpointFailoverPolicy string @@ -281,6 +376,11 @@ const ( ReadOnlyEndpointFailoverPolicyEnabled ReadOnlyEndpointFailoverPolicy = "Enabled" ) +// PossibleReadOnlyEndpointFailoverPolicyValues returns an array of possible values for the ReadOnlyEndpointFailoverPolicy const type. +func PossibleReadOnlyEndpointFailoverPolicyValues() []ReadOnlyEndpointFailoverPolicy { + return []ReadOnlyEndpointFailoverPolicy{ReadOnlyEndpointFailoverPolicyDisabled, ReadOnlyEndpointFailoverPolicyEnabled} +} + // ReadScale enumerates the values for read scale. type ReadScale string @@ -291,6 +391,11 @@ const ( ReadScaleEnabled ReadScale = "Enabled" ) +// PossibleReadScaleValues returns an array of possible values for the ReadScale const type. +func PossibleReadScaleValues() []ReadScale { + return []ReadScale{ReadScaleDisabled, ReadScaleEnabled} +} + // ReadWriteEndpointFailoverPolicy enumerates the values for read write endpoint failover policy. type ReadWriteEndpointFailoverPolicy string @@ -301,6 +406,11 @@ const ( Manual ReadWriteEndpointFailoverPolicy = "Manual" ) +// PossibleReadWriteEndpointFailoverPolicyValues returns an array of possible values for the ReadWriteEndpointFailoverPolicy const type. +func PossibleReadWriteEndpointFailoverPolicyValues() []ReadWriteEndpointFailoverPolicy { + return []ReadWriteEndpointFailoverPolicy{Automatic, Manual} +} + // RecommendedIndexAction enumerates the values for recommended index action. type RecommendedIndexAction string @@ -313,6 +423,11 @@ const ( Rebuild RecommendedIndexAction = "Rebuild" ) +// PossibleRecommendedIndexActionValues returns an array of possible values for the RecommendedIndexAction const type. +func PossibleRecommendedIndexActionValues() []RecommendedIndexAction { + return []RecommendedIndexAction{Create, Drop, Rebuild} +} + // RecommendedIndexState enumerates the values for recommended index state. type RecommendedIndexState string @@ -341,6 +456,11 @@ const ( Verifying RecommendedIndexState = "Verifying" ) +// PossibleRecommendedIndexStateValues returns an array of possible values for the RecommendedIndexState const type. +func PossibleRecommendedIndexStateValues() []RecommendedIndexState { + return []RecommendedIndexState{Active, Blocked, Executing, Expired, Ignored, Pending, PendingRevert, Reverted, Reverting, Success, Verifying} +} + // RecommendedIndexType enumerates the values for recommended index type. type RecommendedIndexType string @@ -355,6 +475,11 @@ const ( NONCLUSTERED RecommendedIndexType = "NONCLUSTERED" ) +// PossibleRecommendedIndexTypeValues returns an array of possible values for the RecommendedIndexType const type. +func PossibleRecommendedIndexTypeValues() []RecommendedIndexType { + return []RecommendedIndexType{CLUSTERED, CLUSTEREDCOLUMNSTORE, COLUMNSTORE, NONCLUSTERED} +} + // ReplicationRole enumerates the values for replication role. type ReplicationRole string @@ -371,6 +496,11 @@ const ( ReplicationRoleSource ReplicationRole = "Source" ) +// PossibleReplicationRoleValues returns an array of possible values for the ReplicationRole const type. +func PossibleReplicationRoleValues() []ReplicationRole { + return []ReplicationRole{ReplicationRoleCopy, ReplicationRoleNonReadableSecondary, ReplicationRolePrimary, ReplicationRoleSecondary, ReplicationRoleSource} +} + // ReplicationState enumerates the values for replication state. type ReplicationState string @@ -385,6 +515,11 @@ const ( SUSPENDED ReplicationState = "SUSPENDED" ) +// PossibleReplicationStateValues returns an array of possible values for the ReplicationState const type. +func PossibleReplicationStateValues() []ReplicationState { + return []ReplicationState{CATCHUP, PENDING, SEEDING, SUSPENDED} +} + // RestorePointType enumerates the values for restore point type. type RestorePointType string @@ -395,6 +530,11 @@ const ( DISCRETE RestorePointType = "DISCRETE" ) +// PossibleRestorePointTypeValues returns an array of possible values for the RestorePointType const type. +func PossibleRestorePointTypeValues() []RestorePointType { + return []RestorePointType{CONTINUOUS, DISCRETE} +} + // SampleName enumerates the values for sample name. type SampleName string @@ -403,6 +543,11 @@ const ( AdventureWorksLT SampleName = "AdventureWorksLT" ) +// PossibleSampleNameValues returns an array of possible values for the SampleName const type. +func PossibleSampleNameValues() []SampleName { + return []SampleName{AdventureWorksLT} +} + // SecurityAlertPolicyEmailAccountAdmins enumerates the values for security alert policy email account admins. type SecurityAlertPolicyEmailAccountAdmins string @@ -413,6 +558,11 @@ const ( SecurityAlertPolicyEmailAccountAdminsEnabled SecurityAlertPolicyEmailAccountAdmins = "Enabled" ) +// PossibleSecurityAlertPolicyEmailAccountAdminsValues returns an array of possible values for the SecurityAlertPolicyEmailAccountAdmins const type. +func PossibleSecurityAlertPolicyEmailAccountAdminsValues() []SecurityAlertPolicyEmailAccountAdmins { + return []SecurityAlertPolicyEmailAccountAdmins{SecurityAlertPolicyEmailAccountAdminsDisabled, SecurityAlertPolicyEmailAccountAdminsEnabled} +} + // SecurityAlertPolicyState enumerates the values for security alert policy state. type SecurityAlertPolicyState string @@ -425,6 +575,11 @@ const ( SecurityAlertPolicyStateNew SecurityAlertPolicyState = "New" ) +// PossibleSecurityAlertPolicyStateValues returns an array of possible values for the SecurityAlertPolicyState const type. +func PossibleSecurityAlertPolicyStateValues() []SecurityAlertPolicyState { + return []SecurityAlertPolicyState{SecurityAlertPolicyStateDisabled, SecurityAlertPolicyStateEnabled, SecurityAlertPolicyStateNew} +} + // SecurityAlertPolicyUseServerDefault enumerates the values for security alert policy use server default. type SecurityAlertPolicyUseServerDefault string @@ -435,6 +590,11 @@ const ( SecurityAlertPolicyUseServerDefaultEnabled SecurityAlertPolicyUseServerDefault = "Enabled" ) +// PossibleSecurityAlertPolicyUseServerDefaultValues returns an array of possible values for the SecurityAlertPolicyUseServerDefault const type. +func PossibleSecurityAlertPolicyUseServerDefaultValues() []SecurityAlertPolicyUseServerDefault { + return []SecurityAlertPolicyUseServerDefault{SecurityAlertPolicyUseServerDefaultDisabled, SecurityAlertPolicyUseServerDefaultEnabled} +} + // ServerConnectionType enumerates the values for server connection type. type ServerConnectionType string @@ -447,6 +607,11 @@ const ( ServerConnectionTypeRedirect ServerConnectionType = "Redirect" ) +// PossibleServerConnectionTypeValues returns an array of possible values for the ServerConnectionType const type. +func PossibleServerConnectionTypeValues() []ServerConnectionType { + return []ServerConnectionType{ServerConnectionTypeDefault, ServerConnectionTypeProxy, ServerConnectionTypeRedirect} +} + // ServerKeyType enumerates the values for server key type. type ServerKeyType string @@ -457,6 +622,11 @@ const ( ServiceManaged ServerKeyType = "ServiceManaged" ) +// PossibleServerKeyTypeValues returns an array of possible values for the ServerKeyType const type. +func PossibleServerKeyTypeValues() []ServerKeyType { + return []ServerKeyType{AzureKeyVault, ServiceManaged} +} + // ServiceObjectiveName enumerates the values for service objective name. type ServiceObjectiveName string @@ -593,6 +763,11 @@ const ( ServiceObjectiveNameSystem4L ServiceObjectiveName = "System4L" ) +// PossibleServiceObjectiveNameValues returns an array of possible values for the ServiceObjectiveName const type. +func PossibleServiceObjectiveNameValues() []ServiceObjectiveName { + return []ServiceObjectiveName{ServiceObjectiveNameBasic, ServiceObjectiveNameDS100, ServiceObjectiveNameDS1000, ServiceObjectiveNameDS1200, ServiceObjectiveNameDS1500, ServiceObjectiveNameDS200, ServiceObjectiveNameDS2000, ServiceObjectiveNameDS300, ServiceObjectiveNameDS400, ServiceObjectiveNameDS500, ServiceObjectiveNameDS600, ServiceObjectiveNameDW100, ServiceObjectiveNameDW1000, ServiceObjectiveNameDW10000c, ServiceObjectiveNameDW1000c, ServiceObjectiveNameDW1200, ServiceObjectiveNameDW1500, ServiceObjectiveNameDW15000c, ServiceObjectiveNameDW1500c, ServiceObjectiveNameDW200, ServiceObjectiveNameDW2000, ServiceObjectiveNameDW2000c, ServiceObjectiveNameDW2500c, ServiceObjectiveNameDW300, ServiceObjectiveNameDW3000, ServiceObjectiveNameDW30000c, ServiceObjectiveNameDW3000c, ServiceObjectiveNameDW400, ServiceObjectiveNameDW500, ServiceObjectiveNameDW5000c, ServiceObjectiveNameDW600, ServiceObjectiveNameDW6000, ServiceObjectiveNameDW6000c, ServiceObjectiveNameDW7500c, ServiceObjectiveNameElasticPool, ServiceObjectiveNameFree, ServiceObjectiveNameP1, ServiceObjectiveNameP11, ServiceObjectiveNameP15, ServiceObjectiveNameP2, ServiceObjectiveNameP3, ServiceObjectiveNameP4, ServiceObjectiveNameP6, ServiceObjectiveNamePRS1, ServiceObjectiveNamePRS2, ServiceObjectiveNamePRS4, ServiceObjectiveNamePRS6, ServiceObjectiveNameS0, ServiceObjectiveNameS1, ServiceObjectiveNameS12, ServiceObjectiveNameS2, ServiceObjectiveNameS3, ServiceObjectiveNameS4, ServiceObjectiveNameS6, ServiceObjectiveNameS7, ServiceObjectiveNameS9, ServiceObjectiveNameSystem, ServiceObjectiveNameSystem0, ServiceObjectiveNameSystem1, ServiceObjectiveNameSystem2, ServiceObjectiveNameSystem2L, ServiceObjectiveNameSystem3, ServiceObjectiveNameSystem3L, ServiceObjectiveNameSystem4, ServiceObjectiveNameSystem4L} +} + // StorageKeyType enumerates the values for storage key type. type StorageKeyType string @@ -603,6 +778,11 @@ const ( StorageAccessKey StorageKeyType = "StorageAccessKey" ) +// PossibleStorageKeyTypeValues returns an array of possible values for the StorageKeyType const type. +func PossibleStorageKeyTypeValues() []StorageKeyType { + return []StorageKeyType{SharedAccessKey, StorageAccessKey} +} + // SyncAgentState enumerates the values for sync agent state. type SyncAgentState string @@ -615,6 +795,11 @@ const ( Online SyncAgentState = "Online" ) +// PossibleSyncAgentStateValues returns an array of possible values for the SyncAgentState const type. +func PossibleSyncAgentStateValues() []SyncAgentState { + return []SyncAgentState{NeverConnected, Offline, Online} +} + // SyncConflictResolutionPolicy enumerates the values for sync conflict resolution policy. type SyncConflictResolutionPolicy string @@ -625,6 +810,11 @@ const ( MemberWin SyncConflictResolutionPolicy = "MemberWin" ) +// PossibleSyncConflictResolutionPolicyValues returns an array of possible values for the SyncConflictResolutionPolicy const type. +func PossibleSyncConflictResolutionPolicyValues() []SyncConflictResolutionPolicy { + return []SyncConflictResolutionPolicy{HubWin, MemberWin} +} + // SyncDirection enumerates the values for sync direction. type SyncDirection string @@ -637,6 +827,11 @@ const ( OneWayMemberToHub SyncDirection = "OneWayMemberToHub" ) +// PossibleSyncDirectionValues returns an array of possible values for the SyncDirection const type. +func PossibleSyncDirectionValues() []SyncDirection { + return []SyncDirection{Bidirectional, OneWayHubToMember, OneWayMemberToHub} +} + // SyncGroupLogType enumerates the values for sync group log type. type SyncGroupLogType string @@ -651,6 +846,11 @@ const ( SyncGroupLogTypeWarning SyncGroupLogType = "Warning" ) +// PossibleSyncGroupLogTypeValues returns an array of possible values for the SyncGroupLogType const type. +func PossibleSyncGroupLogTypeValues() []SyncGroupLogType { + return []SyncGroupLogType{SyncGroupLogTypeAll, SyncGroupLogTypeError, SyncGroupLogTypeSuccess, SyncGroupLogTypeWarning} +} + // SyncGroupState enumerates the values for sync group state. type SyncGroupState string @@ -667,6 +867,11 @@ const ( Warning SyncGroupState = "Warning" ) +// PossibleSyncGroupStateValues returns an array of possible values for the SyncGroupState const type. +func PossibleSyncGroupStateValues() []SyncGroupState { + return []SyncGroupState{Error, Good, NotReady, Progressing, Warning} +} + // SyncMemberDbType enumerates the values for sync member db type. type SyncMemberDbType string @@ -677,6 +882,11 @@ const ( SQLServerDatabase SyncMemberDbType = "SqlServerDatabase" ) +// PossibleSyncMemberDbTypeValues returns an array of possible values for the SyncMemberDbType const type. +func PossibleSyncMemberDbTypeValues() []SyncMemberDbType { + return []SyncMemberDbType{AzureSQLDatabase, SQLServerDatabase} +} + // SyncMemberState enumerates the values for sync member state. type SyncMemberState string @@ -719,7 +929,13 @@ const ( UnReprovisioned SyncMemberState = "UnReprovisioned" ) -// TransparentDataEncryptionActivityStatus enumerates the values for transparent data encryption activity status. +// PossibleSyncMemberStateValues returns an array of possible values for the SyncMemberState const type. +func PossibleSyncMemberStateValues() []SyncMemberState { + return []SyncMemberState{DeProvisioned, DeProvisionFailed, DeProvisioning, DisabledBackupRestore, DisabledTombstoneCleanup, Provisioned, ProvisionFailed, Provisioning, ReprovisionFailed, Reprovisioning, SyncCancelled, SyncCancelling, SyncFailed, SyncInProgress, SyncSucceeded, SyncSucceededWithWarnings, UnProvisioned, UnReprovisioned} +} + +// TransparentDataEncryptionActivityStatus enumerates the values for transparent data encryption activity +// status. type TransparentDataEncryptionActivityStatus string const ( @@ -729,6 +945,11 @@ const ( Encrypting TransparentDataEncryptionActivityStatus = "Encrypting" ) +// PossibleTransparentDataEncryptionActivityStatusValues returns an array of possible values for the TransparentDataEncryptionActivityStatus const type. +func PossibleTransparentDataEncryptionActivityStatusValues() []TransparentDataEncryptionActivityStatus { + return []TransparentDataEncryptionActivityStatus{Decrypting, Encrypting} +} + // TransparentDataEncryptionStatus enumerates the values for transparent data encryption status. type TransparentDataEncryptionStatus string @@ -739,6 +960,11 @@ const ( TransparentDataEncryptionStatusEnabled TransparentDataEncryptionStatus = "Enabled" ) +// PossibleTransparentDataEncryptionStatusValues returns an array of possible values for the TransparentDataEncryptionStatus const type. +func PossibleTransparentDataEncryptionStatusValues() []TransparentDataEncryptionStatus { + return []TransparentDataEncryptionStatus{TransparentDataEncryptionStatusDisabled, TransparentDataEncryptionStatusEnabled} +} + // UnitDefinitionType enumerates the values for unit definition type. type UnitDefinitionType string @@ -757,6 +983,11 @@ const ( UnitDefinitionTypeSeconds UnitDefinitionType = "Seconds" ) +// PossibleUnitDefinitionTypeValues returns an array of possible values for the UnitDefinitionType const type. +func PossibleUnitDefinitionTypeValues() []UnitDefinitionType { + return []UnitDefinitionType{UnitDefinitionTypeBytes, UnitDefinitionTypeBytesPerSecond, UnitDefinitionTypeCount, UnitDefinitionTypeCountPerSecond, UnitDefinitionTypePercent, UnitDefinitionTypeSeconds} +} + // UnitType enumerates the values for unit type. type UnitType string @@ -775,6 +1006,11 @@ const ( UnitTypeSeconds UnitType = "seconds" ) +// PossibleUnitTypeValues returns an array of possible values for the UnitType const type. +func PossibleUnitTypeValues() []UnitType { + return []UnitType{UnitTypeBytes, UnitTypeBytesPerSecond, UnitTypeCount, UnitTypeCountPerSecond, UnitTypePercent, UnitTypeSeconds} +} + // VirtualNetworkRuleState enumerates the values for virtual network rule state. type VirtualNetworkRuleState string @@ -791,8 +1027,13 @@ const ( Unknown VirtualNetworkRuleState = "Unknown" ) -// BackupLongTermRetentionPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// PossibleVirtualNetworkRuleStateValues returns an array of possible values for the VirtualNetworkRuleState const type. +func PossibleVirtualNetworkRuleStateValues() []VirtualNetworkRuleState { + return []VirtualNetworkRuleState{Deleting, Initializing, InProgress, Ready, Unknown} +} + +// BackupLongTermRetentionPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. type BackupLongTermRetentionPoliciesCreateOrUpdateFuture struct { azure.Future req *http.Request @@ -804,38 +1045,76 @@ 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"` +} + +// MarshalJSON is the custom marshaler for BackupLongTermRetentionPolicy. +func (bltrp BackupLongTermRetentionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if bltrp.Location != nil { + objectMap["location"] = bltrp.Location + } + if bltrp.BackupLongTermRetentionPolicyProperties != nil { + objectMap["properties"] = bltrp.BackupLongTermRetentionPolicyProperties + } + if bltrp.ID != nil { + objectMap["id"] = bltrp.ID + } + if bltrp.Name != nil { + objectMap["name"] = bltrp.Name + } + if bltrp.Type != nil { + objectMap["type"] = bltrp.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for BackupLongTermRetentionPolicy struct. @@ -845,56 +1124,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 - } - 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 + 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.Type = &typeVar } return nil @@ -918,16 +1195,37 @@ 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"` +} + +// MarshalJSON is the custom marshaler for BackupLongTermRetentionVault. +func (bltrv BackupLongTermRetentionVault) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if bltrv.Location != nil { + objectMap["location"] = bltrv.Location + } + if bltrv.BackupLongTermRetentionVaultProperties != nil { + objectMap["properties"] = bltrv.BackupLongTermRetentionVaultProperties + } + if bltrv.ID != nil { + objectMap["id"] = bltrv.ID + } + if bltrv.Name != nil { + objectMap["name"] = bltrv.Name + } + if bltrv.Type != nil { + objectMap["type"] = bltrv.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for BackupLongTermRetentionVault struct. @@ -937,56 +1235,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 +1314,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 +1374,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 +1498,37 @@ 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"` +} + +// MarshalJSON is the custom marshaler for DatabaseBlobAuditingPolicy. +func (dbap DatabaseBlobAuditingPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dbap.Kind != nil { + objectMap["kind"] = dbap.Kind + } + if dbap.DatabaseBlobAuditingPolicyProperties != nil { + objectMap["properties"] = dbap.DatabaseBlobAuditingPolicyProperties + } + if dbap.ID != nil { + objectMap["id"] = dbap.ID + } + if dbap.Name != nil { + objectMap["name"] = dbap.Name + } + if dbap.Type != nil { + objectMap["type"] = dbap.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for DatabaseBlobAuditingPolicy struct. @@ -1181,60 +1538,58 @@ 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 - } - 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 + 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.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 -} + return nil +} // DatabaseBlobAuditingPolicyProperties properties of a database blob auditing policy. type DatabaseBlobAuditingPolicyProperties struct { @@ -1338,26 +1693,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,109 +1742,147 @@ 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. -func (dsap *DatabaseSecurityAlertPolicy) 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 DatabaseSecurityAlertPolicy. +func (dsap DatabaseSecurityAlertPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dsap.Location != nil { + objectMap["location"] = dsap.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 - } - dsap.Location = &location + if dsap.Kind != nil { + objectMap["kind"] = dsap.Kind } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - dsap.Kind = &kind + if dsap.DatabaseSecurityAlertPolicyProperties != nil { + objectMap["properties"] = dsap.DatabaseSecurityAlertPolicyProperties } - - v = m["properties"] - if v != nil { - var properties DatabaseSecurityAlertPolicyProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - dsap.DatabaseSecurityAlertPolicyProperties = &properties + if dsap.ID != nil { + objectMap["id"] = dsap.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - dsap.ID = &ID + if dsap.Name != nil { + objectMap["name"] = dsap.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - dsap.Name = &name + if dsap.Type != nil { + objectMap["type"] = dsap.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 DatabaseSecurityAlertPolicy struct. +func (dsap *DatabaseSecurityAlertPolicy) 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 + } + 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.Type = &typeVar } return nil @@ -1509,22 +1920,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 +1968,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 +2016,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 +2064,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 +2112,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 +2190,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 - } - 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 + 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.Type = &typeVar } return nil @@ -1756,87 +2271,108 @@ 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. -func (dmp *DataMaskingPolicy) 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 DataMaskingPolicy. +func (dmp DataMaskingPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dmp.DataMaskingPolicyProperties != nil { + objectMap["properties"] = dmp.DataMaskingPolicyProperties } - 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 + if dmp.Location != nil { + objectMap["location"] = dmp.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - dmp.Location = &location + if dmp.Kind != nil { + objectMap["kind"] = dmp.Kind } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - dmp.Kind = &kind + if dmp.ID != nil { + objectMap["id"] = dmp.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - dmp.ID = &ID + if dmp.Name != nil { + objectMap["name"] = dmp.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - dmp.Name = &name + if dmp.Type != nil { + objectMap["type"] = dmp.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 DataMaskingPolicy struct. +func (dmp *DataMaskingPolicy) 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 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.Type = &typeVar } return nil @@ -1857,87 +2393,108 @@ 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. -func (dmr *DataMaskingRule) 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 DataMaskingRule. +func (dmr DataMaskingRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dmr.DataMaskingRuleProperties != nil { + objectMap["properties"] = dmr.DataMaskingRuleProperties } - 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 + if dmr.Location != nil { + objectMap["location"] = dmr.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - dmr.Location = &location + if dmr.Kind != nil { + objectMap["kind"] = dmr.Kind } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - dmr.Kind = &kind + if dmr.ID != nil { + objectMap["id"] = dmr.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - dmr.ID = &ID + if dmr.Name != nil { + objectMap["name"] = dmr.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - dmr.Name = &name + if dmr.Type != nil { + objectMap["type"] = dmr.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 DataMaskingRule struct. +func (dmr *DataMaskingRule) 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 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.Type = &typeVar } return nil @@ -1993,20 +2550,47 @@ 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"` +} + +// 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 + } + if ep.Kind != nil { + objectMap["kind"] = ep.Kind + } + if ep.Tags != nil { + objectMap["tags"] = ep.Tags + } + if ep.Location != nil { + objectMap["location"] = ep.Location + } + if ep.ID != nil { + objectMap["id"] = ep.ID + } + if ep.Name != nil { + objectMap["name"] = ep.Name + } + if ep.Type != nil { + objectMap["type"] = ep.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ElasticPool struct. @@ -2016,93 +2600,110 @@ func (ep *ElasticPool) UnmarshalJSON(body []byte) error { if err != nil { return err } - 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 - } - - 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["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - ep.Tags = &tags - } - - 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 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.Location = &location } - 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 - } - ep.Type = &typeVar - } - - return nil -} + return nil +} // 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"` +} + +// MarshalJSON is the custom marshaler for ElasticPoolActivity. +func (epa ElasticPoolActivity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if epa.Location != nil { + objectMap["location"] = epa.Location + } + if epa.ElasticPoolActivityProperties != nil { + objectMap["properties"] = epa.ElasticPoolActivityProperties + } + if epa.ID != nil { + objectMap["id"] = epa.ID + } + if epa.Name != nil { + objectMap["name"] = epa.Name + } + if epa.Type != nil { + objectMap["type"] = epa.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ElasticPoolActivity struct. @@ -2112,56 +2713,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 - } - 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 + 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.Type = &typeVar } return nil @@ -2220,16 +2819,37 @@ type ElasticPoolActivityProperties struct { // ElasticPoolDatabaseActivity represents the activity on an elastic pool. type ElasticPoolDatabaseActivity struct { + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ElasticPoolDatabaseActivityProperties - The properties representing the resource. + *ElasticPoolDatabaseActivityProperties `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"` - // ElasticPoolDatabaseActivityProperties - The properties representing the resource. - *ElasticPoolDatabaseActivityProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ElasticPoolDatabaseActivity. +func (epda ElasticPoolDatabaseActivity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if epda.Location != nil { + objectMap["location"] = epda.Location + } + if epda.ElasticPoolDatabaseActivityProperties != nil { + objectMap["properties"] = epda.ElasticPoolDatabaseActivityProperties + } + if epda.ID != nil { + objectMap["id"] = epda.ID + } + if epda.Name != nil { + objectMap["name"] = epda.Name + } + if epda.Type != nil { + objectMap["type"] = epda.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ElasticPoolDatabaseActivity struct. @@ -2239,56 +2859,54 @@ func (epda *ElasticPoolDatabaseActivity) 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 - } - 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 - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - epda.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 + } + 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 +3047,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 +3095,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 +3173,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,87 +3229,108 @@ 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. -func (ep *EncryptionProtector) 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 EncryptionProtector. +func (ep EncryptionProtector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ep.Kind != nil { + objectMap["kind"] = ep.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 - } - ep.Kind = &kind + 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.EncryptionProtectorProperties != nil { + objectMap["properties"] = ep.EncryptionProtectorProperties } - - v = m["properties"] - if v != nil { - var properties EncryptionProtectorProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - ep.EncryptionProtectorProperties = &properties + 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 EncryptionProtector struct. +func (ep *EncryptionProtector) 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 + } + 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 +3452,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 +3465,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 +3520,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 +3772,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 +3820,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 +3869,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 +3918,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 +3966,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 +4007,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 +4029,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 + 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.FailoverGroupUpdateProperties = &properties - } - - v = m["tags"] - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*m["tags"], &tags) - if err != nil { - return err - } - fgu.Tags = &tags } return nil @@ -3239,87 +4068,108 @@ 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. -func (fr *FirewallRule) 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 FirewallRule. +func (fr FirewallRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fr.Kind != nil { + objectMap["kind"] = fr.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 - } - fr.Kind = &kind + if fr.Location != nil { + objectMap["location"] = fr.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - fr.Location = &location + if fr.FirewallRuleProperties != nil { + objectMap["properties"] = fr.FirewallRuleProperties } - - v = m["properties"] - if v != nil { - var properties FirewallRuleProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - fr.FirewallRuleProperties = &properties + if fr.ID != nil { + objectMap["id"] = fr.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - fr.ID = &ID + if fr.Name != nil { + objectMap["name"] = fr.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - fr.Name = &name + if fr.Type != nil { + objectMap["type"] = fr.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 FirewallRule struct. +func (fr *FirewallRule) 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 + } + 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 +4193,108 @@ 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"` + // 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 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 +// MarshalJSON is the custom marshaler for GeoBackupPolicy. +func (gbp GeoBackupPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gbp.GeoBackupPolicyProperties != nil { + objectMap["properties"] = gbp.GeoBackupPolicyProperties } - 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 + if gbp.Kind != nil { + objectMap["kind"] = gbp.Kind } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - gbp.Kind = &kind + if gbp.Location != nil { + objectMap["location"] = gbp.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - gbp.Location = &location + if gbp.ID != nil { + objectMap["id"] = gbp.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - gbp.ID = &ID + if gbp.Name != nil { + objectMap["name"] = gbp.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - gbp.Name = &name + if gbp.Type != nil { + objectMap["type"] = gbp.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 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 + } + 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 +4318,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for ImportExportResponse. +func (ier ImportExportResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ier.ImportExportResponseProperties != nil { + objectMap["properties"] = ier.ImportExportResponseProperties + } + if ier.ID != nil { + objectMap["id"] = ier.ID + } + if ier.Name != nil { + objectMap["name"] = ier.Name + } + if ier.Type != nil { + objectMap["type"] = ier.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ImportExportResponse struct. @@ -3464,46 +4353,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 +4421,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 +4435,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. @@ -3559,6 +4447,21 @@ type ImportExtensionRequest struct { *ImportExtensionProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for ImportExtensionRequest. +func (ier ImportExtensionRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ier.Name != nil { + objectMap["name"] = ier.Name + } + if ier.Type != nil { + objectMap["type"] = ier.Type + } + if ier.ImportExtensionProperties != nil { + objectMap["properties"] = ier.ImportExtensionProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for ImportExtensionRequest struct. func (ier *ImportExtensionRequest) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -3566,36 +4469,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 +4506,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 +4526,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 +4638,25 @@ 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 + } + if o.Origin != "" { + 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 +4816,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for RecommendedElasticPool. +func (rep RecommendedElasticPool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rep.RecommendedElasticPoolProperties != nil { + objectMap["properties"] = rep.RecommendedElasticPoolProperties + } + if rep.ID != nil { + objectMap["id"] = rep.ID + } + if rep.Name != nil { + objectMap["name"] = rep.Name + } + if rep.Type != nil { + objectMap["type"] = rep.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for RecommendedElasticPool struct. @@ -3912,52 +4851,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 + 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.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - 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 +4948,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for RecommendedIndex. +func (ri RecommendedIndex) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ri.RecommendedIndexProperties != nil { + objectMap["properties"] = ri.RecommendedIndexProperties + } + if ri.ID != nil { + objectMap["id"] = ri.ID + } + if ri.Name != nil { + objectMap["name"] = ri.Name + } + if ri.Type != nil { + objectMap["type"] = ri.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for RecommendedIndex struct. @@ -4026,46 +4983,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 +5058,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for RecoverableDatabase. +func (rd RecoverableDatabase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rd.RecoverableDatabaseProperties != nil { + objectMap["properties"] = rd.RecoverableDatabaseProperties + } + if rd.ID != nil { + objectMap["id"] = rd.ID + } + if rd.Name != nil { + objectMap["name"] = rd.Name + } + if rd.Type != nil { + objectMap["type"] = rd.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for RecoverableDatabase struct. @@ -4119,46 +5093,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 +5159,37 @@ 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"` +} + +// MarshalJSON is the custom marshaler for ReplicationLink. +func (rl ReplicationLink) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rl.Location != nil { + objectMap["location"] = rl.Location + } + if rl.ReplicationLinkProperties != nil { + objectMap["properties"] = rl.ReplicationLinkProperties + } + if rl.ID != nil { + objectMap["id"] = rl.ID + } + if rl.Name != nil { + objectMap["name"] = rl.Name + } + if rl.Type != nil { + objectMap["type"] = rl.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ReplicationLink struct. @@ -4205,56 +5199,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 +5296,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 +5345,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 +5404,37 @@ 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"` +} + +// MarshalJSON is the custom marshaler for RestorableDroppedDatabase. +func (rdd RestorableDroppedDatabase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rdd.Location != nil { + objectMap["location"] = rdd.Location + } + if rdd.RestorableDroppedDatabaseProperties != nil { + objectMap["properties"] = rdd.RestorableDroppedDatabaseProperties + } + if rdd.ID != nil { + objectMap["id"] = rdd.ID + } + if rdd.Name != nil { + objectMap["name"] = rdd.Name + } + if rdd.Type != nil { + objectMap["type"] = rdd.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for RestorableDroppedDatabase struct. @@ -4396,56 +5444,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 +5526,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for RestorePoint. +func (rp RestorePoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rp.RestorePointProperties != nil { + objectMap["properties"] = rp.RestorePointProperties + } + if rp.ID != nil { + objectMap["id"] = rp.ID + } + if rp.Name != nil { + objectMap["name"] = rp.Name + } + if rp.Type != nil { + objectMap["type"] = rp.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for RestorePoint struct. @@ -4497,46 +5561,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 +5625,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 } - - 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 "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 +5782,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for ServerAzureADAdministrator. +func (saaa ServerAzureADAdministrator) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if saaa.ServerAdministratorProperties != nil { + objectMap["properties"] = saaa.ServerAdministratorProperties + } + if saaa.ID != nil { + objectMap["id"] = saaa.ID + } + if saaa.Name != nil { + objectMap["name"] = saaa.Name + } + if saaa.Type != nil { + objectMap["type"] = saaa.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ServerAzureADAdministrator struct. @@ -4711,46 +5817,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 + 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.Name = &name - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - saaa.Type = &typeVar } return nil @@ -4769,27 +5874,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,109 +5923,147 @@ 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. -func (scl *ServerCommunicationLink) 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 ServerCommunicationLink. +func (scl ServerCommunicationLink) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scl.ServerCommunicationLinkProperties != nil { + objectMap["properties"] = scl.ServerCommunicationLinkProperties } - 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 + if scl.Location != nil { + objectMap["location"] = scl.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - scl.Location = &location + if scl.Kind != nil { + objectMap["kind"] = scl.Kind } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - scl.Kind = &kind + if scl.ID != nil { + objectMap["id"] = scl.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - scl.ID = &ID + if scl.Name != nil { + objectMap["name"] = scl.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - scl.Name = &name + if scl.Type != nil { + objectMap["type"] = scl.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 ServerCommunicationLink struct. +func (scl *ServerCommunicationLink) 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 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,109 +6097,147 @@ 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. -func (scp *ServerConnectionPolicy) 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 ServerConnectionPolicy. +func (scp ServerConnectionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scp.Kind != nil { + objectMap["kind"] = scp.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 - } - scp.Kind = &kind + if scp.Location != nil { + objectMap["location"] = scp.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - scp.Location = &location + if scp.ServerConnectionPolicyProperties != nil { + objectMap["properties"] = scp.ServerConnectionPolicyProperties } - - v = m["properties"] - if v != nil { - var properties ServerConnectionPolicyProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - scp.ServerConnectionPolicyProperties = &properties + if scp.ID != nil { + objectMap["id"] = scp.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - scp.ID = &ID + if scp.Name != nil { + objectMap["name"] = scp.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - scp.Name = &name + if scp.Type != nil { + objectMap["type"] = scp.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 ServerConnectionPolicy struct. +func (scp *ServerConnectionPolicy) 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 + } + 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,87 +6252,108 @@ 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. -func (sk *ServerKey) 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 ServerKey. +func (sk ServerKey) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sk.Kind != nil { + objectMap["kind"] = sk.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 - } - sk.Kind = &kind + if sk.Location != nil { + objectMap["location"] = sk.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - sk.Location = &location + if sk.ServerKeyProperties != nil { + objectMap["properties"] = sk.ServerKeyProperties } - - v = m["properties"] - if v != nil { - var properties ServerKeyProperties - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - sk.ServerKeyProperties = &properties + if sk.ID != nil { + objectMap["id"] = sk.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - sk.ID = &ID + if sk.Name != nil { + objectMap["name"] = sk.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - sk.Name = &name + if sk.Type != nil { + objectMap["type"] = sk.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 ServerKey struct. +func (sk *ServerKey) 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 + } + 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 +6475,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 +6488,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 +6536,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 +6688,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 +6701,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 +6749,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 +6797,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 +6838,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 +6860,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 +6946,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for ServiceObjective. +func (so ServiceObjective) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if so.ServiceObjectiveProperties != nil { + objectMap["properties"] = so.ServiceObjectiveProperties + } + if so.ID != nil { + objectMap["id"] = so.ID + } + if so.Name != nil { + objectMap["name"] = so.Name + } + if so.Type != nil { + objectMap["type"] = so.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ServiceObjective struct. @@ -5644,46 +6981,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 +7049,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for ServiceTierAdvisor. +func (sta ServiceTierAdvisor) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sta.ServiceTierAdvisorProperties != nil { + objectMap["properties"] = sta.ServiceTierAdvisorProperties + } + if sta.ID != nil { + objectMap["id"] = sta.ID + } + if sta.Name != nil { + objectMap["name"] = sta.Name + } + if sta.Type != nil { + objectMap["type"] = sta.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ServiceTierAdvisor struct. @@ -5730,46 +7084,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,14 +7190,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for SubscriptionUsage. +func (su SubscriptionUsage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if su.SubscriptionUsageProperties != nil { + objectMap["properties"] = su.SubscriptionUsageProperties + } + if su.ID != nil { + objectMap["id"] = su.ID + } + if su.Name != nil { + objectMap["name"] = su.Name + } + if su.Type != nil { + objectMap["type"] = su.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for SubscriptionUsage struct. @@ -5854,46 +7225,45 @@ func (su *SubscriptionUsage) UnmarshalJSON(body []byte) error { 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 - } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - su.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 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 +7386,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for SyncAgent. +func (sa SyncAgent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sa.SyncAgentProperties != nil { + objectMap["properties"] = sa.SyncAgentProperties + } + if sa.ID != nil { + objectMap["id"] = sa.ID + } + if sa.Name != nil { + objectMap["name"] = sa.Name + } + if sa.Type != nil { + objectMap["type"] = sa.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for SyncAgent struct. @@ -6033,46 +7421,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 +7474,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for SyncAgentLinkedDatabase. +func (sald SyncAgentLinkedDatabase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sald.SyncAgentLinkedDatabaseProperties != nil { + objectMap["properties"] = sald.SyncAgentLinkedDatabaseProperties + } + if sald.ID != nil { + objectMap["id"] = sald.ID + } + if sald.Name != nil { + objectMap["name"] = sald.Name + } + if sald.Type != nil { + objectMap["type"] = sald.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for SyncAgentLinkedDatabase struct. @@ -6104,46 +7509,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 +7562,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 +7792,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 +7805,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 +7853,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 +8014,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 +8143,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for SyncGroup. +func (sg SyncGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sg.SyncGroupProperties != nil { + objectMap["properties"] = sg.SyncGroupProperties + } + if sg.ID != nil { + objectMap["id"] = sg.ID + } + if sg.Name != nil { + objectMap["name"] = sg.Name + } + if sg.Type != nil { + objectMap["type"] = sg.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for SyncGroup struct. @@ -6719,46 +8178,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 +8488,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 +8501,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 +8549,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 +8598,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 +8646,71 @@ 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"` +} + +// MarshalJSON is the custom marshaler for SyncMember. +func (sm SyncMember) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sm.SyncMemberProperties != nil { + objectMap["properties"] = sm.SyncMemberProperties + } + if sm.ID != nil { + objectMap["id"] = sm.ID + } + if sm.Name != nil { + objectMap["name"] = sm.Name + } + if sm.Type != nil { + objectMap["type"] = sm.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for SyncMember struct. @@ -7175,46 +8720,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 +8901,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 +8949,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 +8998,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 +9046,111 @@ 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"` +} + +// MarshalJSON is the custom marshaler for TransparentDataEncryption. +func (tde TransparentDataEncryption) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tde.Location != nil { + objectMap["location"] = tde.Location + } + if tde.TransparentDataEncryptionProperties != nil { + objectMap["properties"] = tde.TransparentDataEncryptionProperties + } + if tde.ID != nil { + objectMap["id"] = tde.ID + } + if tde.Name != nil { + objectMap["name"] = tde.Name + } + if tde.Type != nil { + objectMap["type"] = tde.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for TransparentDataEncryption struct. @@ -7506,56 +9160,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 +9215,37 @@ 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"` +} + +// MarshalJSON is the custom marshaler for TransparentDataEncryptionActivity. +func (tdea TransparentDataEncryptionActivity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tdea.Location != nil { + objectMap["location"] = tdea.Location + } + if tdea.TransparentDataEncryptionActivityProperties != nil { + objectMap["properties"] = tdea.TransparentDataEncryptionActivityProperties + } + if tdea.ID != nil { + objectMap["id"] = tdea.ID + } + if tdea.Name != nil { + objectMap["name"] = tdea.Name + } + if tdea.Type != nil { + objectMap["type"] = tdea.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for TransparentDataEncryptionActivity struct. @@ -7582,63 +9255,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 +9334,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for VirtualNetworkRule. +func (vnr VirtualNetworkRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vnr.VirtualNetworkRuleProperties != nil { + objectMap["properties"] = vnr.VirtualNetworkRuleProperties + } + if vnr.ID != nil { + objectMap["id"] = vnr.ID + } + if vnr.Name != nil { + objectMap["name"] = vnr.Name + } + if vnr.Type != nil { + objectMap["type"] = vnr.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for VirtualNetworkRule struct. @@ -7680,46 +9369,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 +9525,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 +9538,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 +9587,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..ebdf54805877 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), @@ -91,7 +90,7 @@ func (client ServerAzureADAdministratorsClient) CreateOrUpdatePreparer(ctx conte } 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.Sql/servers/{serverName}/administrators/{administratorName}", pathParameters), @@ -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..cb2a1fdd2420 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) @@ -85,7 +86,7 @@ func (client ServerCommunicationLinksClient) CreateOrUpdatePreparer(ctx context. } 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.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}", pathParameters), @@ -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..1c02e43b9664 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), @@ -83,7 +83,7 @@ func (client ServerConnectionPoliciesClient) CreateOrUpdatePreparer(ctx context. } 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.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}", pathParameters), @@ -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..1808980a453e 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 { @@ -80,7 +81,7 @@ func (client ServerKeysClient) CreateOrUpdatePreparer(ctx context.Context, resou } 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.Sql/servers/{serverName}/keys/{keyName}", pathParameters), @@ -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..9fe738737cea 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) @@ -86,7 +86,7 @@ func (client ServersClient) CheckNameAvailabilityPreparer(ctx context.Context, p } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Sql/checkNameAvailability", pathParameters), @@ -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 { @@ -150,7 +150,7 @@ func (client ServersClient) CreateOrUpdatePreparer(ctx context.Context, resource } 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.Sql/servers/{serverName}", pathParameters), @@ -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 { @@ -541,7 +541,7 @@ func (client ServersClient) UpdatePreparer(ctx context.Context, resourceGroupNam } 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.Sql/servers/{serverName}", pathParameters), 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..97ebdca602ea 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 { @@ -77,7 +77,7 @@ func (client SyncAgentsClient) CreateOrUpdatePreparer(ctx context.Context, resou } 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.Sql/servers/{serverName}/syncAgents/{syncAgentName}", pathParameters), @@ -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..b08ba72a70d1 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 { @@ -148,7 +148,7 @@ func (client SyncGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resou } 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.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}", pathParameters), @@ -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 { @@ -898,7 +898,7 @@ func (client SyncGroupsClient) UpdatePreparer(ctx context.Context, resourceGroup } 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.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}", pathParameters), 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..57554de42517 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 { @@ -80,7 +81,7 @@ func (client SyncMembersClient) CreateOrUpdatePreparer(ctx context.Context, reso } 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.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}", pathParameters), @@ -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 { @@ -572,7 +574,7 @@ func (client SyncMembersClient) UpdatePreparer(ctx context.Context, resourceGrou } 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.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}", pathParameters), 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..87c20526f6ad 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" @@ -86,7 +85,7 @@ func (client TransparentDataEncryptionsClient) CreateOrUpdatePreparer(ctx contex } 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.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{transparentDataEncryptionName}", pathParameters), @@ -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..336c296db9ff 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) @@ -85,7 +85,7 @@ func (client VirtualNetworkRulesClient) CreateOrUpdatePreparer(ctx context.Conte } 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.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", pathParameters), @@ -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..d5913cdefb7e 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), } @@ -84,20 +85,19 @@ func (client AccountsClient) CheckNameAvailabilityPreparer(accountName AccountCh } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), 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), @@ -196,22 +173,28 @@ func (client AccountsClient) CreatePreparer(resourceGroupName string, accountNam } 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.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), @@ -506,20 +486,19 @@ func (client AccountsClient) ListAccountSASPreparer(resourceGroupName string, ac } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), 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), @@ -748,20 +726,19 @@ func (client AccountsClient) ListServiceSASPreparer(resourceGroupName string, ac } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), 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), @@ -833,20 +810,19 @@ func (client AccountsClient) RegenerateKeyPreparer(resourceGroupName string, acc } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), 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), @@ -921,20 +897,19 @@ func (client AccountsClient) UpdatePreparer(resourceGroupName string, accountNam } 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.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..9e31bb4e522d 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,588 +18,1291 @@ 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" ) +// PossibleAccessTierValues returns an array of possible values for the AccessTier const type. +func PossibleAccessTierValues() []AccessTier { + return []AccessTier{Cool, Hot} +} + // AccountStatus enumerates the values for account status. 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" ) +// PossibleAccountStatusValues returns an array of possible values for the AccountStatus const type. +func PossibleAccountStatusValues() []AccountStatus { + return []AccountStatus{Available, Unavailable} +} + // Action enumerates the values for action. type Action string const ( - // Allow specifies the allow state for action. + // Allow ... Allow Action = "Allow" ) +// PossibleActionValues returns an array of possible values for the Action const type. +func PossibleActionValues() []Action { + return []Action{Allow} +} + // Bypass enumerates the values for bypass. 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" ) +// PossibleBypassValues returns an array of possible values for the Bypass const type. +func PossibleBypassValues() []Bypass { + return []Bypass{AzureServices, Logging, Metrics, None} +} + // DefaultAction enumerates the values for default action. 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" ) +// PossibleDefaultActionValues returns an array of possible values for the DefaultAction const type. +func PossibleDefaultActionValues() []DefaultAction { + return []DefaultAction{DefaultActionAllow, DefaultActionDeny} +} + // HTTPProtocol enumerates the values for http protocol. 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" ) +// PossibleHTTPProtocolValues returns an array of possible values for the HTTPProtocol const type. +func PossibleHTTPProtocolValues() []HTTPProtocol { + return []HTTPProtocol{HTTPS, Httpshttp} +} + // KeyPermission enumerates the values for key permission. 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" ) +// PossibleKeyPermissionValues returns an array of possible values for the KeyPermission const type. +func PossibleKeyPermissionValues() []KeyPermission { + return []KeyPermission{Full, Read} +} + // KeySource enumerates the values for key source. 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" ) +// PossibleKeySourceValues returns an array of possible values for the KeySource const type. +func PossibleKeySourceValues() []KeySource { + return []KeySource{MicrosoftKeyvault, MicrosoftStorage} +} + // Kind enumerates the values for kind. 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" ) +// PossibleKindValues returns an array of possible values for the Kind const type. +func PossibleKindValues() []Kind { + return []Kind{BlobStorage, Storage, StorageV2} +} + // Permissions enumerates the values for permissions. 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" ) +// PossiblePermissionsValues returns an array of possible values for the Permissions const type. +func PossiblePermissionsValues() []Permissions { + return []Permissions{A, C, D, L, P, R, U, W} +} + // ProvisioningState enumerates the values for provisioning state. 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" ) +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{Creating, ResolvingDNS, Succeeded} +} + // Reason enumerates the values for reason. 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" ) +// PossibleReasonValues returns an array of possible values for the Reason const type. +func PossibleReasonValues() []Reason { + return []Reason{AccountNameInvalid, AlreadyExists} +} + // ReasonCode enumerates the values for reason code. 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" ) +// PossibleReasonCodeValues returns an array of possible values for the ReasonCode const type. +func PossibleReasonCodeValues() []ReasonCode { + return []ReasonCode{NotAvailableForSubscription, QuotaID} +} + // Services enumerates the values for services. 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" ) +// PossibleServicesValues returns an array of possible values for the Services const type. +func PossibleServicesValues() []Services { + return []Services{B, F, Q, T} +} + // SignedResource enumerates the values for signed resource. 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" ) +// PossibleSignedResourceValues returns an array of possible values for the SignedResource const type. +func PossibleSignedResourceValues() []SignedResource { + return []SignedResource{SignedResourceB, SignedResourceC, SignedResourceF, SignedResourceS} +} + // SignedResourceTypes enumerates the values for signed resource types. 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" ) +// PossibleSignedResourceTypesValues returns an array of possible values for the SignedResourceTypes const type. +func PossibleSignedResourceTypesValues() []SignedResourceTypes { + return []SignedResourceTypes{SignedResourceTypesC, SignedResourceTypesO, SignedResourceTypesS} +} + // SkuName enumerates the values for sku name. 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" ) +// PossibleSkuNameValues returns an array of possible values for the SkuName const type. +func PossibleSkuNameValues() []SkuName { + return []SkuName{PremiumLRS, StandardGRS, StandardLRS, StandardRAGRS, StandardZRS} +} + // SkuTier enumerates the values for sku tier. 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" ) +// PossibleSkuTierValues returns an array of possible values for the SkuTier const type. +func PossibleSkuTierValues() []SkuTier { + return []SkuTier{Premium, Standard} +} + // State enumerates the values for state. 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" ) +// PossibleStateValues returns an array of possible values for the State const type. +func PossibleStateValues() []State { + return []State{StateDeprovisioning, StateFailed, StateNetworkSourceDeleted, StateProvisioning, StateSucceeded} +} + // UsageUnit enumerates the values for usage unit. 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. +// PossibleUsageUnitValues returns an array of possible values for the UsageUnit const type. +func PossibleUsageUnitValues() []UsageUnit { + return []UsageUnit{Bytes, BytesPerSecond, Count, CountsPerSecond, Percent, Seconds} +} + +// 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"` +} + +// MarshalJSON is the custom marshaler for Account. +func (a Account) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.Sku != nil { + objectMap["sku"] = a.Sku + } + if a.Kind != "" { + objectMap["kind"] = a.Kind + } + if a.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) } -// AccountCheckNameAvailabilityParameters is the parameters used to check the availabity of the storage account name. +// 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 + } + if acp.Kind != "" { + 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 + } + if aup.Kind != "" { + objectMap["kind"] = aup.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AccountUpdateParameters struct. +func (aup *AccountUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "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 is the CheckNameAvailability operation response. +// 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. +// 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 + } + if o.Origin != nil { + objectMap["origin"] = o.Origin + } + if o.OperationProperties != nil { + objectMap["properties"] = o.OperationProperties + } + return json.Marshal(objectMap) +} + +// 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..ae3713ca7dae 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 @@ -83,7 +83,7 @@ func (client EndpointsClient) CreateOrUpdatePreparer(ctx context.Context, resour } 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/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}", pathParameters), @@ -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) @@ -296,7 +296,7 @@ func (client EndpointsClient) UpdatePreparer(ctx context.Context, resourceGroupN } 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/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}", pathParameters), 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..89e3cf12c2de 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 @@ -40,6 +40,11 @@ const ( Stopped EndpointMonitorStatus = "Stopped" ) +// PossibleEndpointMonitorStatusValues returns an array of possible values for the EndpointMonitorStatus const type. +func PossibleEndpointMonitorStatusValues() []EndpointMonitorStatus { + return []EndpointMonitorStatus{CheckingEndpoint, Degraded, Disabled, Inactive, Online, Stopped} +} + // EndpointStatus enumerates the values for endpoint status. type EndpointStatus string @@ -50,6 +55,11 @@ const ( EndpointStatusEnabled EndpointStatus = "Enabled" ) +// PossibleEndpointStatusValues returns an array of possible values for the EndpointStatus const type. +func PossibleEndpointStatusValues() []EndpointStatus { + return []EndpointStatus{EndpointStatusDisabled, EndpointStatusEnabled} +} + // MonitorProtocol enumerates the values for monitor protocol. type MonitorProtocol string @@ -62,6 +72,11 @@ const ( TCP MonitorProtocol = "TCP" ) +// PossibleMonitorProtocolValues returns an array of possible values for the MonitorProtocol const type. +func PossibleMonitorProtocolValues() []MonitorProtocol { + return []MonitorProtocol{HTTP, HTTPS, TCP} +} + // ProfileMonitorStatus enumerates the values for profile monitor status. type ProfileMonitorStatus string @@ -78,6 +93,11 @@ const ( ProfileMonitorStatusOnline ProfileMonitorStatus = "Online" ) +// PossibleProfileMonitorStatusValues returns an array of possible values for the ProfileMonitorStatus const type. +func PossibleProfileMonitorStatusValues() []ProfileMonitorStatus { + return []ProfileMonitorStatus{ProfileMonitorStatusCheckingEndpoints, ProfileMonitorStatusDegraded, ProfileMonitorStatusDisabled, ProfileMonitorStatusInactive, ProfileMonitorStatusOnline} +} + // ProfileStatus enumerates the values for profile status. type ProfileStatus string @@ -88,6 +108,11 @@ const ( ProfileStatusEnabled ProfileStatus = "Enabled" ) +// PossibleProfileStatusValues returns an array of possible values for the ProfileStatus const type. +func PossibleProfileStatusValues() []ProfileStatus { + return []ProfileStatus{ProfileStatusDisabled, ProfileStatusEnabled} +} + // TrafficRoutingMethod enumerates the values for traffic routing method. type TrafficRoutingMethod string @@ -102,6 +127,11 @@ const ( Weighted TrafficRoutingMethod = "Weighted" ) +// PossibleTrafficRoutingMethodValues returns an array of possible values for the TrafficRoutingMethod const type. +func PossibleTrafficRoutingMethodValues() []TrafficRoutingMethod { + return []TrafficRoutingMethod{Geographic, Performance, Priority, Weighted} +} + // CheckTrafficManagerRelativeDNSNameAvailabilityParameters parameters supplied to check Traffic Manager name // operation. type CheckTrafficManagerRelativeDNSNameAvailabilityParameters struct { @@ -149,14 +179,32 @@ 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"` +} + +// 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 + } + if e.ID != nil { + objectMap["id"] = e.ID + } + if e.Name != nil { + objectMap["name"] = e.Name + } + if e.Type != nil { + objectMap["type"] = e.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for Endpoint struct. @@ -166,46 +214,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 - } - e.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 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.Type = &typeVar } return nil @@ -236,14 +283,32 @@ 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"` +} + +// MarshalJSON is the custom marshaler for GeographicHierarchy. +func (gh GeographicHierarchy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gh.GeographicHierarchyProperties != nil { + objectMap["properties"] = gh.GeographicHierarchyProperties + } + if gh.ID != nil { + objectMap["id"] = gh.ID + } + if gh.Name != nil { + objectMap["name"] = gh.Name + } + if gh.Type != nil { + objectMap["type"] = gh.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for GeographicHierarchy struct. @@ -253,53 +318,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 - } - gh.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 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.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 +405,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 +533,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 +566,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..e074287cac5e 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 @@ -72,7 +72,7 @@ func (client ProfilesClient) CheckTrafficManagerRelativeDNSNameAvailabilityPrepa } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPath("/providers/Microsoft.Network/checkTrafficManagerNameAvailability"), @@ -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 { @@ -142,7 +142,7 @@ func (client ProfilesClient) CreateOrUpdatePreparer(ctx context.Context, resourc } 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/trafficmanagerprofiles/{profileName}", pathParameters), @@ -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) @@ -473,7 +473,7 @@ func (client ProfilesClient) UpdatePreparer(ctx context.Context, resourceGroupNa } 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/trafficmanagerprofiles/{profileName}", pathParameters), 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..1159b5edb59f 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) @@ -89,7 +89,7 @@ func (client AppsClient) AddPremierAddOnPreparer(ctx context.Context, resourceGr } 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.Web/sites/{name}/premieraddons/{premierAddOnName}", pathParameters), @@ -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) @@ -169,7 +170,7 @@ func (client AppsClient) AddPremierAddOnSlotPreparer(ctx context.Context, resour } 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.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}", pathParameters), @@ -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) @@ -406,7 +407,7 @@ func (client AppsClient) ApplySlotConfigToProductionPreparer(ctx context.Context } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/applySlotConfig", pathParameters), @@ -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) @@ -487,7 +488,7 @@ func (client AppsClient) ApplySlotConfigurationSlotPreparer(ctx context.Context, } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/applySlotConfig", pathParameters), @@ -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) @@ -573,7 +574,7 @@ func (client AppsClient) BackupPreparer(ctx context.Context, resourceGroupName s } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backup", pathParameters), @@ -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) @@ -662,7 +663,7 @@ func (client AppsClient) BackupSlotPreparer(ctx context.Context, resourceGroupNa } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backup", pathParameters), @@ -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) @@ -740,7 +741,7 @@ func (client AppsClient) CreateDeploymentPreparer(ctx context.Context, resourceG } 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.Web/sites/{name}/deployments/{id}", pathParameters), @@ -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) @@ -820,7 +821,7 @@ func (client AppsClient) CreateDeploymentSlotPreparer(ctx context.Context, resou } 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.Web/sites/{name}/slots/{slot}/deployments/{id}", pathParameters), @@ -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) @@ -892,7 +893,7 @@ func (client AppsClient) CreateFunctionPreparer(ctx context.Context, resourceGro } 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.Web/sites/{name}/functions/{functionName}", pathParameters), @@ -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) @@ -974,7 +975,7 @@ func (client AppsClient) CreateInstanceFunctionSlotPreparer(ctx context.Context, } 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.Web/sites/{name}/slots/{slot}/functions/{functionName}", pathParameters), @@ -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) @@ -1054,7 +1055,7 @@ func (client AppsClient) CreateInstanceMSDeployOperationPreparer(ctx context.Con } 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.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy", pathParameters), @@ -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) @@ -1136,7 +1137,7 @@ func (client AppsClient) CreateInstanceMSDeployOperationSlotPreparer(ctx context } 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.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy", pathParameters), @@ -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) @@ -1215,7 +1216,7 @@ func (client AppsClient) CreateMSDeployOperationPreparer(ctx context.Context, re } 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.Web/sites/{name}/extensions/MSDeploy", pathParameters), @@ -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) @@ -1295,7 +1297,7 @@ func (client AppsClient) CreateMSDeployOperationSlotPreparer(ctx context.Context } 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.Web/sites/{name}/slots/{slot}/extensions/MSDeploy", pathParameters), @@ -1336,12 +1338,8 @@ 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 -// 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. -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) { +// representation of the app properties. See example. +func (client AppsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, name string, siteEnvelope Site) (result AppsCreateOrUpdateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, @@ -1362,10 +1360,10 @@ 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) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, name, siteEnvelope) if err != nil { err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -1381,7 +1379,7 @@ func (client AppsClient) CreateOrUpdate(ctx context.Context, resourceGroupName s } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client AppsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, name string, siteEnvelope Site, skipDNSRegistration *bool, skipCustomDomainVerification *bool, forceDNSRegistration *bool, TTLInSeconds string) (*http.Request, error) { +func (client AppsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, name string, siteEnvelope Site) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -1392,21 +1390,9 @@ func (client AppsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGro queryParameters := map[string]interface{}{ "api-version": APIVersion, } - if skipDNSRegistration != nil { - queryParameters["skipDnsRegistration"] = autorest.Encode("query", *skipDNSRegistration) - } - if skipCustomDomainVerification != nil { - queryParameters["skipCustomDomainVerification"] = autorest.Encode("query", *skipCustomDomainVerification) - } - if forceDNSRegistration != nil { - queryParameters["forceDnsRegistration"] = autorest.Encode("query", *forceDNSRegistration) - } - if len(TTLInSeconds) > 0 { - queryParameters["ttlInSeconds"] = autorest.Encode("query", TTLInSeconds) - } 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.Web/sites/{name}", pathParameters), @@ -1445,8 +1431,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 +1446,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) @@ -1498,7 +1484,7 @@ func (client AppsClient) CreateOrUpdateConfigurationPreparer(ctx context.Context } 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.Web/sites/{name}/config/web", pathParameters), @@ -1529,9 +1515,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 +1531,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) @@ -1584,7 +1570,7 @@ func (client AppsClient) CreateOrUpdateConfigurationSlotPreparer(ctx context.Con } 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.Web/sites/{name}/slots/{slot}/config/web", pathParameters), @@ -1625,7 +1611,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) @@ -1664,7 +1650,7 @@ func (client AppsClient) CreateOrUpdateDomainOwnershipIdentifierPreparer(ctx con } 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.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}", pathParameters), @@ -1698,15 +1684,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) @@ -1746,7 +1732,7 @@ func (client AppsClient) CreateOrUpdateDomainOwnershipIdentifierSlotPreparer(ctx } 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.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}", pathParameters), @@ -1777,8 +1763,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 +1772,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) @@ -1825,7 +1811,7 @@ func (client AppsClient) CreateOrUpdateHostNameBindingPreparer(ctx context.Conte } 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.Web/sites/{name}/hostNameBindings/{hostName}", pathParameters), @@ -1856,8 +1842,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 +1852,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) @@ -1906,7 +1892,7 @@ func (client AppsClient) CreateOrUpdateHostNameBindingSlotPreparer(ctx context.C } 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.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}", pathParameters), @@ -1938,15 +1924,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) @@ -1986,7 +1972,7 @@ func (client AppsClient) CreateOrUpdateHybridConnectionPreparer(ctx context.Cont } 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.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", pathParameters), @@ -2018,15 +2004,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) @@ -2067,7 +2054,7 @@ func (client AppsClient) CreateOrUpdateHybridConnectionSlotPreparer(ctx context. } 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.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", pathParameters), @@ -2099,15 +2086,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) @@ -2146,7 +2133,7 @@ func (client AppsClient) CreateOrUpdatePublicCertificatePreparer(ctx context.Con } 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.Web/sites/{name}/publicCertificates/{publicCertificateName}", pathParameters), @@ -2178,16 +2165,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) @@ -2227,7 +2214,7 @@ func (client AppsClient) CreateOrUpdatePublicCertificateSlotPreparer(ctx context } 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.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}", pathParameters), @@ -2259,16 +2246,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) @@ -2307,7 +2294,7 @@ func (client AppsClient) CreateOrUpdateRelayServiceConnectionPreparer(ctx contex } 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.Web/sites/{name}/hybridconnection/{entityName}", pathParameters), @@ -2339,17 +2326,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) @@ -2389,7 +2376,7 @@ func (client AppsClient) CreateOrUpdateRelayServiceConnectionSlotPreparer(ctx co } 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.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}", pathParameters), @@ -2423,11 +2410,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 +2436,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) @@ -2494,7 +2481,7 @@ func (client AppsClient) CreateOrUpdateSlotPreparer(ctx context.Context, resourc } 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.Web/sites/{name}/slots/{slot}", pathParameters), @@ -2541,7 +2528,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) @@ -2573,7 +2560,7 @@ func (client AppsClient) CreateOrUpdateSourceControlPreparer(ctx context.Context } 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.Web/sites/{name}/sourcecontrols/web", pathParameters), @@ -2613,15 +2600,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) @@ -2654,7 +2642,7 @@ func (client AppsClient) CreateOrUpdateSourceControlSlotPreparer(ctx context.Con } 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.Web/sites/{name}/slots/{slot}/sourcecontrols/web", pathParameters), @@ -2694,8 +2682,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 +2691,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) @@ -2742,7 +2730,7 @@ func (client AppsClient) CreateOrUpdateVnetConnectionPreparer(ctx context.Contex } 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.Web/sites/{name}/virtualNetworkConnections/{vnetName}", pathParameters), @@ -2773,9 +2761,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 +2773,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) @@ -2825,7 +2813,7 @@ func (client AppsClient) CreateOrUpdateVnetConnectionGatewayPreparer(ctx context } 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.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", pathParameters), @@ -2856,10 +2844,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 +2858,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) @@ -2910,7 +2899,7 @@ func (client AppsClient) CreateOrUpdateVnetConnectionGatewaySlotPreparer(ctx con } 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.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", pathParameters), @@ -2942,17 +2931,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) @@ -2992,7 +2981,7 @@ func (client AppsClient) CreateOrUpdateVnetConnectionSlotPreparer(ctx context.Co } 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.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}", pathParameters), @@ -3023,20 +3012,20 @@ 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. -func (client AppsClient) Delete(ctx context.Context, resourceGroupName string, name string, deleteMetrics *bool, deleteEmptyServerFarm *bool, skipDNSRegistration *bool) (result autorest.Response, err error) { +// 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. +func (client AppsClient) Delete(ctx context.Context, resourceGroupName string, name string, deleteMetrics *bool, deleteEmptyServerFarm *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) + req, err := client.DeletePreparer(ctx, resourceGroupName, name, deleteMetrics, deleteEmptyServerFarm) if err != nil { err = autorest.NewErrorWithError(err, "web.AppsClient", "Delete", nil, "Failure preparing request") return @@ -3058,7 +3047,7 @@ func (client AppsClient) Delete(ctx context.Context, resourceGroupName string, n } // DeletePreparer prepares the Delete request. -func (client AppsClient) DeletePreparer(ctx context.Context, resourceGroupName string, name string, deleteMetrics *bool, deleteEmptyServerFarm *bool, skipDNSRegistration *bool) (*http.Request, error) { +func (client AppsClient) DeletePreparer(ctx context.Context, resourceGroupName string, name string, deleteMetrics *bool, deleteEmptyServerFarm *bool) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -3075,9 +3064,6 @@ func (client AppsClient) DeletePreparer(ctx context.Context, resourceGroupName s if deleteEmptyServerFarm != nil { queryParameters["deleteEmptyServerFarm"] = autorest.Encode("query", *deleteEmptyServerFarm) } - if skipDNSRegistration != nil { - queryParameters["skipDnsRegistration"] = autorest.Encode("query", *skipDNSRegistration) - } preparer := autorest.CreatePreparer( autorest.AsDelete(), @@ -3108,15 +3094,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 +3176,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 +3242,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 +3318,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 +3395,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 +3470,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 +3555,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 +3623,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 +3707,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 +3775,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 +3851,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 +3926,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 +4001,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 +4079,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 +4156,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 +4233,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 +4311,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 +4389,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 +4476,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 +4552,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 +4621,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 +4697,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 +4782,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 +4849,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 +4926,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 +5001,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 +5078,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 +5153,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 +5230,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 +5324,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 +5390,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 +5466,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 +5541,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 +5618,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 +5693,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 +5770,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 +5783,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) @@ -5833,7 +5821,7 @@ func (client AppsClient) DiscoverRestorePreparer(ctx context.Context, resourceGr } 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.Web/sites/{name}/backups/discover", pathParameters), @@ -5864,9 +5852,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 +5866,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) @@ -5917,7 +5905,7 @@ func (client AppsClient) DiscoverRestoreSlotPreparer(ctx context.Context, resour } 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.Web/sites/{name}/slots/{slot}/backups/discover", pathParameters), @@ -5955,7 +5943,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 +6010,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 +6093,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 +6167,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 +6234,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 +6317,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 +6384,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 +6461,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 +6537,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 +6623,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 +6691,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 +6768,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 +6844,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 +6922,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 +6998,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 +7084,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 +7153,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 +7237,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 +7304,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 +7389,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 +7458,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 +7535,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 +7618,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 +7685,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 +7761,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 +7837,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 +7916,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 +7994,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 +8072,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 +8150,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 +8226,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 +8304,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 +8380,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 +8458,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 +8536,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 +8614,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 +8693,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 +8772,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 +8853,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 +8934,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 +9014,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 +9103,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 +9171,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 +9254,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 +9321,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 +9404,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 +9471,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 +9555,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 +9624,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 +9701,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 +9777,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 +9852,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 +9929,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 +10006,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 +10085,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 +10164,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 +10242,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 +10329,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 +10397,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 +10406,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 +10475,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 +10551,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 +10629,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 +10705,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 +10790,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 +10857,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 +10933,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 +11016,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 +11083,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 +11160,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 +11236,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 +11313,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 +11392,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 +11470,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 +11546,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 +11624,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 +11704,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 +11782,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 +11858,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 +11943,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 +12009,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 +12091,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 +12157,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 +12232,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 +12310,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 +12397,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 +12464,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 +12637,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 +12704,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 +12788,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 +12883,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 +12989,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 +13007,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) @@ -13051,7 +13046,7 @@ func (client AppsClient) ListBackupStatusSecretsPreparer(ctx context.Context, re } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/list", pathParameters), @@ -13084,9 +13079,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 +13098,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) @@ -13143,7 +13138,7 @@ func (client AppsClient) ListBackupStatusSecretsSlotPreparer(ctx context.Context } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/list", pathParameters), @@ -13183,7 +13178,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 +13282,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 +13385,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 +13481,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 +13586,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 +13698,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 +13765,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 +13849,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 +13944,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 +14048,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 +14057,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 +14125,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 +14211,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 +14306,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 +14417,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 +14512,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 +14624,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 +14719,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 +14795,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 +14880,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 +14975,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 +15080,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 +15158,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 +15243,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 +15310,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 +15386,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 +15497,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 +15592,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 +15697,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 +15706,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 +15803,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 +15911,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 +16018,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 +16126,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 +16233,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 +16348,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 +16415,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 +16498,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 +16593,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 +16698,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 +16810,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 +16924,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 +17000,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 +17078,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 +17186,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 +17302,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 +17369,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 +17454,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 +17550,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 +17654,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 +17759,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 +17865,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 +17969,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 +18082,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 +18177,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 +18288,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 +18357,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 +18437,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) @@ -18479,7 +18483,7 @@ func (client AppsClient) ListPublishingProfileXMLWithSecretsPreparer(ctx context } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publishxml", pathParameters), @@ -18510,16 +18514,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) @@ -18558,7 +18562,7 @@ func (client AppsClient) ListPublishingProfileXMLWithSecretsSlotPreparer(ctx con } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publishxml", pathParameters), @@ -18595,7 +18599,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 +18666,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 +18750,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 +18845,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 +18956,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 +19023,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 +19107,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 +19185,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 @@ -19219,7 +19224,7 @@ func (client AppsClient) ListSlotDifferencesFromProductionPreparer(ctx context.C } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsdiffs", pathParameters), @@ -19278,8 +19283,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 +19294,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 @@ -19329,7 +19334,7 @@ func (client AppsClient) ListSlotDifferencesSlotPreparer(ctx context.Context, re } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsdiffs", pathParameters), @@ -19394,7 +19399,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 +19501,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 +19596,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 +19707,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 +19774,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 +19850,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 +19954,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 +20067,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 +20162,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 +20266,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 +20374,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 +20491,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 +20558,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 +20642,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 +20737,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 +20852,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) @@ -20879,7 +20884,7 @@ func (client AppsClient) MigrateMySQLPreparer(ctx context.Context, resourceGroup } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql", pathParameters), @@ -20931,7 +20936,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) @@ -20964,7 +20969,7 @@ func (client AppsClient) MigrateStoragePreparer(ctx context.Context, subscriptio } 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.Web/sites/{name}/migrate", pathParameters), @@ -21015,7 +21020,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) @@ -21047,7 +21052,7 @@ func (client AppsClient) RecoverPreparer(ctx context.Context, resourceGroupName } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/recover", pathParameters), @@ -21085,15 +21090,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 +21165,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 +21255,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) @@ -21283,7 +21288,7 @@ func (client AppsClient) RecoverSlotPreparer(ctx context.Context, resourceGroupN } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/recover", pathParameters), @@ -21329,7 +21334,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 +21401,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 +21477,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 +21559,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 +21643,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 +21656,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) @@ -21683,7 +21689,7 @@ func (client AppsClient) RestorePreparer(ctx context.Context, resourceGroupName } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/restore", pathParameters), @@ -21722,9 +21728,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 +21742,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) @@ -21770,7 +21776,7 @@ func (client AppsClient) RestoreSlotPreparer(ctx context.Context, resourceGroupN } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/restore", pathParameters), @@ -21809,15 +21815,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 +21890,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 +21974,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 +22040,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 +22115,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 +22192,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 +22268,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 +22352,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 +22361,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 +22445,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 +22511,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 +22586,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 +22663,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 +22745,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 +22812,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 +22889,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 +22900,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) @@ -22927,7 +22933,7 @@ func (client AppsClient) SwapSlotSlotPreparer(ctx context.Context, resourceGroup } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsswap", pathParameters), @@ -22976,7 +22982,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) @@ -23008,7 +23014,7 @@ func (client AppsClient) SwapSlotWithProductionPreparer(ctx context.Context, res } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsswap", pathParameters), @@ -23053,7 +23059,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 +23125,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 +23207,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 +23273,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,21 +23350,17 @@ 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 -// 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. -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) { +// representation of the app properties. See example. +func (client AppsClient) Update(ctx context.Context, resourceGroupName string, name string, siteEnvelope SitePatchResource) (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) + req, err := client.UpdatePreparer(ctx, resourceGroupName, name, siteEnvelope) if err != nil { err = autorest.NewErrorWithError(err, "web.AppsClient", "Update", nil, "Failure preparing request") return @@ -23380,7 +23382,7 @@ func (client AppsClient) Update(ctx context.Context, resourceGroupName string, n } // UpdatePreparer prepares the Update request. -func (client AppsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, name string, siteEnvelope SitePatchResource, skipDNSRegistration *bool, skipCustomDomainVerification *bool, forceDNSRegistration *bool, TTLInSeconds string) (*http.Request, error) { +func (client AppsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, name string, siteEnvelope SitePatchResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -23391,21 +23393,9 @@ func (client AppsClient) UpdatePreparer(ctx context.Context, resourceGroupName s queryParameters := map[string]interface{}{ "api-version": APIVersion, } - if skipDNSRegistration != nil { - queryParameters["skipDnsRegistration"] = autorest.Encode("query", *skipDNSRegistration) - } - if skipCustomDomainVerification != nil { - queryParameters["skipCustomDomainVerification"] = autorest.Encode("query", *skipCustomDomainVerification) - } - if forceDNSRegistration != nil { - queryParameters["forceDnsRegistration"] = autorest.Encode("query", *forceDNSRegistration) - } - if len(TTLInSeconds) > 0 { - queryParameters["ttlInSeconds"] = autorest.Encode("query", TTLInSeconds) - } 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.Web/sites/{name}", pathParameters), @@ -23436,15 +23426,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) @@ -23482,7 +23472,7 @@ func (client AppsClient) UpdateApplicationSettingsPreparer(ctx context.Context, } 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.Web/sites/{name}/config/appsettings", pathParameters), @@ -23513,16 +23503,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) @@ -23561,7 +23551,7 @@ func (client AppsClient) UpdateApplicationSettingsSlotPreparer(ctx context.Conte } 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.Web/sites/{name}/slots/{slot}/config/appsettings", pathParameters), @@ -23600,7 +23590,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) @@ -23638,7 +23628,7 @@ func (client AppsClient) UpdateAuthSettingsPreparer(ctx context.Context, resourc } 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.Web/sites/{name}/config/authsettings", pathParameters), @@ -23670,15 +23660,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) @@ -23717,7 +23707,7 @@ func (client AppsClient) UpdateAuthSettingsSlotPreparer(ctx context.Context, res } 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.Web/sites/{name}/slots/{slot}/config/authsettings", pathParameters), @@ -23748,8 +23738,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 +23756,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) @@ -23804,7 +23794,7 @@ func (client AppsClient) UpdateBackupConfigurationPreparer(ctx context.Context, } 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.Web/sites/{name}/config/backup", pathParameters), @@ -23835,9 +23825,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 +23844,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) @@ -23893,7 +23883,7 @@ func (client AppsClient) UpdateBackupConfigurationSlotPreparer(ctx context.Conte } 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.Web/sites/{name}/slots/{slot}/config/backup", pathParameters), @@ -23924,15 +23914,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) @@ -23970,7 +23960,7 @@ func (client AppsClient) UpdateConfigurationPreparer(ctx context.Context, resour } 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.Web/sites/{name}/config/web", pathParameters), @@ -24001,16 +23991,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) @@ -24049,7 +24039,7 @@ func (client AppsClient) UpdateConfigurationSlotPreparer(ctx context.Context, re } 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.Web/sites/{name}/slots/{slot}/config/web", pathParameters), @@ -24088,7 +24078,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) @@ -24126,7 +24116,7 @@ func (client AppsClient) UpdateConnectionStringsPreparer(ctx context.Context, re } 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.Web/sites/{name}/config/connectionstrings", pathParameters), @@ -24158,15 +24148,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) @@ -24205,7 +24196,7 @@ func (client AppsClient) UpdateConnectionStringsSlotPreparer(ctx context.Context } 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.Web/sites/{name}/slots/{slot}/config/connectionstrings", pathParameters), @@ -24237,8 +24228,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 +24251,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) @@ -24298,7 +24289,7 @@ func (client AppsClient) UpdateDiagnosticLogsConfigPreparer(ctx context.Context, } 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.Web/sites/{name}/config/logs", pathParameters), @@ -24330,9 +24321,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 +24345,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) @@ -24393,7 +24384,7 @@ func (client AppsClient) UpdateDiagnosticLogsConfigSlotPreparer(ctx context.Cont } 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.Web/sites/{name}/slots/{slot}/config/logs", pathParameters), @@ -24434,7 +24425,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) @@ -24473,7 +24464,7 @@ func (client AppsClient) UpdateDomainOwnershipIdentifierPreparer(ctx context.Con } 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.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}", pathParameters), @@ -24507,15 +24498,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) @@ -24555,7 +24546,7 @@ func (client AppsClient) UpdateDomainOwnershipIdentifierSlotPreparer(ctx context } 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.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}", pathParameters), @@ -24587,15 +24578,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) @@ -24635,7 +24626,7 @@ func (client AppsClient) UpdateHybridConnectionPreparer(ctx context.Context, res } 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.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", pathParameters), @@ -24667,15 +24658,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) @@ -24716,7 +24708,7 @@ func (client AppsClient) UpdateHybridConnectionSlotPreparer(ctx context.Context, } 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.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", pathParameters), @@ -24747,15 +24739,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) @@ -24793,7 +24785,7 @@ func (client AppsClient) UpdateMetadataPreparer(ctx context.Context, resourceGro } 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.Web/sites/{name}/config/metadata", pathParameters), @@ -24824,16 +24816,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) @@ -24872,7 +24864,7 @@ func (client AppsClient) UpdateMetadataSlotPreparer(ctx context.Context, resourc } 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.Web/sites/{name}/slots/{slot}/config/metadata", pathParameters), @@ -24904,16 +24896,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) @@ -24952,7 +24944,7 @@ func (client AppsClient) UpdateRelayServiceConnectionPreparer(ctx context.Contex } 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.Web/sites/{name}/hybridconnection/{entityName}", pathParameters), @@ -24984,17 +24976,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) @@ -25034,7 +25026,7 @@ func (client AppsClient) UpdateRelayServiceConnectionSlotPreparer(ctx context.Co } 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.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}", pathParameters), @@ -25065,8 +25057,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 +25068,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) @@ -25114,7 +25106,7 @@ func (client AppsClient) UpdateSitePushSettingsPreparer(ctx context.Context, res } 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.Web/sites/{name}/config/pushsettings", pathParameters), @@ -25145,9 +25137,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 +25149,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) @@ -25196,7 +25188,7 @@ func (client AppsClient) UpdateSitePushSettingsSlotPreparer(ctx context.Context, } 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.Web/sites/{name}/slots/{slot}/config/pushsettings", pathParameters), @@ -25230,18 +25222,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) @@ -25292,7 +25284,7 @@ func (client AppsClient) UpdateSlotPreparer(ctx context.Context, resourceGroupNa } 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.Web/sites/{name}/slots/{slot}", pathParameters), @@ -25332,7 +25324,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) @@ -25370,7 +25362,7 @@ func (client AppsClient) UpdateSlotConfigurationNamesPreparer(ctx context.Contex } 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.Web/sites/{name}/config/slotConfigNames", pathParameters), @@ -25409,7 +25401,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) @@ -25447,7 +25439,7 @@ func (client AppsClient) UpdateSourceControlPreparer(ctx context.Context, resour } 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.Web/sites/{name}/sourcecontrols/web", pathParameters), @@ -25479,15 +25471,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) @@ -25526,7 +25519,7 @@ func (client AppsClient) UpdateSourceControlSlotPreparer(ctx context.Context, re } 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.Web/sites/{name}/slots/{slot}/sourcecontrols/web", pathParameters), @@ -25558,8 +25551,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 +25560,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) @@ -25606,7 +25599,7 @@ func (client AppsClient) UpdateVnetConnectionPreparer(ctx context.Context, resou } 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.Web/sites/{name}/virtualNetworkConnections/{vnetName}", pathParameters), @@ -25637,16 +25630,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) @@ -25686,7 +25679,7 @@ func (client AppsClient) UpdateVnetConnectionGatewayPreparer(ctx context.Context } 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.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", pathParameters), @@ -25717,17 +25710,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) @@ -25768,7 +25762,7 @@ func (client AppsClient) UpdateVnetConnectionGatewaySlotPreparer(ctx context.Con } 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.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", pathParameters), @@ -25800,17 +25794,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) @@ -25850,7 +25844,7 @@ func (client AppsClient) UpdateVnetConnectionSlotPreparer(ctx context.Context, r } 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.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}", pathParameters), 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..0b5bf9189be5 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) @@ -89,7 +89,7 @@ func (client AppServiceCertificateOrdersClient) CreateOrUpdatePreparer(ctx conte } 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.CertificateRegistration/certificateOrders/{certificateOrderName}", pathParameters), @@ -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) @@ -169,7 +170,7 @@ func (client AppServiceCertificateOrdersClient) CreateOrUpdateCertificatePrepare } 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.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}", pathParameters), @@ -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) @@ -848,7 +849,7 @@ func (client AppServiceCertificateOrdersClient) ReissuePreparer(ctx context.Cont } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/reissue", pathParameters), @@ -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) @@ -924,7 +925,7 @@ func (client AppServiceCertificateOrdersClient) RenewPreparer(ctx context.Contex } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/renew", pathParameters), @@ -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) @@ -1074,7 +1075,7 @@ func (client AppServiceCertificateOrdersClient) ResendRequestEmailsPreparer(ctx } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/resendRequestEmails", pathParameters), @@ -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) @@ -1300,7 +1301,7 @@ func (client AppServiceCertificateOrdersClient) RetrieveSiteSealPreparer(ctx con } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/retrieveSiteSeal", pathParameters), @@ -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) @@ -1377,7 +1378,7 @@ func (client AppServiceCertificateOrdersClient) UpdatePreparer(ctx context.Conte } 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.CertificateRegistration/certificateOrders/{certificateOrderName}", pathParameters), @@ -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) @@ -1455,7 +1457,7 @@ func (client AppServiceCertificateOrdersClient) UpdateCertificatePreparer(ctx co } 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.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}", pathParameters), @@ -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) @@ -1532,7 +1534,7 @@ func (client AppServiceCertificateOrdersClient) ValidatePurchaseInformationPrepa } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.CertificateRegistration/validateCertificateRegistrationInformation", pathParameters), @@ -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..18b0ea55e371 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) @@ -89,7 +89,7 @@ func (client AppServiceEnvironmentsClient) CreateOrUpdatePreparer(ctx context.Co } 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.Web/hostingEnvironments/{name}", pathParameters), @@ -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) @@ -168,7 +168,7 @@ func (client AppServiceEnvironmentsClient) CreateOrUpdateMultiRolePoolPreparer(c } 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.Web/hostingEnvironments/{name}/multiRolePools/default", pathParameters), @@ -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) @@ -248,7 +248,7 @@ func (client AppServiceEnvironmentsClient) CreateOrUpdateWorkerPoolPreparer(ctx } 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.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}", pathParameters), @@ -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) @@ -3529,7 +3529,7 @@ func (client AppServiceEnvironmentsClient) UpdatePreparer(ctx context.Context, r } 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.Web/hostingEnvironments/{name}", pathParameters), @@ -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) @@ -3606,7 +3606,7 @@ func (client AppServiceEnvironmentsClient) UpdateMultiRolePoolPreparer(ctx conte } 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.Web/hostingEnvironments/{name}/multiRolePools/default", pathParameters), @@ -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) @@ -3684,7 +3684,7 @@ func (client AppServiceEnvironmentsClient) UpdateWorkerPoolPreparer(ctx context. } 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.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}", pathParameters), 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..90381448fde8 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) @@ -85,7 +85,7 @@ func (client AppServicePlansClient) CreateOrUpdatePreparer(ctx context.Context, } 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.Web/serverfarms/{name}", pathParameters), @@ -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) @@ -173,7 +173,7 @@ func (client AppServicePlansClient) CreateOrUpdateVnetRoutePreparer(ctx context. } 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.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}", pathParameters), @@ -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) @@ -2300,7 +2309,7 @@ func (client AppServicePlansClient) UpdatePreparer(ctx context.Context, resource } 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.Web/serverfarms/{name}", pathParameters), @@ -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) @@ -2383,7 +2392,7 @@ func (client AppServicePlansClient) UpdateVnetGatewayPreparer(ctx context.Contex } 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.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", pathParameters), @@ -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) @@ -2463,7 +2472,7 @@ func (client AppServicePlansClient) UpdateVnetRoutePreparer(ctx context.Context, } 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.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}", pathParameters), 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..ffbb268e5bce 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) @@ -91,7 +91,7 @@ func (client CertificatesClient) CreateOrUpdatePreparer(ctx context.Context, res } 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.Web/certificates/{name}", pathParameters), @@ -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) @@ -506,7 +506,7 @@ func (client CertificatesClient) UpdatePreparer(ctx context.Context, resourceGro } 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.Web/certificates/{name}", pathParameters), 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..5ffbc0ea8684 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) @@ -97,7 +97,7 @@ func (client BaseClient) CheckNameAvailabilityPreparer(ctx context.Context, requ } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/checknameavailability", pathParameters), @@ -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.AsContentType("application/json; charset=utf-8"), + 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) @@ -700,7 +794,7 @@ func (client BaseClient) MovePreparer(ctx context.Context, resourceGroupName str } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources", pathParameters), @@ -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) @@ -768,7 +862,7 @@ func (client BaseClient) UpdatePublishingUserPreparer(ctx context.Context, userD } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPath("/providers/Microsoft.Web/publishingUsers/web"), @@ -834,7 +928,7 @@ func (client BaseClient) UpdateSourceControlPreparer(ctx context.Context, source } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/providers/Microsoft.Web/sourcecontrols/{sourceControlType}", pathParameters), @@ -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) @@ -917,7 +1011,7 @@ func (client BaseClient) ValidatePreparer(ctx context.Context, resourceGroupName } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/validate", pathParameters), @@ -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) @@ -999,7 +1093,7 @@ func (client BaseClient) ValidateMovePreparer(ctx context.Context, resourceGroup } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/validateMoveResources", pathParameters), @@ -1065,7 +1159,7 @@ func (client BaseClient) VerifyHostingEnvironmentVnetPreparer(ctx context.Contex } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/verifyHostingEnvironmentVnet", pathParameters), 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..1948f6711a7a 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 @@ -77,7 +77,7 @@ func (client DomainsClient) CheckAvailabilityPreparer(ctx context.Context, ident } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/checkDomainAvailability", pathParameters), @@ -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) @@ -206,7 +206,7 @@ func (client DomainsClient) CreateOrUpdatePreparer(ctx context.Context, resource } 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.DomainRegistration/domains/{domainName}", pathParameters), @@ -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) @@ -293,7 +294,7 @@ func (client DomainsClient) CreateOrUpdateOwnershipIdentifierPreparer(ctx contex } 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.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}", pathParameters), @@ -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 @@ -1018,7 +1019,7 @@ func (client DomainsClient) ListRecommendationsPreparer(ctx context.Context, par } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/listDomainRecommendations", pathParameters), @@ -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) @@ -1124,7 +1198,7 @@ func (client DomainsClient) UpdatePreparer(ctx context.Context, resourceGroupNam } 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.DomainRegistration/domains/{domainName}", pathParameters), @@ -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) @@ -1203,7 +1278,7 @@ func (client DomainsClient) UpdateOwnershipIdentifierPreparer(ctx context.Contex } 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.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}", pathParameters), 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..f92303797b48 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 @@ -38,6 +38,11 @@ const ( Permit AccessControlEntryAction = "Permit" ) +// PossibleAccessControlEntryActionValues returns an array of possible values for the AccessControlEntryAction const type. +func PossibleAccessControlEntryActionValues() []AccessControlEntryAction { + return []AccessControlEntryAction{Deny, Permit} +} + // AppServicePlanRestrictions enumerates the values for app service plan restrictions. type AppServicePlanRestrictions string @@ -56,6 +61,11 @@ const ( Standard AppServicePlanRestrictions = "Standard" ) +// PossibleAppServicePlanRestrictionsValues returns an array of possible values for the AppServicePlanRestrictions const type. +func PossibleAppServicePlanRestrictionsValues() []AppServicePlanRestrictions { + return []AppServicePlanRestrictions{Basic, Free, None, Premium, Shared, Standard} +} + // AutoHealActionType enumerates the values for auto heal action type. type AutoHealActionType string @@ -68,6 +78,11 @@ const ( Recycle AutoHealActionType = "Recycle" ) +// PossibleAutoHealActionTypeValues returns an array of possible values for the AutoHealActionType const type. +func PossibleAutoHealActionTypeValues() []AutoHealActionType { + return []AutoHealActionType{CustomAction, LogEvent, Recycle} +} + // AzureResourceType enumerates the values for azure resource type. type AzureResourceType string @@ -78,6 +93,11 @@ const ( Website AzureResourceType = "Website" ) +// PossibleAzureResourceTypeValues returns an array of possible values for the AzureResourceType const type. +func PossibleAzureResourceTypeValues() []AzureResourceType { + return []AzureResourceType{TrafficManager, Website} +} + // BackupItemStatus enumerates the values for backup item status. type BackupItemStatus string @@ -104,6 +124,11 @@ const ( TimedOut BackupItemStatus = "TimedOut" ) +// PossibleBackupItemStatusValues returns an array of possible values for the BackupItemStatus const type. +func PossibleBackupItemStatusValues() []BackupItemStatus { + return []BackupItemStatus{Created, Deleted, DeleteFailed, DeleteInProgress, Failed, InProgress, PartiallySucceeded, Skipped, Succeeded, TimedOut} +} + // BackupRestoreOperationType enumerates the values for backup restore operation type. type BackupRestoreOperationType string @@ -118,6 +143,11 @@ const ( BackupRestoreOperationTypeSnapshot BackupRestoreOperationType = "Snapshot" ) +// PossibleBackupRestoreOperationTypeValues returns an array of possible values for the BackupRestoreOperationType const type. +func PossibleBackupRestoreOperationTypeValues() []BackupRestoreOperationType { + return []BackupRestoreOperationType{BackupRestoreOperationTypeClone, BackupRestoreOperationTypeDefault, BackupRestoreOperationTypeRelocation, BackupRestoreOperationTypeSnapshot} +} + // BuiltInAuthenticationProvider enumerates the values for built in authentication provider. type BuiltInAuthenticationProvider string @@ -134,6 +164,11 @@ const ( Twitter BuiltInAuthenticationProvider = "Twitter" ) +// PossibleBuiltInAuthenticationProviderValues returns an array of possible values for the BuiltInAuthenticationProvider const type. +func PossibleBuiltInAuthenticationProviderValues() []BuiltInAuthenticationProvider { + return []BuiltInAuthenticationProvider{AzureActiveDirectory, Facebook, Google, MicrosoftAccount, Twitter} +} + // CertificateOrderActionType enumerates the values for certificate order action type. type CertificateOrderActionType string @@ -168,6 +203,11 @@ const ( Unknown CertificateOrderActionType = "Unknown" ) +// PossibleCertificateOrderActionTypeValues returns an array of possible values for the CertificateOrderActionType const type. +func PossibleCertificateOrderActionTypeValues() []CertificateOrderActionType { + return []CertificateOrderActionType{CertificateExpirationWarning, CertificateExpired, CertificateIssued, CertificateOrderCanceled, CertificateOrderCreated, CertificateRevoked, DomainValidationComplete, FraudCleared, FraudDetected, FraudDocumentationRequired, OrgNameChange, OrgValidationComplete, SanDrop, Unknown} +} + // CertificateOrderStatus enumerates the values for certificate order status. type CertificateOrderStatus string @@ -194,6 +234,11 @@ const ( Unused CertificateOrderStatus = "Unused" ) +// PossibleCertificateOrderStatusValues returns an array of possible values for the CertificateOrderStatus const type. +func PossibleCertificateOrderStatusValues() []CertificateOrderStatus { + return []CertificateOrderStatus{Canceled, Denied, Expired, Issued, NotSubmitted, Pendingissuance, PendingRekey, Pendingrevocation, Revoked, Unused} +} + // CertificateProductType enumerates the values for certificate product type. type CertificateProductType string @@ -204,6 +249,11 @@ const ( StandardDomainValidatedWildCardSsl CertificateProductType = "StandardDomainValidatedWildCardSsl" ) +// PossibleCertificateProductTypeValues returns an array of possible values for the CertificateProductType const type. +func PossibleCertificateProductTypeValues() []CertificateProductType { + return []CertificateProductType{StandardDomainValidatedSsl, StandardDomainValidatedWildCardSsl} +} + // Channels enumerates the values for channels. type Channels string @@ -220,6 +270,11 @@ const ( Webhook Channels = "Webhook" ) +// PossibleChannelsValues returns an array of possible values for the Channels const type. +func PossibleChannelsValues() []Channels { + return []Channels{All, API, Email, Notification, Webhook} +} + // CheckNameResourceTypes enumerates the values for check name resource types. type CheckNameResourceTypes string @@ -242,6 +297,11 @@ const ( CheckNameResourceTypesSlot CheckNameResourceTypes = "Slot" ) +// PossibleCheckNameResourceTypesValues returns an array of possible values for the CheckNameResourceTypes const type. +func PossibleCheckNameResourceTypesValues() []CheckNameResourceTypes { + return []CheckNameResourceTypes{CheckNameResourceTypesHostingEnvironment, CheckNameResourceTypesMicrosoftWebhostingEnvironments, CheckNameResourceTypesMicrosoftWebpublishingUsers, CheckNameResourceTypesMicrosoftWebsites, CheckNameResourceTypesMicrosoftWebsitesslots, CheckNameResourceTypesPublishingUser, CheckNameResourceTypesSite, CheckNameResourceTypesSlot} +} + // CloneAbilityResult enumerates the values for clone ability result. type CloneAbilityResult string @@ -254,6 +314,11 @@ const ( PartiallyCloneable CloneAbilityResult = "PartiallyCloneable" ) +// PossibleCloneAbilityResultValues returns an array of possible values for the CloneAbilityResult const type. +func PossibleCloneAbilityResultValues() []CloneAbilityResult { + return []CloneAbilityResult{Cloneable, NotCloneable, PartiallyCloneable} +} + // ComputeModeOptions enumerates the values for compute mode options. type ComputeModeOptions string @@ -266,6 +331,11 @@ const ( ComputeModeOptionsShared ComputeModeOptions = "Shared" ) +// PossibleComputeModeOptionsValues returns an array of possible values for the ComputeModeOptions const type. +func PossibleComputeModeOptionsValues() []ComputeModeOptions { + return []ComputeModeOptions{ComputeModeOptionsDedicated, ComputeModeOptionsDynamic, ComputeModeOptionsShared} +} + // ConnectionStringType enumerates the values for connection string type. type ConnectionStringType string @@ -294,6 +364,11 @@ const ( SQLServer ConnectionStringType = "SQLServer" ) +// PossibleConnectionStringTypeValues returns an array of possible values for the ConnectionStringType const type. +func PossibleConnectionStringTypeValues() []ConnectionStringType { + return []ConnectionStringType{APIHub, Custom, DocDb, EventHub, MySQL, NotificationHub, PostgreSQL, RedisCache, ServiceBus, SQLAzure, SQLServer} +} + // ContinuousWebJobStatus enumerates the values for continuous web job status. type ContinuousWebJobStatus string @@ -310,6 +385,11 @@ const ( Stopped ContinuousWebJobStatus = "Stopped" ) +// PossibleContinuousWebJobStatusValues returns an array of possible values for the ContinuousWebJobStatus const type. +func PossibleContinuousWebJobStatusValues() []ContinuousWebJobStatus { + return []ContinuousWebJobStatus{Initializing, PendingRestart, Running, Starting, Stopped} +} + // CustomHostNameDNSRecordType enumerates the values for custom host name dns record type. type CustomHostNameDNSRecordType string @@ -320,6 +400,11 @@ const ( CName CustomHostNameDNSRecordType = "CName" ) +// PossibleCustomHostNameDNSRecordTypeValues returns an array of possible values for the CustomHostNameDNSRecordType const type. +func PossibleCustomHostNameDNSRecordTypeValues() []CustomHostNameDNSRecordType { + return []CustomHostNameDNSRecordType{A, CName} +} + // DatabaseType enumerates the values for database type. type DatabaseType string @@ -334,6 +419,11 @@ const ( DatabaseTypeSQLAzure DatabaseType = "SqlAzure" ) +// PossibleDatabaseTypeValues returns an array of possible values for the DatabaseType const type. +func PossibleDatabaseTypeValues() []DatabaseType { + return []DatabaseType{DatabaseTypeLocalMySQL, DatabaseTypeMySQL, DatabaseTypePostgreSQL, DatabaseTypeSQLAzure} +} + // DNSType enumerates the values for dns type. type DNSType string @@ -344,6 +434,11 @@ const ( DefaultDomainRegistrarDNS DNSType = "DefaultDomainRegistrarDns" ) +// PossibleDNSTypeValues returns an array of possible values for the DNSType const type. +func PossibleDNSTypeValues() []DNSType { + return []DNSType{AzureDNS, DefaultDomainRegistrarDNS} +} + // DNSVerificationTestResult enumerates the values for dns verification test result. type DNSVerificationTestResult string @@ -356,6 +451,11 @@ const ( DNSVerificationTestResultSkipped DNSVerificationTestResult = "Skipped" ) +// PossibleDNSVerificationTestResultValues returns an array of possible values for the DNSVerificationTestResult const type. +func PossibleDNSVerificationTestResultValues() []DNSVerificationTestResult { + return []DNSVerificationTestResult{DNSVerificationTestResultFailed, DNSVerificationTestResultPassed, DNSVerificationTestResultSkipped} +} + // DomainStatus enumerates the values for domain status. type DomainStatus string @@ -404,6 +504,11 @@ const ( DomainStatusUpdated DomainStatus = "Updated" ) +// PossibleDomainStatusValues returns an array of possible values for the DomainStatus const type. +func PossibleDomainStatusValues() []DomainStatus { + return []DomainStatus{DomainStatusActive, DomainStatusAwaiting, DomainStatusCancelled, DomainStatusConfiscated, DomainStatusDisabled, DomainStatusExcluded, DomainStatusExpired, DomainStatusFailed, DomainStatusHeld, DomainStatusJSONConverterFailed, DomainStatusLocked, DomainStatusParked, DomainStatusPending, DomainStatusReserved, DomainStatusReverted, DomainStatusSuspended, DomainStatusTransferred, DomainStatusUnknown, DomainStatusUnlocked, DomainStatusUnparked, DomainStatusUpdated} +} + // DomainType enumerates the values for domain type. type DomainType string @@ -414,6 +519,11 @@ const ( SoftDeleted DomainType = "SoftDeleted" ) +// PossibleDomainTypeValues returns an array of possible values for the DomainType const type. +func PossibleDomainTypeValues() []DomainType { + return []DomainType{Regular, SoftDeleted} +} + // FrequencyUnit enumerates the values for frequency unit. type FrequencyUnit string @@ -424,6 +534,11 @@ const ( Hour FrequencyUnit = "Hour" ) +// PossibleFrequencyUnitValues returns an array of possible values for the FrequencyUnit const type. +func PossibleFrequencyUnitValues() []FrequencyUnit { + return []FrequencyUnit{Day, Hour} +} + // HostingEnvironmentStatus enumerates the values for hosting environment status. type HostingEnvironmentStatus string @@ -438,6 +553,11 @@ const ( Scaling HostingEnvironmentStatus = "Scaling" ) +// PossibleHostingEnvironmentStatusValues returns an array of possible values for the HostingEnvironmentStatus const type. +func PossibleHostingEnvironmentStatusValues() []HostingEnvironmentStatus { + return []HostingEnvironmentStatus{Deleting, Preparing, Ready, Scaling} +} + // HostNameType enumerates the values for host name type. type HostNameType string @@ -448,6 +568,11 @@ const ( Verified HostNameType = "Verified" ) +// PossibleHostNameTypeValues returns an array of possible values for the HostNameType const type. +func PossibleHostNameTypeValues() []HostNameType { + return []HostNameType{Managed, Verified} +} + // HostType enumerates the values for host type. type HostType string @@ -458,6 +583,11 @@ const ( HostTypeStandard HostType = "Standard" ) +// PossibleHostTypeValues returns an array of possible values for the HostType const type. +func PossibleHostTypeValues() []HostType { + return []HostType{HostTypeRepository, HostTypeStandard} +} + // InAvailabilityReasonType enumerates the values for in availability reason type. type InAvailabilityReasonType string @@ -468,6 +598,11 @@ const ( Invalid InAvailabilityReasonType = "Invalid" ) +// PossibleInAvailabilityReasonTypeValues returns an array of possible values for the InAvailabilityReasonType const type. +func PossibleInAvailabilityReasonTypeValues() []InAvailabilityReasonType { + return []InAvailabilityReasonType{AlreadyExists, Invalid} +} + // InternalLoadBalancingMode enumerates the values for internal load balancing mode. type InternalLoadBalancingMode string @@ -480,6 +615,11 @@ const ( InternalLoadBalancingModeWeb InternalLoadBalancingMode = "Web" ) +// PossibleInternalLoadBalancingModeValues returns an array of possible values for the InternalLoadBalancingMode const type. +func PossibleInternalLoadBalancingModeValues() []InternalLoadBalancingMode { + return []InternalLoadBalancingMode{InternalLoadBalancingModeNone, InternalLoadBalancingModePublishing, InternalLoadBalancingModeWeb} +} + // IssueType enumerates the values for issue type. type IssueType string @@ -502,6 +642,11 @@ const ( UserIssue IssueType = "UserIssue" ) +// PossibleIssueTypeValues returns an array of possible values for the IssueType const type. +func PossibleIssueTypeValues() []IssueType { + return []IssueType{AppCrash, AppDeployment, AseDeployment, Other, PlatformIssue, RuntimeIssueDetected, ServiceIncident, UserIssue} +} + // JobType enumerates the values for job type. type JobType string @@ -512,6 +657,11 @@ const ( Triggered JobType = "Triggered" ) +// PossibleJobTypeValues returns an array of possible values for the JobType const type. +func PossibleJobTypeValues() []JobType { + return []JobType{Continuous, Triggered} +} + // KeyVaultSecretStatus enumerates the values for key vault secret status. type KeyVaultSecretStatus string @@ -540,6 +690,11 @@ const ( KeyVaultSecretStatusWaitingOnCertificateOrder KeyVaultSecretStatus = "WaitingOnCertificateOrder" ) +// PossibleKeyVaultSecretStatusValues returns an array of possible values for the KeyVaultSecretStatus const type. +func PossibleKeyVaultSecretStatusValues() []KeyVaultSecretStatus { + return []KeyVaultSecretStatus{KeyVaultSecretStatusAzureServiceUnauthorizedToAccessKeyVault, KeyVaultSecretStatusCertificateOrderFailed, KeyVaultSecretStatusExternalPrivateKey, KeyVaultSecretStatusInitialized, KeyVaultSecretStatusKeyVaultDoesNotExist, KeyVaultSecretStatusKeyVaultSecretDoesNotExist, KeyVaultSecretStatusOperationNotPermittedOnKeyVault, KeyVaultSecretStatusSucceeded, KeyVaultSecretStatusUnknown, KeyVaultSecretStatusUnknownError, KeyVaultSecretStatusWaitingOnCertificateOrder} +} + // LogLevel enumerates the values for log level. type LogLevel string @@ -556,6 +711,11 @@ const ( Warning LogLevel = "Warning" ) +// PossibleLogLevelValues returns an array of possible values for the LogLevel const type. +func PossibleLogLevelValues() []LogLevel { + return []LogLevel{Error, Information, Off, Verbose, Warning} +} + // ManagedPipelineMode enumerates the values for managed pipeline mode. type ManagedPipelineMode string @@ -566,6 +726,24 @@ const ( Integrated ManagedPipelineMode = "Integrated" ) +// PossibleManagedPipelineModeValues returns an array of possible values for the ManagedPipelineMode const type. +func PossibleManagedPipelineModeValues() []ManagedPipelineMode { + return []ManagedPipelineMode{Classic, Integrated} +} + +// ManagedServiceIdentityType enumerates the values for managed service identity type. +type ManagedServiceIdentityType string + +const ( + // SystemAssigned ... + SystemAssigned ManagedServiceIdentityType = "SystemAssigned" +) + +// PossibleManagedServiceIdentityTypeValues returns an array of possible values for the ManagedServiceIdentityType const type. +func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType { + return []ManagedServiceIdentityType{SystemAssigned} +} + // MSDeployLogEntryType enumerates the values for ms deploy log entry type. type MSDeployLogEntryType string @@ -578,6 +756,11 @@ const ( MSDeployLogEntryTypeWarning MSDeployLogEntryType = "Warning" ) +// PossibleMSDeployLogEntryTypeValues returns an array of possible values for the MSDeployLogEntryType const type. +func PossibleMSDeployLogEntryTypeValues() []MSDeployLogEntryType { + return []MSDeployLogEntryType{MSDeployLogEntryTypeError, MSDeployLogEntryTypeMessage, MSDeployLogEntryTypeWarning} +} + // MSDeployProvisioningState enumerates the values for ms deploy provisioning state. type MSDeployProvisioningState string @@ -594,6 +777,11 @@ const ( MSDeployProvisioningStateSucceeded MSDeployProvisioningState = "succeeded" ) +// PossibleMSDeployProvisioningStateValues returns an array of possible values for the MSDeployProvisioningState const type. +func PossibleMSDeployProvisioningStateValues() []MSDeployProvisioningState { + return []MSDeployProvisioningState{MSDeployProvisioningStateAccepted, MSDeployProvisioningStateCanceled, MSDeployProvisioningStateFailed, MSDeployProvisioningStateRunning, MSDeployProvisioningStateSucceeded} +} + // MySQLMigrationType enumerates the values for my sql migration type. type MySQLMigrationType string @@ -604,6 +792,11 @@ const ( RemoteToLocal MySQLMigrationType = "RemoteToLocal" ) +// PossibleMySQLMigrationTypeValues returns an array of possible values for the MySQLMigrationType const type. +func PossibleMySQLMigrationTypeValues() []MySQLMigrationType { + return []MySQLMigrationType{LocalToRemote, RemoteToLocal} +} + // NotificationLevel enumerates the values for notification level. type NotificationLevel string @@ -618,6 +811,11 @@ const ( NotificationLevelWarning NotificationLevel = "Warning" ) +// PossibleNotificationLevelValues returns an array of possible values for the NotificationLevel const type. +func PossibleNotificationLevelValues() []NotificationLevel { + return []NotificationLevel{NotificationLevelCritical, NotificationLevelInformation, NotificationLevelNonUrgentSuggestion, NotificationLevelWarning} +} + // OperationStatus enumerates the values for operation status. type OperationStatus string @@ -634,6 +832,11 @@ const ( OperationStatusTimedOut OperationStatus = "TimedOut" ) +// PossibleOperationStatusValues returns an array of possible values for the OperationStatus const type. +func PossibleOperationStatusValues() []OperationStatus { + return []OperationStatus{OperationStatusCreated, OperationStatusFailed, OperationStatusInProgress, OperationStatusSucceeded, OperationStatusTimedOut} +} + // ProvisioningState enumerates the values for provisioning state. type ProvisioningState string @@ -650,6 +853,11 @@ const ( ProvisioningStateSucceeded ProvisioningState = "Succeeded" ) +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ProvisioningStateCanceled, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateInProgress, ProvisioningStateSucceeded} +} + // PublicCertificateLocation enumerates the values for public certificate location. type PublicCertificateLocation string @@ -662,6 +870,11 @@ const ( PublicCertificateLocationUnknown PublicCertificateLocation = "Unknown" ) +// PossiblePublicCertificateLocationValues returns an array of possible values for the PublicCertificateLocation const type. +func PossiblePublicCertificateLocationValues() []PublicCertificateLocation { + return []PublicCertificateLocation{PublicCertificateLocationCurrentUserMy, PublicCertificateLocationLocalMachineMy, PublicCertificateLocationUnknown} +} + // PublishingProfileFormat enumerates the values for publishing profile format. type PublishingProfileFormat string @@ -674,6 +887,11 @@ const ( WebDeploy PublishingProfileFormat = "WebDeploy" ) +// PossiblePublishingProfileFormatValues returns an array of possible values for the PublishingProfileFormat const type. +func PossiblePublishingProfileFormatValues() []PublishingProfileFormat { + return []PublishingProfileFormat{FileZilla3, Ftp, WebDeploy} +} + // ResourceScopeType enumerates the values for resource scope type. type ResourceScopeType string @@ -686,6 +904,11 @@ const ( WebSite ResourceScopeType = "WebSite" ) +// PossibleResourceScopeTypeValues returns an array of possible values for the ResourceScopeType const type. +func PossibleResourceScopeTypeValues() []ResourceScopeType { + return []ResourceScopeType{ServerFarm, Subscription, WebSite} +} + // RouteType enumerates the values for route type. type RouteType string @@ -698,6 +921,11 @@ const ( STATIC RouteType = "STATIC" ) +// PossibleRouteTypeValues returns an array of possible values for the RouteType const type. +func PossibleRouteTypeValues() []RouteType { + return []RouteType{DEFAULT, INHERITED, STATIC} +} + // ScmType enumerates the values for scm type. type ScmType string @@ -730,6 +958,11 @@ const ( ScmTypeVSO ScmType = "VSO" ) +// PossibleScmTypeValues returns an array of possible values for the ScmType const type. +func PossibleScmTypeValues() []ScmType { + return []ScmType{ScmTypeBitbucketGit, ScmTypeBitbucketHg, ScmTypeCodePlexGit, ScmTypeCodePlexHg, ScmTypeDropbox, ScmTypeExternalGit, ScmTypeExternalHg, ScmTypeGitHub, ScmTypeLocalGit, ScmTypeNone, ScmTypeOneDrive, ScmTypeTfs, ScmTypeVSO} +} + // SiteAvailabilityState enumerates the values for site availability state. type SiteAvailabilityState string @@ -742,6 +975,11 @@ const ( Normal SiteAvailabilityState = "Normal" ) +// PossibleSiteAvailabilityStateValues returns an array of possible values for the SiteAvailabilityState const type. +func PossibleSiteAvailabilityStateValues() []SiteAvailabilityState { + return []SiteAvailabilityState{DisasterRecoveryMode, Limited, Normal} +} + // SiteExtensionType enumerates the values for site extension type. type SiteExtensionType string @@ -752,6 +990,11 @@ const ( WebRoot SiteExtensionType = "WebRoot" ) +// PossibleSiteExtensionTypeValues returns an array of possible values for the SiteExtensionType const type. +func PossibleSiteExtensionTypeValues() []SiteExtensionType { + return []SiteExtensionType{Gallery, WebRoot} +} + // SiteLoadBalancing enumerates the values for site load balancing. type SiteLoadBalancing string @@ -768,6 +1011,11 @@ const ( WeightedTotalTraffic SiteLoadBalancing = "WeightedTotalTraffic" ) +// PossibleSiteLoadBalancingValues returns an array of possible values for the SiteLoadBalancing const type. +func PossibleSiteLoadBalancingValues() []SiteLoadBalancing { + return []SiteLoadBalancing{LeastRequests, LeastResponseTime, RequestHash, WeightedRoundRobin, WeightedTotalTraffic} +} + // SkuName enumerates the values for sku name. type SkuName string @@ -790,6 +1038,11 @@ const ( SkuNameStandard SkuName = "Standard" ) +// PossibleSkuNameValues returns an array of possible values for the SkuName const type. +func PossibleSkuNameValues() []SkuName { + return []SkuName{SkuNameBasic, SkuNameDynamic, SkuNameFree, SkuNameIsolated, SkuNamePremium, SkuNamePremiumV2, SkuNameShared, SkuNameStandard} +} + // SolutionType enumerates the values for solution type. type SolutionType string @@ -802,6 +1055,11 @@ const ( QuickSolution SolutionType = "QuickSolution" ) +// PossibleSolutionTypeValues returns an array of possible values for the SolutionType const type. +func PossibleSolutionTypeValues() []SolutionType { + return []SolutionType{BestPractices, DeepInvestigation, QuickSolution} +} + // SslState enumerates the values for ssl state. type SslState string @@ -814,6 +1072,11 @@ const ( SniEnabled SslState = "SniEnabled" ) +// PossibleSslStateValues returns an array of possible values for the SslState const type. +func PossibleSslStateValues() []SslState { + return []SslState{Disabled, IPBasedEnabled, SniEnabled} +} + // StatusOptions enumerates the values for status options. type StatusOptions string @@ -826,6 +1089,28 @@ const ( StatusOptionsReady StatusOptions = "Ready" ) +// PossibleStatusOptionsValues returns an array of possible values for the StatusOptions const type. +func PossibleStatusOptionsValues() []StatusOptions { + return []StatusOptions{StatusOptionsCreating, StatusOptionsPending, StatusOptionsReady} +} + +// 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" +) + +// PossibleSupportedTLSVersionsValues returns an array of possible values for the SupportedTLSVersions const type. +func PossibleSupportedTLSVersionsValues() []SupportedTLSVersions { + return []SupportedTLSVersions{OneFullStopOne, OneFullStopTwo, OneFullStopZero} +} + // TriggeredWebJobStatus enumerates the values for triggered web job status. type TriggeredWebJobStatus string @@ -838,6 +1123,11 @@ const ( TriggeredWebJobStatusSuccess TriggeredWebJobStatus = "Success" ) +// PossibleTriggeredWebJobStatusValues returns an array of possible values for the TriggeredWebJobStatus const type. +func PossibleTriggeredWebJobStatusValues() []TriggeredWebJobStatus { + return []TriggeredWebJobStatus{TriggeredWebJobStatusError, TriggeredWebJobStatusFailed, TriggeredWebJobStatusSuccess} +} + // UnauthenticatedClientAction enumerates the values for unauthenticated client action. type UnauthenticatedClientAction string @@ -848,6 +1138,11 @@ const ( RedirectToLoginPage UnauthenticatedClientAction = "RedirectToLoginPage" ) +// PossibleUnauthenticatedClientActionValues returns an array of possible values for the UnauthenticatedClientAction const type. +func PossibleUnauthenticatedClientActionValues() []UnauthenticatedClientAction { + return []UnauthenticatedClientAction{AllowAnonymous, RedirectToLoginPage} +} + // UsageState enumerates the values for usage state. type UsageState string @@ -858,6 +1153,11 @@ const ( UsageStateNormal UsageState = "Normal" ) +// PossibleUsageStateValues returns an array of possible values for the UsageState const type. +func PossibleUsageStateValues() []UsageState { + return []UsageState{UsageStateExceeded, UsageStateNormal} +} + // ValidateResourceTypes enumerates the values for validate resource types. type ValidateResourceTypes string @@ -868,6 +1168,11 @@ const ( ValidateResourceTypesSite ValidateResourceTypes = "Site" ) +// PossibleValidateResourceTypesValues returns an array of possible values for the ValidateResourceTypes const type. +func PossibleValidateResourceTypesValues() []ValidateResourceTypes { + return []ValidateResourceTypes{ValidateResourceTypesServerFarm, ValidateResourceTypesSite} +} + // WorkerSizeOptions enumerates the values for worker size options. type WorkerSizeOptions string @@ -888,6 +1193,11 @@ const ( Small WorkerSizeOptions = "Small" ) +// PossibleWorkerSizeOptionsValues returns an array of possible values for the WorkerSizeOptions const type. +func PossibleWorkerSizeOptionsValues() []WorkerSizeOptions { + return []WorkerSizeOptions{D1, D2, D3, Default, Large, Medium, Small} +} + // AbnormalTimePeriod class representing Abnormal Time Period identified in diagnosis type AbnormalTimePeriod struct { // StartTime - Start time of the downtime @@ -945,6 +1255,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 +1265,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for AnalysisDefinition. +func (ad AnalysisDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ad.AnalysisDefinitionProperties != nil { + objectMap["properties"] = ad.AnalysisDefinitionProperties + } + if ad.ID != nil { + objectMap["id"] = ad.ID + } + if ad.Name != nil { + objectMap["name"] = ad.Name + } + if ad.Kind != nil { + objectMap["kind"] = ad.Kind + } + if ad.Type != nil { + objectMap["type"] = ad.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for AnalysisDefinition struct. @@ -964,56 +1295,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 @@ -1245,6 +1574,122 @@ type ApplicationLogsConfig struct { AzureBlobStorage *AzureBlobStorageApplicationLogsConfig `json:"azureBlobStorage,omitempty"` } +// ApplicationStack application stack. +type ApplicationStack struct { + // Name - Application stack name. + Name *string `json:"name,omitempty"` + // Display - Application stack display name. + Display *string `json:"display,omitempty"` + // Dependency - Application stack dependency. + Dependency *string `json:"dependency,omitempty"` + // MajorVersions - List of major versions available. + MajorVersions *[]StackMajorVersion `json:"majorVersions,omitempty"` + // Frameworks - List of frameworks associated with application stack. + Frameworks *[]ApplicationStack `json:"frameworks,omitempty"` +} + +// ApplicationStackCollection collection of Application Stacks +type ApplicationStackCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]ApplicationStack `json:"value,omitempty"` + // NextLink - Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// ApplicationStackCollectionIterator provides access to a complete listing of ApplicationStack values. +type ApplicationStackCollectionIterator struct { + i int + page ApplicationStackCollectionPage +} + +// 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 *ApplicationStackCollectionIterator) 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 ApplicationStackCollectionIterator) 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 ApplicationStackCollectionIterator) Response() ApplicationStackCollection { + 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 ApplicationStackCollectionIterator) Value() ApplicationStack { + if !iter.page.NotDone() { + return ApplicationStack{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (asc ApplicationStackCollection) IsEmpty() bool { + return asc.Value == nil || len(*asc.Value) == 0 +} + +// applicationStackCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (asc ApplicationStackCollection) applicationStackCollectionPreparer() (*http.Request, error) { + if asc.NextLink == nil || len(to.String(asc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(asc.NextLink))) +} + +// ApplicationStackCollectionPage contains a page of ApplicationStack values. +type ApplicationStackCollectionPage struct { + fn func(ApplicationStackCollection) (ApplicationStackCollection, error) + asc ApplicationStackCollection +} + +// 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 *ApplicationStackCollectionPage) Next() error { + next, err := page.fn(page.asc) + if err != nil { + return err + } + page.asc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ApplicationStackCollectionPage) NotDone() bool { + return !page.asc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ApplicationStackCollectionPage) Response() ApplicationStackCollection { + return page.asc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ApplicationStackCollectionPage) Values() []ApplicationStack { + if page.asc.IsEmpty() { + return nil + } + return *page.asc.Value +} + // AppsCreateFunctionFuture an abstraction for monitoring and retrieving the results of a long-running operation. type AppsCreateFunctionFuture struct { azure.Future @@ -1257,22 +1702,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 +1751,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 +1800,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 +1849,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 +1898,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()) - return + 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 +1947,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 +1995,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 +2044,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 +2093,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 +2142,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 +2294,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 +2307,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 +2520,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 +2530,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for AppServiceCertificateOrderPatchResource. +func (ascopr AppServiceCertificateOrderPatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ascopr.AppServiceCertificateOrderPatchResourceProperties != nil { + objectMap["properties"] = ascopr.AppServiceCertificateOrderPatchResourceProperties + } + if ascopr.ID != nil { + objectMap["id"] = ascopr.ID + } + if ascopr.Name != nil { + objectMap["name"] = ascopr.Name + } + if ascopr.Kind != nil { + objectMap["kind"] = ascopr.Kind + } + if ascopr.Type != nil { + objectMap["type"] = ascopr.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for AppServiceCertificateOrderPatchResource struct. @@ -1900,56 +2560,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 +2617,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 +2656,73 @@ 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 + } + if ascopr.ProductType != "" { + objectMap["productType"] = ascopr.ProductType + } + if ascopr.AutoRenew != nil { + objectMap["autoRenew"] = ascopr.AutoRenew + } + if ascopr.ProvisioningState != "" { + objectMap["provisioningState"] = ascopr.ProvisioningState + } + if ascopr.Status != "" { + 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 +2761,71 @@ 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 + } + if asco.ProductType != "" { + objectMap["productType"] = asco.ProductType + } + if asco.AutoRenew != nil { + objectMap["autoRenew"] = asco.AutoRenew + } + if asco.ProvisioningState != "" { + objectMap["provisioningState"] = asco.ProvisioningState + } + if asco.Status != "" { + 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 +2837,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 +2886,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 +2935,27 @@ type AppServiceCertificatePatchResource struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // AppServiceCertificate - Core resource properties - *AppServiceCertificate `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for AppServiceCertificatePatchResource. +func (ascpr AppServiceCertificatePatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ascpr.AppServiceCertificate != nil { + objectMap["properties"] = ascpr.AppServiceCertificate + } + if ascpr.ID != nil { + objectMap["id"] = ascpr.ID + } + if ascpr.Name != nil { + objectMap["name"] = ascpr.Name + } + if ascpr.Kind != nil { + objectMap["kind"] = ascpr.Kind + } + if ascpr.Type != nil { + objectMap["type"] = ascpr.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for AppServiceCertificatePatchResource struct. @@ -2126,64 +2965,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,88 +3035,109 @@ 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"` } -// UnmarshalJSON is the custom unmarshaler for AppServiceCertificateResource struct. -func (ascr *AppServiceCertificateResource) 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 AppServiceCertificateResource. +func (ascr AppServiceCertificateResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ascr.AppServiceCertificate != nil { + objectMap["properties"] = ascr.AppServiceCertificate } - var v *json.RawMessage - - v = m["properties"] - if v != nil { - var properties AppServiceCertificate - err = json.Unmarshal(*m["properties"], &properties) - if err != nil { - return err - } - ascr.AppServiceCertificate = &properties + if ascr.ID != nil { + objectMap["id"] = ascr.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - ascr.ID = &ID + if ascr.Name != nil { + objectMap["name"] = ascr.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - ascr.Name = &name + if ascr.Kind != nil { + objectMap["kind"] = ascr.Kind } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - ascr.Kind = &kind + if ascr.Location != nil { + objectMap["location"] = ascr.Location } - - v = m["location"] - if v != nil { - var location string - err = json.Unmarshal(*m["location"], &location) - if err != nil { - return err - } - ascr.Location = &location + if ascr.Type != nil { + objectMap["type"] = ascr.Type } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - ascr.Type = &typeVar + if ascr.Tags != nil { + objectMap["tags"] = ascr.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 AppServiceCertificateResource struct. +func (ascr *AppServiceCertificateResource) 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 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.Tags = &tags } return nil @@ -2465,6 +3326,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 +3336,27 @@ type AppServiceEnvironmentPatchResource struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // AppServiceEnvironment - Core resource properties - *AppServiceEnvironment `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for AppServiceEnvironmentPatchResource. +func (asepr AppServiceEnvironmentPatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asepr.AppServiceEnvironment != nil { + objectMap["properties"] = asepr.AppServiceEnvironment + } + if asepr.ID != nil { + objectMap["id"] = asepr.ID + } + if asepr.Name != nil { + objectMap["name"] = asepr.Name + } + if asepr.Kind != nil { + objectMap["kind"] = asepr.Kind + } + if asepr.Type != nil { + objectMap["type"] = asepr.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for AppServiceEnvironmentPatchResource struct. @@ -2484,64 +3366,64 @@ 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 + 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.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 - } - asepr.Type = &typeVar - } - - return nil -} + return nil +} // 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 +3435,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 +3556,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 +3605,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 +3654,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 +3703,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 +3752,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 +3801,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 +3850,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 +3899,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 +3952,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 +4176,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 +4186,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for AppServicePlanPatchResource. +func (asppr AppServicePlanPatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asppr.AppServicePlanPatchResourceProperties != nil { + objectMap["properties"] = asppr.AppServicePlanPatchResourceProperties + } + if asppr.ID != nil { + objectMap["id"] = asppr.ID + } + if asppr.Name != nil { + objectMap["name"] = asppr.Name + } + if asppr.Kind != nil { + objectMap["kind"] = asppr.Kind + } + if asppr.Type != nil { + objectMap["type"] = asppr.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for AppServicePlanPatchResource struct. @@ -3131,56 +4216,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 +4360,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 +4409,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 +4458,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 +4507,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 +4556,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 +4604,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 +4652,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 +4700,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 +4748,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 +4796,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 +4844,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 +4892,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 +4941,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 +5052,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 +5062,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for BackupItem. +func (bi BackupItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if bi.BackupItemProperties != nil { + objectMap["properties"] = bi.BackupItemProperties + } + if bi.ID != nil { + objectMap["id"] = bi.ID + } + if bi.Name != nil { + objectMap["name"] = bi.Name + } + if bi.Kind != nil { + objectMap["kind"] = bi.Kind + } + if bi.Type != nil { + objectMap["type"] = bi.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for BackupItem struct. @@ -3766,56 +5092,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 +5282,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 +5292,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for BackupRequest. +func (br BackupRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if br.BackupRequestProperties != nil { + objectMap["properties"] = br.BackupRequestProperties + } + if br.ID != nil { + objectMap["id"] = br.ID + } + if br.Name != nil { + objectMap["name"] = br.Name + } + if br.Kind != nil { + objectMap["kind"] = br.Kind + } + if br.Type != nil { + objectMap["type"] = br.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for BackupRequest struct. @@ -3977,56 +5322,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 +5391,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 +5421,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 +5434,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 +5668,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 +5678,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for CertificateEmail. +func (ce CertificateEmail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ce.CertificateEmailProperties != nil { + objectMap["properties"] = ce.CertificateEmailProperties + } + if ce.ID != nil { + objectMap["id"] = ce.ID + } + if ce.Name != nil { + objectMap["name"] = ce.Name + } + if ce.Kind != nil { + objectMap["kind"] = ce.Kind + } + if ce.Type != nil { + objectMap["type"] = ce.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for CertificateEmail struct. @@ -4321,56 +5708,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 +5771,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 +5781,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for CertificateOrderAction. +func (coa CertificateOrderAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if coa.CertificateOrderActionProperties != nil { + objectMap["properties"] = coa.CertificateOrderActionProperties + } + if coa.ID != nil { + objectMap["id"] = coa.ID + } + if coa.Name != nil { + objectMap["name"] = coa.Name + } + if coa.Kind != nil { + objectMap["kind"] = coa.Kind + } + if coa.Type != nil { + objectMap["type"] = coa.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for CertificateOrderAction struct. @@ -4405,56 +5811,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 +5874,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 +5884,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for CertificatePatchResource. +func (cpr CertificatePatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cpr.CertificatePatchResourceProperties != nil { + objectMap["properties"] = cpr.CertificatePatchResourceProperties + } + if cpr.ID != nil { + objectMap["id"] = cpr.ID + } + if cpr.Name != nil { + objectMap["name"] = cpr.Name + } + if cpr.Kind != nil { + objectMap["kind"] = cpr.Kind + } + if cpr.Type != nil { + objectMap["type"] = cpr.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for CertificatePatchResource struct. @@ -4489,56 +5914,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 +6074,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 +6086,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 +6138,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 +6206,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 +6216,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for ContinuousWebJob. +func (cwj ContinuousWebJob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cwj.ContinuousWebJobProperties != nil { + objectMap["properties"] = cwj.ContinuousWebJobProperties + } + if cwj.ID != nil { + objectMap["id"] = cwj.ID + } + if cwj.Name != nil { + objectMap["name"] = cwj.Name + } + if cwj.Kind != nil { + objectMap["kind"] = cwj.Kind + } + if cwj.Type != nil { + objectMap["type"] = cwj.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ContinuousWebJob struct. @@ -4742,56 +6246,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,18 +6424,57 @@ 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"` } -// CorsSettings cross-Origin Resource Sharing (CORS) settings for the app. -type CorsSettings struct { +// MarshalJSON is the custom marshaler for ContinuousWebJobProperties. +func (cwj ContinuousWebJobProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cwj.Status != "" { + 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 + } + if cwj.JobType != "" { + 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. +type CorsSettings struct { // AllowedOrigins - Gets or sets the list of origins that should be allowed to make cross-origin // calls (for example: http://example.com:12345). Use "*" to allow all. 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 +6739,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 +6749,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for CustomHostnameAnalysisResult. +func (char CustomHostnameAnalysisResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if char.CustomHostnameAnalysisResultProperties != nil { + objectMap["properties"] = char.CustomHostnameAnalysisResultProperties + } + if char.ID != nil { + objectMap["id"] = char.ID + } + if char.Name != nil { + objectMap["name"] = char.Name + } + if char.Kind != nil { + objectMap["kind"] = char.Kind + } + if char.Type != nil { + objectMap["type"] = char.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for CustomHostnameAnalysisResult struct. @@ -5217,56 +6779,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 - } - 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 + 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.Type = &typeVar } return nil @@ -5439,6 +6999,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 +7009,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for Deployment. +func (d Deployment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if d.DeploymentProperties != nil { + objectMap["properties"] = d.DeploymentProperties + } + if d.ID != nil { + objectMap["id"] = d.ID + } + if d.Name != nil { + objectMap["name"] = d.Name + } + if d.Kind != nil { + objectMap["kind"] = d.Kind + } + if d.Type != nil { + objectMap["type"] = d.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for Deployment struct. @@ -5458,56 +7039,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 +7252,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 +7262,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for DetectorDefinition. +func (dd DetectorDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dd.DetectorDefinitionProperties != nil { + objectMap["properties"] = dd.DetectorDefinitionProperties + } + if dd.ID != nil { + objectMap["id"] = dd.ID + } + if dd.Name != nil { + objectMap["name"] = dd.Name + } + if dd.Kind != nil { + objectMap["kind"] = dd.Kind + } + if dd.Type != nil { + objectMap["type"] = dd.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for DetectorDefinition struct. @@ -5692,56 +7292,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 +7360,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 +7370,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for DiagnosticAnalysis. +func (da DiagnosticAnalysis) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if da.DiagnosticAnalysisProperties != nil { + objectMap["properties"] = da.DiagnosticAnalysisProperties + } + if da.ID != nil { + objectMap["id"] = da.ID + } + if da.Name != nil { + objectMap["name"] = da.Name + } + if da.Kind != nil { + objectMap["kind"] = da.Kind + } + if da.Type != nil { + objectMap["type"] = da.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for DiagnosticAnalysis struct. @@ -5781,56 +7400,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 +7572,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 +7582,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for DiagnosticCategory. +func (dc DiagnosticCategory) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dc.DiagnosticCategoryProperties != nil { + objectMap["properties"] = dc.DiagnosticCategoryProperties + } + if dc.ID != nil { + objectMap["id"] = dc.ID + } + if dc.Name != nil { + objectMap["name"] = dc.Name + } + if dc.Kind != nil { + objectMap["kind"] = dc.Kind + } + if dc.Type != nil { + objectMap["type"] = dc.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for DiagnosticCategory struct. @@ -5974,56 +7612,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 +7878,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 +7888,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for DiagnosticDetectorResponse. +func (ddr DiagnosticDetectorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ddr.DiagnosticDetectorResponseProperties != nil { + objectMap["properties"] = ddr.DiagnosticDetectorResponseProperties + } + if ddr.ID != nil { + objectMap["id"] = ddr.ID + } + if ddr.Name != nil { + objectMap["name"] = ddr.Name + } + if ddr.Kind != nil { + objectMap["kind"] = ddr.Kind + } + if ddr.Type != nil { + objectMap["type"] = ddr.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for DiagnosticDetectorResponse struct. @@ -6261,56 +7918,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 +8038,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 +8051,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 +8286,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 +8296,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for DomainOwnershipIdentifier. +func (doi DomainOwnershipIdentifier) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if doi.DomainOwnershipIdentifierProperties != nil { + objectMap["properties"] = doi.DomainOwnershipIdentifierProperties + } + if doi.ID != nil { + objectMap["id"] = doi.ID + } + if doi.Name != nil { + objectMap["name"] = doi.Name + } + if doi.Kind != nil { + objectMap["kind"] = doi.Kind + } + if doi.Type != nil { + objectMap["type"] = doi.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for DomainOwnershipIdentifier struct. @@ -6627,56 +8326,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,7 +8490,9 @@ type DomainOwnershipIdentifierProperties struct { // DomainPatchResource ARM resource for a domain. type DomainPatchResource struct { - // ID - Resource Id. + // DomainPatchResourceProperties - DomainPatchResource resource specific properties + *DomainPatchResourceProperties `json:"properties,omitempty"` + // ID - Resource Id. ID *string `json:"id,omitempty"` // Name - Resource Name. Name *string `json:"name,omitempty"` @@ -6801,8 +8500,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for DomainPatchResource. +func (dpr DomainPatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dpr.DomainPatchResourceProperties != nil { + objectMap["properties"] = dpr.DomainPatchResourceProperties + } + if dpr.ID != nil { + objectMap["id"] = dpr.ID + } + if dpr.Name != nil { + objectMap["name"] = dpr.Name + } + if dpr.Kind != nil { + objectMap["kind"] = dpr.Kind + } + if dpr.Type != nil { + objectMap["type"] = dpr.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for DomainPatchResource struct. @@ -6812,56 +8530,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 +8689,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 +8702,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 +8760,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 +8797,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 +8807,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for FunctionEnvelope. +func (fe FunctionEnvelope) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fe.FunctionEnvelopeProperties != nil { + objectMap["properties"] = fe.FunctionEnvelopeProperties + } + if fe.ID != nil { + objectMap["id"] = fe.ID + } + if fe.Name != nil { + objectMap["name"] = fe.Name + } + if fe.Kind != nil { + objectMap["kind"] = fe.Kind + } + if fe.Type != nil { + objectMap["type"] = fe.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for FunctionEnvelope struct. @@ -7074,56 +8837,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 +9009,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 +9063,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for FunctionSecrets. +func (fs FunctionSecrets) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fs.FunctionSecretsProperties != nil { + objectMap["properties"] = fs.FunctionSecretsProperties + } + if fs.ID != nil { + objectMap["id"] = fs.ID + } + if fs.Name != nil { + objectMap["name"] = fs.Name + } + if fs.Kind != nil { + objectMap["kind"] = fs.Kind + } + if fs.Type != nil { + objectMap["type"] = fs.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for FunctionSecrets struct. @@ -7277,56 +9093,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 - } - 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 + 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.Type = &typeVar } return nil @@ -7342,6 +9156,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 +9166,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for GeoRegion. +func (gr GeoRegion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gr.GeoRegionProperties != nil { + objectMap["properties"] = gr.GeoRegionProperties + } + if gr.ID != nil { + objectMap["id"] = gr.ID + } + if gr.Name != nil { + objectMap["name"] = gr.Name + } + if gr.Kind != nil { + objectMap["kind"] = gr.Kind + } + if gr.Type != nil { + objectMap["type"] = gr.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for GeoRegion struct. @@ -7361,56 +9196,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 +9379,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 +9437,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 +9447,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for HostNameBinding. +func (hnb HostNameBinding) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if hnb.HostNameBindingProperties != nil { + objectMap["properties"] = hnb.HostNameBindingProperties + } + if hnb.ID != nil { + objectMap["id"] = hnb.ID + } + if hnb.Name != nil { + objectMap["name"] = hnb.Name + } + if hnb.Kind != nil { + objectMap["kind"] = hnb.Kind + } + if hnb.Type != nil { + objectMap["type"] = hnb.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for HostNameBinding struct. @@ -7622,56 +9477,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 +9681,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 +9691,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for HybridConnection. +func (hc HybridConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if hc.HybridConnectionProperties != nil { + objectMap["properties"] = hc.HybridConnectionProperties + } + if hc.ID != nil { + objectMap["id"] = hc.ID + } + if hc.Name != nil { + objectMap["name"] = hc.Name + } + if hc.Kind != nil { + objectMap["kind"] = hc.Kind + } + if hc.Type != nil { + objectMap["type"] = hc.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for HybridConnection struct. @@ -7847,56 +9721,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 +9876,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 +9890,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for HybridConnectionKey. +func (hck HybridConnectionKey) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if hck.HybridConnectionKeyProperties != nil { + objectMap["properties"] = hck.HybridConnectionKeyProperties + } + if hck.ID != nil { + objectMap["id"] = hck.ID + } + if hck.Name != nil { + objectMap["name"] = hck.Name + } + if hck.Kind != nil { + objectMap["kind"] = hck.Kind + } + if hck.Type != nil { + objectMap["type"] = hck.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for HybridConnectionKey struct. @@ -8026,56 +9920,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 +9985,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 +9995,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for HybridConnectionLimits. +func (hcl HybridConnectionLimits) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if hcl.HybridConnectionLimitsProperties != nil { + objectMap["properties"] = hcl.HybridConnectionLimitsProperties + } + if hcl.ID != nil { + objectMap["id"] = hcl.ID + } + if hcl.Name != nil { + objectMap["name"] = hcl.Name + } + if hcl.Kind != nil { + objectMap["kind"] = hcl.Kind + } + if hcl.Type != nil { + objectMap["type"] = hcl.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for HybridConnectionLimits struct. @@ -8112,56 +10025,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 +10110,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 +10120,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for Identifier. +func (i Identifier) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if i.IdentifierProperties != nil { + objectMap["properties"] = i.IdentifierProperties + } + if i.ID != nil { + objectMap["id"] = i.ID + } + if i.Name != nil { + objectMap["name"] = i.Name + } + if i.Kind != nil { + objectMap["kind"] = i.Kind + } + if i.Type != nil { + objectMap["type"] = i.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for Identifier struct. @@ -8218,56 +10150,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 +10322,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 +10332,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for Job. +func (j Job) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if j.JobProperties != nil { + objectMap["properties"] = j.JobProperties + } + if j.ID != nil { + objectMap["id"] = j.ID + } + if j.Name != nil { + objectMap["name"] = j.Name + } + if j.Kind != nil { + objectMap["kind"] = j.Kind + } + if j.Type != nil { + objectMap["type"] = j.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for Job struct. @@ -8411,56 +10362,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 +10534,37 @@ 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 + } + if j.JobType != "" { + 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 ... @@ -8618,12 +10597,6 @@ type ListOperation struct { Value *[]Operation `json:"value,omitempty"` } -// ListRecommendation ... -type ListRecommendation struct { - autorest.Response `json:"-"` - Value *[]Recommendation `json:"value,omitempty"` -} - // ListVnetInfo ... type ListVnetInfo struct { autorest.Response `json:"-"` @@ -8646,8 +10619,8 @@ type LocalizableString struct { // ManagedServiceIdentity managed service identity. type ManagedServiceIdentity struct { - // Type - Type of managed service identity. - Type *map[string]interface{} `json:"type,omitempty"` + // Type - Type of managed service identity. Possible values include: 'SystemAssigned' + Type ManagedServiceIdentityType `json:"type,omitempty"` // TenantID - Tenant of managed service identity. TenantID *string `json:"tenantId,omitempty"` // PrincipalID - Principal Id of managed service identity. @@ -8671,6 +10644,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 +10654,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for MetricDefinition. +func (md MetricDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if md.MetricDefinitionProperties != nil { + objectMap["properties"] = md.MetricDefinitionProperties + } + if md.ID != nil { + objectMap["id"] = md.ID + } + if md.Name != nil { + objectMap["name"] = md.Name + } + if md.Kind != nil { + objectMap["kind"] = md.Kind + } + if md.Type != nil { + objectMap["type"] = md.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for MetricDefinition struct. @@ -8690,56 +10684,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 +10772,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 +10782,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for MigrateMySQLRequest. +func (mmsr MigrateMySQLRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mmsr.MigrateMySQLRequestProperties != nil { + objectMap["properties"] = mmsr.MigrateMySQLRequestProperties + } + if mmsr.ID != nil { + objectMap["id"] = mmsr.ID + } + if mmsr.Name != nil { + objectMap["name"] = mmsr.Name + } + if mmsr.Kind != nil { + objectMap["kind"] = mmsr.Kind + } + if mmsr.Type != nil { + objectMap["type"] = mmsr.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for MigrateMySQLRequest struct. @@ -8799,56 +10812,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 +10876,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 +10886,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for MigrateMySQLStatus. +func (mmss MigrateMySQLStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mmss.MigrateMySQLStatusProperties != nil { + objectMap["properties"] = mmss.MigrateMySQLStatusProperties + } + if mmss.ID != nil { + objectMap["id"] = mmss.ID + } + if mmss.Name != nil { + objectMap["name"] = mmss.Name + } + if mmss.Kind != nil { + objectMap["kind"] = mmss.Kind + } + if mmss.Type != nil { + objectMap["type"] = mmss.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for MigrateMySQLStatus struct. @@ -8884,56 +10916,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 +10981,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 +10991,27 @@ type MSDeploy struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // MSDeployCore - Core resource properties - *MSDeployCore `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for MSDeploy. +func (md MSDeploy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if md.MSDeployCore != nil { + objectMap["properties"] = md.MSDeployCore + } + if md.ID != nil { + objectMap["id"] = md.ID + } + if md.Name != nil { + objectMap["name"] = md.Name + } + if md.Kind != nil { + objectMap["kind"] = md.Kind + } + if md.Type != nil { + objectMap["type"] = md.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for MSDeploy struct. @@ -8970,56 +11021,54 @@ 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 - } - 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 + 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.Type = &typeVar } return nil @@ -9036,7 +11085,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 +11096,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 +11136,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for MSDeployLog. +func (mdl MSDeployLog) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mdl.MSDeployLogProperties != nil { + objectMap["properties"] = mdl.MSDeployLogProperties + } + if mdl.ID != nil { + objectMap["id"] = mdl.ID + } + if mdl.Name != nil { + objectMap["name"] = mdl.Name + } + if mdl.Kind != nil { + objectMap["kind"] = mdl.Kind + } + if mdl.Type != nil { + objectMap["type"] = mdl.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for MSDeployLog struct. @@ -9069,56 +11166,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 +11238,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 +11248,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for MSDeployStatus. +func (mds MSDeployStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mds.MSDeployStatusProperties != nil { + objectMap["properties"] = mds.MSDeployStatusProperties + } + if mds.ID != nil { + objectMap["id"] = mds.ID + } + if mds.Name != nil { + objectMap["name"] = mds.Name + } + if mds.Kind != nil { + objectMap["kind"] = mds.Kind + } + if mds.Type != nil { + objectMap["type"] = mds.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for MSDeployStatus struct. @@ -9162,56 +11278,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 +11476,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 +11486,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for NetworkFeatures. +func (nf NetworkFeatures) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if nf.NetworkFeaturesProperties != nil { + objectMap["properties"] = nf.NetworkFeaturesProperties + } + if nf.ID != nil { + objectMap["id"] = nf.ID + } + if nf.Name != nil { + objectMap["name"] = nf.Name + } + if nf.Kind != nil { + objectMap["kind"] = nf.Kind + } + if nf.Type != nil { + objectMap["type"] = nf.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for NetworkFeatures struct. @@ -9381,56 +11516,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 +11743,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 +11756,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 +11866,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 +11876,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for PremierAddOnOffer. +func (paoo PremierAddOnOffer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if paoo.PremierAddOnOfferProperties != nil { + objectMap["properties"] = paoo.PremierAddOnOfferProperties + } + if paoo.ID != nil { + objectMap["id"] = paoo.ID + } + if paoo.Name != nil { + objectMap["name"] = paoo.Name + } + if paoo.Kind != nil { + objectMap["kind"] = paoo.Kind + } + if paoo.Type != nil { + objectMap["type"] = paoo.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for PremierAddOnOffer struct. @@ -9729,56 +11906,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 +12100,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 +12150,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for ProcessInfo. +func (pi ProcessInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pi.ProcessInfoProperties != nil { + objectMap["properties"] = pi.ProcessInfoProperties + } + if pi.ID != nil { + objectMap["id"] = pi.ID + } + if pi.Name != nil { + objectMap["name"] = pi.Name + } + if pi.Kind != nil { + objectMap["kind"] = pi.Kind + } + if pi.Type != nil { + objectMap["type"] = pi.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ProcessInfo struct. @@ -9954,56 +12180,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 +12402,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 +12411,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 +12538,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for ProcessModuleInfo. +func (pmi ProcessModuleInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pmi.ProcessModuleInfoProperties != nil { + objectMap["properties"] = pmi.ProcessModuleInfoProperties + } + if pmi.ID != nil { + objectMap["id"] = pmi.ID + } + if pmi.Name != nil { + objectMap["name"] = pmi.Name + } + if pmi.Kind != nil { + objectMap["kind"] = pmi.Kind + } + if pmi.Type != nil { + objectMap["type"] = pmi.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ProcessModuleInfo struct. @@ -10209,56 +12568,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 +12752,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 +12762,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for ProcessThreadInfo. +func (pti ProcessThreadInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pti.ProcessThreadInfoProperties != nil { + objectMap["properties"] = pti.ProcessThreadInfoProperties + } + if pti.ID != nil { + objectMap["id"] = pti.ID + } + if pti.Name != nil { + objectMap["name"] = pti.Name + } + if pti.Kind != nil { + objectMap["kind"] = pti.Kind + } + if pti.Type != nil { + objectMap["type"] = pti.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ProcessThreadInfo struct. @@ -10414,56 +12792,54 @@ 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 - } - 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 + 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.Type = &typeVar } return nil @@ -10616,6 +12992,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 +13002,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for PublicCertificate. +func (pc PublicCertificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pc.PublicCertificateProperties != nil { + objectMap["properties"] = pc.PublicCertificateProperties + } + if pc.ID != nil { + objectMap["id"] = pc.ID + } + if pc.Name != nil { + objectMap["name"] = pc.Name + } + if pc.Kind != nil { + objectMap["kind"] = pc.Kind + } + if pc.Type != nil { + objectMap["type"] = pc.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for PublicCertificate struct. @@ -10635,60 +13032,58 @@ 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 + 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.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 - } - pc.Type = &typeVar - } - - return nil -} + return nil +} // PublicCertificateCollection collection of public certificates type PublicCertificateCollection struct { @@ -10805,6 +13200,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 +13210,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for PushSettings. +func (ps PushSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ps.PushSettingsProperties != nil { + objectMap["properties"] = ps.PushSettingsProperties + } + if ps.ID != nil { + objectMap["id"] = ps.ID + } + if ps.Name != nil { + objectMap["name"] = ps.Name + } + if ps.Kind != nil { + objectMap["kind"] = ps.Kind + } + if ps.Type != nil { + objectMap["type"] = ps.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for PushSettings struct. @@ -10824,56 +13240,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 + 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.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - ps.Type = &typeVar } return nil @@ -10926,6 +13340,203 @@ type ReadCloser struct { // Recommendation represents a recommendation result generated by the recommendation engine. type Recommendation struct { + // RecommendationProperties - Recommendation resource specific properties + *RecommendationProperties `json:"properties,omitempty"` + // ID - Resource Id. + ID *string `json:"id,omitempty"` + // Name - Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Recommendation. +func (r Recommendation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.RecommendationProperties != nil { + objectMap["properties"] = r.RecommendationProperties + } + 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.Type != nil { + objectMap["type"] = r.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Recommendation struct. +func (r *Recommendation) 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 recommendationProperties RecommendationProperties + err = json.Unmarshal(*v, &recommendationProperties) + if err != nil { + return err + } + r.RecommendationProperties = &recommendationProperties + } + 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 "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + r.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + r.Type = &typeVar + } + } + } + + return nil +} + +// RecommendationCollection collection of recommendations. +type RecommendationCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]Recommendation `json:"value,omitempty"` + // NextLink - Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// RecommendationCollectionIterator provides access to a complete listing of Recommendation values. +type RecommendationCollectionIterator struct { + i int + page RecommendationCollectionPage +} + +// 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 *RecommendationCollectionIterator) 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 RecommendationCollectionIterator) 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 RecommendationCollectionIterator) Response() RecommendationCollection { + 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 RecommendationCollectionIterator) Value() Recommendation { + if !iter.page.NotDone() { + return Recommendation{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (rc RecommendationCollection) IsEmpty() bool { + return rc.Value == nil || len(*rc.Value) == 0 +} + +// recommendationCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rc RecommendationCollection) recommendationCollectionPreparer() (*http.Request, error) { + if rc.NextLink == nil || len(to.String(rc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rc.NextLink))) +} + +// RecommendationCollectionPage contains a page of Recommendation values. +type RecommendationCollectionPage struct { + fn func(RecommendationCollection) (RecommendationCollection, error) + rc RecommendationCollection +} + +// 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 *RecommendationCollectionPage) Next() error { + next, err := page.fn(page.rc) + if err != nil { + return err + } + page.rc = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RecommendationCollectionPage) NotDone() bool { + return !page.rc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RecommendationCollectionPage) Response() RecommendationCollection { + return page.rc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RecommendationCollectionPage) Values() []Recommendation { + if page.rc.IsEmpty() { + return nil + } + return *page.rc.Value +} + +// RecommendationProperties recommendation resource specific properties +type RecommendationProperties struct { // CreationTime - Timestamp when this instance was created. CreationTime *date.Time `json:"creationTime,omitempty"` // RecommendationID - A GUID value that each recommendation object is associated with. @@ -10973,6 +13584,101 @@ type Recommendation struct { // RecommendationRule represents a recommendation rule that the recommendation engine can perform. type RecommendationRule struct { autorest.Response `json:"-"` + // RecommendationRuleProperties - RecommendationRule resource specific properties + *RecommendationRuleProperties `json:"properties,omitempty"` + // ID - Resource Id. + ID *string `json:"id,omitempty"` + // Name - Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecommendationRule. +func (rr RecommendationRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rr.RecommendationRuleProperties != nil { + objectMap["properties"] = rr.RecommendationRuleProperties + } + if rr.ID != nil { + objectMap["id"] = rr.ID + } + if rr.Name != nil { + objectMap["name"] = rr.Name + } + if rr.Kind != nil { + objectMap["kind"] = rr.Kind + } + if rr.Type != nil { + objectMap["type"] = rr.Type + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RecommendationRule struct. +func (rr *RecommendationRule) 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 recommendationRuleProperties RecommendationRuleProperties + err = json.Unmarshal(*v, &recommendationRuleProperties) + if err != nil { + return err + } + rr.RecommendationRuleProperties = &recommendationRuleProperties + } + 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 + } + } + } + + return nil +} + +// RecommendationRuleProperties recommendationRule resource specific properties +type RecommendationRuleProperties struct { // Name - Unique name of the rule. Name *string `json:"name,omitempty"` // DisplayName - UI friendly name of the rule. @@ -11004,6 +13710,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 +13720,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for ReissueCertificateOrderRequest. +func (rcor ReissueCertificateOrderRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rcor.ReissueCertificateOrderRequestProperties != nil { + objectMap["properties"] = rcor.ReissueCertificateOrderRequestProperties + } + if rcor.ID != nil { + objectMap["id"] = rcor.ID + } + if rcor.Name != nil { + objectMap["name"] = rcor.Name + } + if rcor.Kind != nil { + objectMap["kind"] = rcor.Kind + } + if rcor.Type != nil { + objectMap["type"] = rcor.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for ReissueCertificateOrderRequest struct. @@ -11023,56 +13750,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 + 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.Kind = &kind - } - - v = m["type"] - if v != nil { - var typeVar string - err = json.Unmarshal(*m["type"], &typeVar) - if err != nil { - return err - } - rcor.Type = &typeVar } return nil @@ -11093,6 +13818,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 +13828,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for RelayServiceConnectionEntity. +func (rsce RelayServiceConnectionEntity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rsce.RelayServiceConnectionEntityProperties != nil { + objectMap["properties"] = rsce.RelayServiceConnectionEntityProperties + } + if rsce.ID != nil { + objectMap["id"] = rsce.ID + } + if rsce.Name != nil { + objectMap["name"] = rsce.Name + } + if rsce.Kind != nil { + objectMap["kind"] = rsce.Kind + } + if rsce.Type != nil { + objectMap["type"] = rsce.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for RelayServiceConnectionEntity struct. @@ -11112,56 +13858,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 + 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.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 - } - rsce.Type = &typeVar } return nil @@ -11180,6 +13924,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 +13934,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for RenewCertificateOrderRequest. +func (rcor RenewCertificateOrderRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rcor.RenewCertificateOrderRequestProperties != nil { + objectMap["properties"] = rcor.RenewCertificateOrderRequestProperties + } + if rcor.ID != nil { + objectMap["id"] = rcor.ID + } + if rcor.Name != nil { + objectMap["name"] = rcor.Name + } + if rcor.Kind != nil { + objectMap["kind"] = rcor.Kind + } + if rcor.Type != nil { + objectMap["type"] = rcor.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for RenewCertificateOrderRequest struct. @@ -11199,56 +13964,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 +14048,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 +14311,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,67 +14321,84 @@ 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. -func (rmd *ResourceMetricDefinition) 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 ResourceMetricDefinition. +func (rmd ResourceMetricDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rmd.ResourceMetricDefinitionProperties != nil { + objectMap["properties"] = rmd.ResourceMetricDefinitionProperties } - 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 + if rmd.ID != nil { + objectMap["id"] = rmd.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - rmd.ID = &ID + if rmd.Name != nil { + objectMap["name"] = rmd.Name + } + if rmd.Kind != nil { + objectMap["kind"] = rmd.Kind } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - rmd.Name = &name + if rmd.Type != nil { + objectMap["type"] = rmd.Type } + return json.Marshal(objectMap) +} - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - rmd.Kind = &kind +// UnmarshalJSON is the custom unmarshaler for ResourceMetricDefinition struct. +func (rmd *ResourceMetricDefinition) 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 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 +14413,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 +14522,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 +14616,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 +14626,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for RestoreRequest. +func (rr RestoreRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rr.RestoreRequestProperties != nil { + objectMap["properties"] = rr.RestoreRequestProperties + } + if rr.ID != nil { + objectMap["id"] = rr.ID + } + if rr.Name != nil { + objectMap["name"] = rr.Name + } + if rr.Kind != nil { + objectMap["kind"] = rr.Kind + } + if rr.Type != nil { + objectMap["type"] = rr.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for RestoreRequest struct. @@ -11801,56 +14656,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 +14739,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 +14749,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for RestoreResponse. +func (rr RestoreResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rr.RestoreResponseProperties != nil { + objectMap["properties"] = rr.RestoreResponseProperties + } + if rr.ID != nil { + objectMap["id"] = rr.ID + } + if rr.Name != nil { + objectMap["name"] = rr.Name + } + if rr.Kind != nil { + objectMap["kind"] = rr.Kind + } + if rr.Type != nil { + objectMap["type"] = rr.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for RestoreResponse struct. @@ -11905,56 +14779,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 +14846,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 +14866,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 +14989,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 +14999,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for SiteAuthSettings. +func (sas SiteAuthSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sas.SiteAuthSettingsProperties != nil { + objectMap["properties"] = sas.SiteAuthSettingsProperties + } + if sas.ID != nil { + objectMap["id"] = sas.ID + } + if sas.Name != nil { + objectMap["name"] = sas.Name + } + if sas.Kind != nil { + objectMap["kind"] = sas.Kind + } + if sas.Type != nil { + objectMap["type"] = sas.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for SiteAuthSettings struct. @@ -12111,56 +15029,54 @@ 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 - } - 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 + 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.Type = &typeVar } return nil @@ -12367,11 +15283,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 +15302,27 @@ type SiteConfigResource struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // SiteConfig - Core resource properties - *SiteConfig `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SiteConfigResource. +func (scr SiteConfigResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scr.SiteConfig != nil { + objectMap["properties"] = scr.SiteConfig + } + if scr.ID != nil { + objectMap["id"] = scr.ID + } + if scr.Name != nil { + objectMap["name"] = scr.Name + } + if scr.Kind != nil { + objectMap["kind"] = scr.Kind + } + if scr.Type != nil { + objectMap["type"] = scr.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for SiteConfigResource struct. @@ -12391,56 +15332,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 +15489,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 +15499,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for SiteConfigurationSnapshotInfo. +func (scsi SiteConfigurationSnapshotInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scsi.SiteConfigurationSnapshotInfoProperties != nil { + objectMap["properties"] = scsi.SiteConfigurationSnapshotInfoProperties + } + if scsi.ID != nil { + objectMap["id"] = scsi.ID + } + if scsi.Name != nil { + objectMap["name"] = scsi.Name + } + if scsi.Kind != nil { + objectMap["kind"] = scsi.Kind + } + if scsi.Type != nil { + objectMap["type"] = scsi.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for SiteConfigurationSnapshotInfo struct. @@ -12569,56 +15529,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 +15697,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 +15707,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for SiteExtensionInfo. +func (sei SiteExtensionInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sei.SiteExtensionInfoProperties != nil { + objectMap["properties"] = sei.SiteExtensionInfoProperties + } + if sei.ID != nil { + objectMap["id"] = sei.ID + } + if sei.Name != nil { + objectMap["name"] = sei.Name + } + if sei.Kind != nil { + objectMap["kind"] = sei.Kind + } + if sei.Type != nil { + objectMap["type"] = sei.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for SiteExtensionInfo struct. @@ -12758,56 +15737,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 +15938,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,67 +15948,84 @@ 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. -func (si *SiteInstance) 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 SiteInstance. +func (si SiteInstance) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if si.SiteInstanceProperties != nil { + objectMap["properties"] = si.SiteInstanceProperties } - 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 + if si.ID != nil { + objectMap["id"] = si.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - si.ID = &ID + if si.Name != nil { + objectMap["name"] = si.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - si.Name = &name + if si.Kind != nil { + objectMap["kind"] = si.Kind } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - si.Kind = &kind + if si.Type != nil { + objectMap["type"] = si.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 SiteInstance struct. +func (si *SiteInstance) 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 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 +16050,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 +16060,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for SiteLogsConfig. +func (slc SiteLogsConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if slc.SiteLogsConfigProperties != nil { + objectMap["properties"] = slc.SiteLogsConfigProperties + } + if slc.ID != nil { + objectMap["id"] = slc.ID + } + if slc.Name != nil { + objectMap["name"] = slc.Name + } + if slc.Kind != nil { + objectMap["kind"] = slc.Kind + } + if slc.Type != nil { + objectMap["type"] = slc.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for SiteLogsConfig struct. @@ -13073,56 +16090,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 +16169,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 +16179,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for SitePatchResource. +func (spr SitePatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if spr.SitePatchResourceProperties != nil { + objectMap["properties"] = spr.SitePatchResourceProperties + } + if spr.ID != nil { + objectMap["id"] = spr.ID + } + if spr.Name != nil { + objectMap["name"] = spr.Name + } + if spr.Kind != nil { + objectMap["kind"] = spr.Kind + } + if spr.Type != nil { + objectMap["type"] = spr.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for SitePatchResource struct. @@ -13173,56 +16209,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 +16337,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 +16347,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for SitePhpErrorLogFlag. +func (spelf SitePhpErrorLogFlag) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if spelf.SitePhpErrorLogFlagProperties != nil { + objectMap["properties"] = spelf.SitePhpErrorLogFlagProperties + } + if spelf.ID != nil { + objectMap["id"] = spelf.ID + } + if spelf.Name != nil { + objectMap["name"] = spelf.Name + } + if spelf.Kind != nil { + objectMap["kind"] = spelf.Kind + } + if spelf.Type != nil { + objectMap["type"] = spelf.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for SitePhpErrorLogFlag struct. @@ -13322,56 +16377,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 +16532,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 +16542,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for SiteSourceControl. +func (ssc SiteSourceControl) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssc.SiteSourceControlProperties != nil { + objectMap["properties"] = ssc.SiteSourceControlProperties + } + if ssc.ID != nil { + objectMap["id"] = ssc.ID + } + if ssc.Name != nil { + objectMap["name"] = ssc.Name + } + if ssc.Kind != nil { + objectMap["kind"] = ssc.Kind + } + if ssc.Type != nil { + objectMap["type"] = ssc.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for SiteSourceControl struct. @@ -13498,56 +16572,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 +16792,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 +16805,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 +16815,27 @@ type SlotConfigNamesResource struct { Kind *string `json:"kind,omitempty"` // Type - Resource type. Type *string `json:"type,omitempty"` - // SlotConfigNames - Core resource properties - *SlotConfigNames `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SlotConfigNamesResource. +func (scnr SlotConfigNamesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scnr.SlotConfigNames != nil { + objectMap["properties"] = scnr.SlotConfigNames + } + if scnr.ID != nil { + objectMap["id"] = scnr.ID + } + if scnr.Name != nil { + objectMap["name"] = scnr.Name + } + if scnr.Kind != nil { + objectMap["kind"] = scnr.Kind + } + if scnr.Type != nil { + objectMap["type"] = scnr.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for SlotConfigNamesResource struct. @@ -13752,56 +16845,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 +16900,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 +16910,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for SlotDifference. +func (sd SlotDifference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sd.SlotDifferenceProperties != nil { + objectMap["properties"] = sd.SlotDifferenceProperties + } + 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) } // UnmarshalJSON is the custom unmarshaler for SlotDifference struct. @@ -13828,56 +16940,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 +17135,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 +17145,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for Snapshot. +func (s Snapshot) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.SnapshotProperties != nil { + objectMap["properties"] = s.SnapshotProperties + } + if s.ID != nil { + objectMap["id"] = s.ID + } + if s.Name != nil { + objectMap["name"] = s.Name + } + if s.Kind != nil { + objectMap["kind"] = s.Kind + } + if s.Type != nil { + objectMap["type"] = s.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for Snapshot struct. @@ -14044,56 +17175,54 @@ 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 - } - 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 + 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.Type = &typeVar } return nil @@ -14209,6 +17338,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 +17348,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for SnapshotRecoveryRequest. +func (srr SnapshotRecoveryRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if srr.SnapshotRecoveryRequestProperties != nil { + objectMap["properties"] = srr.SnapshotRecoveryRequestProperties + } + if srr.ID != nil { + objectMap["id"] = srr.ID + } + if srr.Name != nil { + objectMap["name"] = srr.Name + } + if srr.Kind != nil { + objectMap["kind"] = srr.Kind + } + if srr.Type != nil { + objectMap["type"] = srr.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for SnapshotRecoveryRequest struct. @@ -14228,56 +17378,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 +17477,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 +17487,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for SourceControl. +func (sc SourceControl) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sc.SourceControlProperties != nil { + objectMap["properties"] = sc.SourceControlProperties + } + if sc.ID != nil { + objectMap["id"] = sc.ID + } + if sc.Name != nil { + objectMap["name"] = sc.Name + } + if sc.Kind != nil { + objectMap["kind"] = sc.Kind + } + if sc.Type != nil { + objectMap["type"] = sc.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for SourceControl struct. @@ -14348,56 +17517,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 - } - sc.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 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.Type = &typeVar } return nil @@ -14519,6 +17686,28 @@ type SourceControlProperties struct { ExpirationTime *date.Time `json:"expirationTime,omitempty"` } +// StackMajorVersion application stack major version. +type StackMajorVersion struct { + // DisplayVersion - Application stack major version (display only). + DisplayVersion *string `json:"displayVersion,omitempty"` + // RuntimeVersion - Application stack major version (runtime only). + RuntimeVersion *string `json:"runtimeVersion,omitempty"` + // IsDefault - true if this is the default major version; otherwise, false. + IsDefault *bool `json:"isDefault,omitempty"` + // MinorVersions - Minor versions associated with the major version. + MinorVersions *[]StackMinorVersion `json:"minorVersions,omitempty"` +} + +// StackMinorVersion application stack minor version. +type StackMinorVersion struct { + // DisplayVersion - Application stack minor version (display only). + DisplayVersion *string `json:"displayVersion,omitempty"` + // RuntimeVersion - Application stack minor version (runtime only). + RuntimeVersion *string `json:"runtimeVersion,omitempty"` + // IsDefault - true if this is the default minor version; otherwise, false. + IsDefault *bool `json:"isDefault,omitempty"` +} + // StampCapacity stamp capacity information. type StampCapacity struct { // Name - Name of the stamp. @@ -14665,6 +17854,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 +17864,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for StorageMigrationOptions. +func (smo StorageMigrationOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if smo.StorageMigrationOptionsProperties != nil { + objectMap["properties"] = smo.StorageMigrationOptionsProperties + } + if smo.ID != nil { + objectMap["id"] = smo.ID + } + if smo.Name != nil { + objectMap["name"] = smo.Name + } + if smo.Kind != nil { + objectMap["kind"] = smo.Kind + } + if smo.Type != nil { + objectMap["type"] = smo.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for StorageMigrationOptions struct. @@ -14684,56 +17894,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 - } - smo.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 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.Type = &typeVar } return nil @@ -14754,6 +17962,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 +17972,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for StorageMigrationResponse. +func (smr StorageMigrationResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if smr.StorageMigrationResponseProperties != nil { + objectMap["properties"] = smr.StorageMigrationResponseProperties + } + if smr.ID != nil { + objectMap["id"] = smr.ID + } + if smr.Name != nil { + objectMap["name"] = smr.Name + } + if smr.Kind != nil { + objectMap["kind"] = smr.Kind + } + if smr.Type != nil { + objectMap["type"] = smr.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for StorageMigrationResponse struct. @@ -14773,56 +18002,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 +18070,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 +18080,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 +18220,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 +18230,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for TopLevelDomain. +func (tld TopLevelDomain) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tld.TopLevelDomainProperties != nil { + objectMap["properties"] = tld.TopLevelDomainProperties + } + if tld.ID != nil { + objectMap["id"] = tld.ID + } + if tld.Name != nil { + objectMap["name"] = tld.Name + } + if tld.Kind != nil { + objectMap["kind"] = tld.Kind + } + if tld.Type != nil { + objectMap["type"] = tld.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for TopLevelDomain struct. @@ -14991,56 +18260,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 - } - 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 + 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.Type = &typeVar } return nil @@ -15167,6 +18434,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 +18444,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for TriggeredJobHistory. +func (tjh TriggeredJobHistory) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tjh.TriggeredJobHistoryProperties != nil { + objectMap["properties"] = tjh.TriggeredJobHistoryProperties + } + if tjh.ID != nil { + objectMap["id"] = tjh.ID + } + if tjh.Name != nil { + objectMap["name"] = tjh.Name + } + if tjh.Kind != nil { + objectMap["kind"] = tjh.Kind + } + if tjh.Type != nil { + objectMap["type"] = tjh.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for TriggeredJobHistory struct. @@ -15186,56 +18474,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 - } - 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 + 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.Type = &typeVar } return nil @@ -15351,6 +18637,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 +18647,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for TriggeredJobRun. +func (tjr TriggeredJobRun) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tjr.TriggeredJobRunProperties != nil { + objectMap["properties"] = tjr.TriggeredJobRunProperties + } + if tjr.ID != nil { + objectMap["id"] = tjr.ID + } + if tjr.Name != nil { + objectMap["name"] = tjr.Name + } + if tjr.Kind != nil { + objectMap["kind"] = tjr.Kind + } + if tjr.Type != nil { + objectMap["type"] = tjr.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for TriggeredJobRun struct. @@ -15370,56 +18677,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 - } - 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 + 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.Type = &typeVar } return nil @@ -15454,6 +18759,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 +18769,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for TriggeredWebJob. +func (twj TriggeredWebJob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if twj.TriggeredWebJobProperties != nil { + objectMap["properties"] = twj.TriggeredWebJobProperties + } + if twj.ID != nil { + objectMap["id"] = twj.ID + } + if twj.Name != nil { + objectMap["name"] = twj.Name + } + if twj.Kind != nil { + objectMap["kind"] = twj.Kind + } + if twj.Type != nil { + objectMap["type"] = twj.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for TriggeredWebJob struct. @@ -15473,56 +18799,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 - } - twj.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 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.Type = &typeVar } return nil @@ -15653,11 +18977,52 @@ 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 + } + if twj.JobType != "" { + 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 +19031,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for Usage. +func (u Usage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if u.UsageProperties != nil { + objectMap["properties"] = u.UsageProperties + } + if u.ID != nil { + objectMap["id"] = u.ID + } + if u.Name != nil { + objectMap["name"] = u.Name + } + if u.Kind != nil { + objectMap["kind"] = u.Kind + } + if u.Type != nil { + objectMap["type"] = u.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for Usage struct. @@ -15677,56 +19061,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 +19241,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. @@ -15866,9 +19250,28 @@ type User struct { // Kind - Kind of resource. Kind *string `json:"kind,omitempty"` // Type - Resource type. - Type *string `json:"type,omitempty"` - // UserProperties - User resource specific properties - *UserProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for User. +func (u User) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if u.UserProperties != nil { + objectMap["properties"] = u.UserProperties + } + if u.ID != nil { + objectMap["id"] = u.ID + } + if u.Name != nil { + objectMap["name"] = u.Name + } + if u.Kind != nil { + objectMap["kind"] = u.Kind + } + if u.Type != nil { + objectMap["type"] = u.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for User struct. @@ -15878,56 +19281,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 - } - 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 + 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.Type = &typeVar } return nil @@ -15975,6 +19376,24 @@ type ValidateRequest struct { *ValidateProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for ValidateRequest. +func (vr ValidateRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vr.Name != nil { + objectMap["name"] = vr.Name + } + if vr.Type != "" { + objectMap["type"] = vr.Type + } + if vr.Location != nil { + objectMap["location"] = vr.Location + } + if vr.ValidateProperties != nil { + objectMap["properties"] = vr.ValidateProperties + } + return json.Marshal(objectMap) +} + // UnmarshalJSON is the custom unmarshaler for ValidateRequest struct. func (vr *ValidateRequest) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -15982,46 +19401,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 - } - 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 + 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.ValidateProperties = &properties } return nil @@ -16088,10 +19506,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 +19520,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for VnetGateway. +func (vg VnetGateway) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vg.VnetGatewayProperties != nil { + objectMap["properties"] = vg.VnetGatewayProperties + } + if vg.ID != nil { + objectMap["id"] = vg.ID + } + if vg.Name != nil { + objectMap["name"] = vg.Name + } + if vg.Kind != nil { + objectMap["kind"] = vg.Kind + } + if vg.Type != nil { + objectMap["type"] = vg.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for VnetGateway struct. @@ -16111,56 +19550,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 - } - vg.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 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.Type = &typeVar } return nil @@ -16177,6 +19614,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 +19624,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for VnetInfo. +func (vi VnetInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vi.VnetInfoProperties != nil { + objectMap["properties"] = vi.VnetInfoProperties + } + if vi.ID != nil { + objectMap["id"] = vi.ID + } + if vi.Name != nil { + objectMap["name"] = vi.Name + } + if vi.Kind != nil { + objectMap["kind"] = vi.Kind + } + if vi.Type != nil { + objectMap["type"] = vi.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for VnetInfo struct. @@ -16196,56 +19654,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 +19726,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 +19736,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for VnetParameters. +func (vp VnetParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vp.VnetParametersProperties != nil { + objectMap["properties"] = vp.VnetParametersProperties + } + if vp.ID != nil { + objectMap["id"] = vp.ID + } + if vp.Name != nil { + objectMap["name"] = vp.Name + } + if vp.Kind != nil { + objectMap["kind"] = vp.Kind + } + if vp.Type != nil { + objectMap["type"] = vp.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for VnetParameters struct. @@ -16289,56 +19766,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 +19832,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 +19842,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for VnetRoute. +func (vr VnetRoute) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vr.VnetRouteProperties != nil { + objectMap["properties"] = vr.VnetRouteProperties + } + if vr.ID != nil { + objectMap["id"] = vr.ID + } + if vr.Name != nil { + objectMap["name"] = vr.Name + } + if vr.Kind != nil { + objectMap["kind"] = vr.Kind + } + if vr.Type != nil { + objectMap["type"] = vr.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for VnetRoute struct. @@ -16376,56 +19872,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 - } - 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 + 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.Type = &typeVar } return nil @@ -16450,6 +19944,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 +19954,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for VnetValidationFailureDetails. +func (vvfd VnetValidationFailureDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vvfd.VnetValidationFailureDetailsProperties != nil { + objectMap["properties"] = vvfd.VnetValidationFailureDetailsProperties + } + if vvfd.ID != nil { + objectMap["id"] = vvfd.ID + } + if vvfd.Name != nil { + objectMap["name"] = vvfd.Name + } + if vvfd.Kind != nil { + objectMap["kind"] = vvfd.Kind + } + if vvfd.Type != nil { + objectMap["type"] = vvfd.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for VnetValidationFailureDetails struct. @@ -16469,56 +19984,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 - } - 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 + 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.Type = &typeVar } return nil @@ -16534,6 +20047,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 +20057,27 @@ 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"` +} + +// MarshalJSON is the custom marshaler for VnetValidationTestFailure. +func (vvtf VnetValidationTestFailure) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vvtf.VnetValidationTestFailureProperties != nil { + objectMap["properties"] = vvtf.VnetValidationTestFailureProperties + } + if vvtf.ID != nil { + objectMap["id"] = vvtf.ID + } + if vvtf.Name != nil { + objectMap["name"] = vvtf.Name + } + if vvtf.Kind != nil { + objectMap["kind"] = vvtf.Kind + } + if vvtf.Type != nil { + objectMap["type"] = vvtf.Type + } + return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for VnetValidationTestFailure struct. @@ -16553,56 +20087,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 - } - vvtf.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 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.Type = &typeVar } return nil @@ -16735,6 +20267,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,78 +20278,96 @@ 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. -func (wpr *WorkerPoolResource) 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 WorkerPoolResource. +func (wpr WorkerPoolResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wpr.WorkerPool != nil { + objectMap["properties"] = wpr.WorkerPool } - 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 + if wpr.Sku != nil { + objectMap["sku"] = wpr.Sku } - - v = m["sku"] - if v != nil { - var sku SkuDescription - err = json.Unmarshal(*m["sku"], &sku) - if err != nil { - return err - } - wpr.Sku = &sku + if wpr.ID != nil { + objectMap["id"] = wpr.ID } - - v = m["id"] - if v != nil { - var ID string - err = json.Unmarshal(*m["id"], &ID) - if err != nil { - return err - } - wpr.ID = &ID + if wpr.Name != nil { + objectMap["name"] = wpr.Name } - - v = m["name"] - if v != nil { - var name string - err = json.Unmarshal(*m["name"], &name) - if err != nil { - return err - } - wpr.Name = &name + if wpr.Kind != nil { + objectMap["kind"] = wpr.Kind } - - v = m["kind"] - if v != nil { - var kind string - err = json.Unmarshal(*m["kind"], &kind) - if err != nil { - return err - } - wpr.Kind = &kind + if wpr.Type != nil { + objectMap["type"] = wpr.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 WorkerPoolResource struct. +func (wpr *WorkerPoolResource) 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 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/provider.go b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/provider.go index ca7341d7d648..a42542e877be 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/provider.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/provider.go @@ -40,8 +40,11 @@ func NewProviderClientWithBaseURI(baseURI string, subscriptionID string) Provide } // GetAvailableStacks get available application frameworks and their versions -func (client ProviderClient) GetAvailableStacks(ctx context.Context) (result SetObject, err error) { - req, err := client.GetAvailableStacksPreparer(ctx) +// +// osTypeSelected is +func (client ProviderClient) GetAvailableStacks(ctx context.Context, osTypeSelected string) (result ApplicationStackCollectionPage, err error) { + result.fn = client.getAvailableStacksNextResults + req, err := client.GetAvailableStacksPreparer(ctx, osTypeSelected) if err != nil { err = autorest.NewErrorWithError(err, "web.ProviderClient", "GetAvailableStacks", nil, "Failure preparing request") return @@ -49,12 +52,12 @@ func (client ProviderClient) GetAvailableStacks(ctx context.Context) (result Set resp, err := client.GetAvailableStacksSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.asc.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "web.ProviderClient", "GetAvailableStacks", resp, "Failure sending request") return } - result, err = client.GetAvailableStacksResponder(resp) + result.asc, err = client.GetAvailableStacksResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "web.ProviderClient", "GetAvailableStacks", resp, "Failure responding to request") } @@ -63,11 +66,14 @@ func (client ProviderClient) GetAvailableStacks(ctx context.Context) (result Set } // GetAvailableStacksPreparer prepares the GetAvailableStacks request. -func (client ProviderClient) GetAvailableStacksPreparer(ctx context.Context) (*http.Request, error) { +func (client ProviderClient) GetAvailableStacksPreparer(ctx context.Context, osTypeSelected string) (*http.Request, error) { const APIVersion = "2016-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(string(osTypeSelected)) > 0 { + queryParameters["osTypeSelected"] = autorest.Encode("query", osTypeSelected) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -86,20 +92,50 @@ func (client ProviderClient) GetAvailableStacksSender(req *http.Request) (*http. // GetAvailableStacksResponder handles the response to the GetAvailableStacks request. The method always // closes the http.Response Body. -func (client ProviderClient) GetAvailableStacksResponder(resp *http.Response) (result SetObject, err error) { +func (client ProviderClient) GetAvailableStacksResponder(resp *http.Response) (result ApplicationStackCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } +// getAvailableStacksNextResults retrieves the next set of results, if any. +func (client ProviderClient) getAvailableStacksNextResults(lastResults ApplicationStackCollection) (result ApplicationStackCollection, err error) { + req, err := lastResults.applicationStackCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "web.ProviderClient", "getAvailableStacksNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetAvailableStacksSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.ProviderClient", "getAvailableStacksNextResults", resp, "Failure sending next results request") + } + result, err = client.GetAvailableStacksResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ProviderClient", "getAvailableStacksNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetAvailableStacksComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProviderClient) GetAvailableStacksComplete(ctx context.Context, osTypeSelected string) (result ApplicationStackCollectionIterator, err error) { + result.page, err = client.GetAvailableStacks(ctx, osTypeSelected) + return +} + // GetAvailableStacksOnPrem get available application frameworks and their versions -func (client ProviderClient) GetAvailableStacksOnPrem(ctx context.Context) (result SetObject, err error) { - req, err := client.GetAvailableStacksOnPremPreparer(ctx) +// +// osTypeSelected is +func (client ProviderClient) GetAvailableStacksOnPrem(ctx context.Context, osTypeSelected string) (result ApplicationStackCollectionPage, err error) { + result.fn = client.getAvailableStacksOnPremNextResults + req, err := client.GetAvailableStacksOnPremPreparer(ctx, osTypeSelected) if err != nil { err = autorest.NewErrorWithError(err, "web.ProviderClient", "GetAvailableStacksOnPrem", nil, "Failure preparing request") return @@ -107,12 +143,12 @@ func (client ProviderClient) GetAvailableStacksOnPrem(ctx context.Context) (resu resp, err := client.GetAvailableStacksOnPremSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.asc.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "web.ProviderClient", "GetAvailableStacksOnPrem", resp, "Failure sending request") return } - result, err = client.GetAvailableStacksOnPremResponder(resp) + result.asc, err = client.GetAvailableStacksOnPremResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "web.ProviderClient", "GetAvailableStacksOnPrem", resp, "Failure responding to request") } @@ -121,7 +157,7 @@ func (client ProviderClient) GetAvailableStacksOnPrem(ctx context.Context) (resu } // GetAvailableStacksOnPremPreparer prepares the GetAvailableStacksOnPrem request. -func (client ProviderClient) GetAvailableStacksOnPremPreparer(ctx context.Context) (*http.Request, error) { +func (client ProviderClient) GetAvailableStacksOnPremPreparer(ctx context.Context, osTypeSelected string) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -130,6 +166,9 @@ func (client ProviderClient) GetAvailableStacksOnPremPreparer(ctx context.Contex queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(string(osTypeSelected)) > 0 { + queryParameters["osTypeSelected"] = autorest.Encode("query", osTypeSelected) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -148,17 +187,44 @@ func (client ProviderClient) GetAvailableStacksOnPremSender(req *http.Request) ( // GetAvailableStacksOnPremResponder handles the response to the GetAvailableStacksOnPrem request. The method always // closes the http.Response Body. -func (client ProviderClient) GetAvailableStacksOnPremResponder(resp *http.Response) (result SetObject, err error) { +func (client ProviderClient) GetAvailableStacksOnPremResponder(resp *http.Response) (result ApplicationStackCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } +// getAvailableStacksOnPremNextResults retrieves the next set of results, if any. +func (client ProviderClient) getAvailableStacksOnPremNextResults(lastResults ApplicationStackCollection) (result ApplicationStackCollection, err error) { + req, err := lastResults.applicationStackCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "web.ProviderClient", "getAvailableStacksOnPremNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetAvailableStacksOnPremSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.ProviderClient", "getAvailableStacksOnPremNextResults", resp, "Failure sending next results request") + } + result, err = client.GetAvailableStacksOnPremResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ProviderClient", "getAvailableStacksOnPremNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetAvailableStacksOnPremComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProviderClient) GetAvailableStacksOnPremComplete(ctx context.Context, osTypeSelected string) (result ApplicationStackCollectionIterator, err error) { + result.page, err = client.GetAvailableStacksOnPrem(ctx, osTypeSelected) + return +} + // ListOperations gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric // definitions func (client ProviderClient) ListOperations(ctx context.Context) (result CsmOperationCollectionPage, err error) { 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..eda8421f6d0a 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) @@ -113,21 +113,162 @@ func (client RecommendationsClient) DisableAllForWebAppResponder(resp *http.Resp return } +// DisableRecommendationForSite disables the specific rule for a web site permanently. +// +// resourceGroupName is name of the resource group to which the resource belongs. siteName is site name name is +// rule name +func (client RecommendationsClient) DisableRecommendationForSite(ctx context.Context, resourceGroupName string, siteName 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.NewError("web.RecommendationsClient", "DisableRecommendationForSite", err.Error()) + } + + req, err := client.DisableRecommendationForSitePreparer(ctx, resourceGroupName, siteName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableRecommendationForSite", nil, "Failure preparing request") + return + } + + resp, err := client.DisableRecommendationForSiteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableRecommendationForSite", resp, "Failure sending request") + return + } + + result, err = client.DisableRecommendationForSiteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableRecommendationForSite", resp, "Failure responding to request") + } + + return +} + +// DisableRecommendationForSitePreparer prepares the DisableRecommendationForSite request. +func (client RecommendationsClient) DisableRecommendationForSitePreparer(ctx context.Context, resourceGroupName string, siteName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteName": autorest.Encode("path", siteName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2016-03-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.Web/sites/{siteName}/recommendations/{name}/disable", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DisableRecommendationForSiteSender sends the DisableRecommendationForSite request. The method will close the +// http.Response Body if it receives an error. +func (client RecommendationsClient) DisableRecommendationForSiteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DisableRecommendationForSiteResponder handles the response to the DisableRecommendationForSite request. The method always +// closes the http.Response Body. +func (client RecommendationsClient) DisableRecommendationForSiteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// DisableRecommendationForSubscription disables the specified rule so it will not apply to a subscription in the +// future. +// +// name is rule name +func (client RecommendationsClient) DisableRecommendationForSubscription(ctx context.Context, name string) (result autorest.Response, err error) { + req, err := client.DisableRecommendationForSubscriptionPreparer(ctx, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableRecommendationForSubscription", nil, "Failure preparing request") + return + } + + resp, err := client.DisableRecommendationForSubscriptionSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableRecommendationForSubscription", resp, "Failure sending request") + return + } + + result, err = client.DisableRecommendationForSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableRecommendationForSubscription", resp, "Failure responding to request") + } + + return +} + +// DisableRecommendationForSubscriptionPreparer prepares the DisableRecommendationForSubscription request. +func (client RecommendationsClient) DisableRecommendationForSubscriptionPreparer(ctx context.Context, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2016-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/{name}/disable", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DisableRecommendationForSubscriptionSender sends the DisableRecommendationForSubscription request. The method will close the +// http.Response Body if it receives an error. +func (client RecommendationsClient) DisableRecommendationForSubscriptionSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DisableRecommendationForSubscriptionResponder handles the response to the DisableRecommendationForSubscription request. The method always +// closes the http.Response Body. +func (client RecommendationsClient) DisableRecommendationForSubscriptionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + // 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 -// recommendation object. -func (client RecommendationsClient) GetRuleDetailsByWebApp(ctx context.Context, resourceGroupName string, siteName string, name string, updateSeen *bool) (result RecommendationRule, err error) { +// 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. recommendationID is the GUID of the recommedation object if you query an expired one. You +// don't need to specify it to query an active entry. +func (client RecommendationsClient) GetRuleDetailsByWebApp(ctx context.Context, resourceGroupName string, siteName string, name string, updateSeen *bool, recommendationID string) (result RecommendationRule, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", 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) + req, err := client.GetRuleDetailsByWebAppPreparer(ctx, resourceGroupName, siteName, name, updateSeen, recommendationID) if err != nil { err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "GetRuleDetailsByWebApp", nil, "Failure preparing request") return @@ -149,7 +290,7 @@ func (client RecommendationsClient) GetRuleDetailsByWebApp(ctx context.Context, } // GetRuleDetailsByWebAppPreparer prepares the GetRuleDetailsByWebApp request. -func (client RecommendationsClient) GetRuleDetailsByWebAppPreparer(ctx context.Context, resourceGroupName string, siteName string, name string, updateSeen *bool) (*http.Request, error) { +func (client RecommendationsClient) GetRuleDetailsByWebAppPreparer(ctx context.Context, resourceGroupName string, siteName string, name string, updateSeen *bool, recommendationID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -164,6 +305,9 @@ func (client RecommendationsClient) GetRuleDetailsByWebAppPreparer(ctx context.C if updateSeen != nil { queryParameters["updateSeen"] = autorest.Encode("query", *updateSeen) } + if len(recommendationID) > 0 { + queryParameters["recommendationId"] = autorest.Encode("query", recommendationID) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -196,10 +340,11 @@ 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] -func (client RecommendationsClient) List(ctx context.Context, featured *bool, filter string) (result ListRecommendation, err error) { +// 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 RecommendationCollectionPage, err error) { + result.fn = client.listNextResults req, err := client.ListPreparer(ctx, featured, filter) if err != nil { err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "List", nil, "Failure preparing request") @@ -208,12 +353,12 @@ func (client RecommendationsClient) List(ctx context.Context, featured *bool, fi resp, err := client.ListSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.rc.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "List", resp, "Failure sending request") return } - result, err = client.ListResponder(resp) + result.rc, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "List", resp, "Failure responding to request") } @@ -255,31 +400,60 @@ func (client RecommendationsClient) ListSender(req *http.Request) (*http.Respons // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client RecommendationsClient) ListResponder(resp *http.Response) (result ListRecommendation, err error) { +func (client RecommendationsClient) ListResponder(resp *http.Response) (result RecommendationCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } +// listNextResults retrieves the next set of results, if any. +func (client RecommendationsClient) listNextResults(lastResults RecommendationCollection) (result RecommendationCollection, err error) { + req, err := lastResults.recommendationCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "web.RecommendationsClient", "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, "web.RecommendationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client RecommendationsClient) ListComplete(ctx context.Context, featured *bool, filter string) (result RecommendationCollectionIterator, err error) { + result.page, err = client.List(ctx, featured, filter) + return +} + // 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] -func (client RecommendationsClient) ListHistoryForWebApp(ctx context.Context, resourceGroupName string, siteName string, filter string) (result ListRecommendation, err error) { +// 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 RecommendationCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", 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()) } + result.fn = client.listHistoryForWebAppNextResults req, err := client.ListHistoryForWebAppPreparer(ctx, resourceGroupName, siteName, filter) if err != nil { err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ListHistoryForWebApp", nil, "Failure preparing request") @@ -288,12 +462,12 @@ func (client RecommendationsClient) ListHistoryForWebApp(ctx context.Context, re resp, err := client.ListHistoryForWebAppSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.rc.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ListHistoryForWebApp", resp, "Failure sending request") return } - result, err = client.ListHistoryForWebAppResponder(resp) + result.rc, err = client.ListHistoryForWebAppResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ListHistoryForWebApp", resp, "Failure responding to request") } @@ -334,32 +508,60 @@ func (client RecommendationsClient) ListHistoryForWebAppSender(req *http.Request // ListHistoryForWebAppResponder handles the response to the ListHistoryForWebApp request. The method always // closes the http.Response Body. -func (client RecommendationsClient) ListHistoryForWebAppResponder(resp *http.Response) (result ListRecommendation, err error) { +func (client RecommendationsClient) ListHistoryForWebAppResponder(resp *http.Response) (result RecommendationCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } +// listHistoryForWebAppNextResults retrieves the next set of results, if any. +func (client RecommendationsClient) listHistoryForWebAppNextResults(lastResults RecommendationCollection) (result RecommendationCollection, err error) { + req, err := lastResults.recommendationCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "web.RecommendationsClient", "listHistoryForWebAppNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListHistoryForWebAppSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.RecommendationsClient", "listHistoryForWebAppNextResults", resp, "Failure sending next results request") + } + result, err = client.ListHistoryForWebAppResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "listHistoryForWebAppNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListHistoryForWebAppComplete enumerates all values, automatically crossing page boundaries as required. +func (client RecommendationsClient) ListHistoryForWebAppComplete(ctx context.Context, resourceGroupName string, siteName string, filter string) (result RecommendationCollectionIterator, err error) { + result.page, err = client.ListHistoryForWebApp(ctx, resourceGroupName, siteName, filter) + return +} + // 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' -func (client RecommendationsClient) ListRecommendedRulesForWebApp(ctx context.Context, resourceGroupName string, siteName string, featured *bool, filter string) (result ListRecommendation, err error) { +// 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 RecommendationCollectionPage, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", 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()) } + result.fn = client.listRecommendedRulesForWebAppNextResults req, err := client.ListRecommendedRulesForWebAppPreparer(ctx, resourceGroupName, siteName, featured, filter) if err != nil { err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ListRecommendedRulesForWebApp", nil, "Failure preparing request") @@ -368,12 +570,12 @@ func (client RecommendationsClient) ListRecommendedRulesForWebApp(ctx context.Co resp, err := client.ListRecommendedRulesForWebAppSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.rc.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ListRecommendedRulesForWebApp", resp, "Failure sending request") return } - result, err = client.ListRecommendedRulesForWebAppResponder(resp) + result.rc, err = client.ListRecommendedRulesForWebAppResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ListRecommendedRulesForWebApp", resp, "Failure responding to request") } @@ -417,17 +619,44 @@ func (client RecommendationsClient) ListRecommendedRulesForWebAppSender(req *htt // ListRecommendedRulesForWebAppResponder handles the response to the ListRecommendedRulesForWebApp request. The method always // closes the http.Response Body. -func (client RecommendationsClient) ListRecommendedRulesForWebAppResponder(resp *http.Response) (result ListRecommendation, err error) { +func (client RecommendationsClient) ListRecommendedRulesForWebAppResponder(resp *http.Response) (result RecommendationCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } +// listRecommendedRulesForWebAppNextResults retrieves the next set of results, if any. +func (client RecommendationsClient) listRecommendedRulesForWebAppNextResults(lastResults RecommendationCollection) (result RecommendationCollection, err error) { + req, err := lastResults.recommendationCollectionPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "web.RecommendationsClient", "listRecommendedRulesForWebAppNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListRecommendedRulesForWebAppSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.RecommendationsClient", "listRecommendedRulesForWebAppNextResults", resp, "Failure sending next results request") + } + result, err = client.ListRecommendedRulesForWebAppResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "listRecommendedRulesForWebAppNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListRecommendedRulesForWebAppComplete enumerates all values, automatically crossing page boundaries as required. +func (client RecommendationsClient) ListRecommendedRulesForWebAppComplete(ctx context.Context, resourceGroupName string, siteName string, featured *bool, filter string) (result RecommendationCollectionIterator, err error) { + result.page, err = client.ListRecommendedRulesForWebApp(ctx, resourceGroupName, siteName, featured, filter) + return +} + // ResetAllFilters reset all recommendation opt-out settings for a subscription. func (client RecommendationsClient) ResetAllFilters(ctx context.Context) (result autorest.Response, err error) { req, err := client.ResetAllFiltersPreparer(ctx) @@ -498,7 +727,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/topleveldomains.go b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/topleveldomains.go index ccf262a4e5be..e9494f76cda7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/topleveldomains.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/topleveldomains.go @@ -233,7 +233,7 @@ func (client TopLevelDomainsClient) ListAgreementsPreparer(ctx context.Context, } preparer := autorest.CreatePreparer( - autorest.AsJSON(), + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains/{name}/listAgreements", pathParameters), 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..651ba87226e3 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, ) } @@ -592,15 +592,11 @@ func (c Client) GetAccountSASToken(options AccountSASTokenOptions) (url.Values, // build start time, if exists start := "" if options.Start != (time.Time{}) { - start = options.Start.Format(time.RFC3339) - // For some reason I don't understand, it fails when the rest of the string is included - start = start[:10] + start = options.Start.UTC().Format(time.RFC3339) } // build expiry time - expiry := options.Expiry.Format(time.RFC3339) - // For some reason I don't understand, it fails when the rest of the string is included - expiry = expiry[:10] + expiry := options.Expiry.UTC().Format(time.RFC3339) protocol := "https,http" if options.UseHTTPS { @@ -704,7 +700,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 +738,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 +760,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 +845,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 +918,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 +946,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..9ba20b8a8753 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 = "v15.0.0" diff --git a/vendor/vendor.json b/vendor/vendor.json index 10b85d548bc7..2d771a195b26 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -3,290 +3,292 @@ "ignore": "test", "package": [ { - "checksumSHA1": "04RpBRvxCFIrlZr4QGlWxEYu5jk=", + "checksumSHA1": "he/VGR6IgJ8CxXoYBmgFvTKRAtE=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "lNNgGpjE0bFWk01GbinWzzrvYMg=", + "checksumSHA1": "uxqhpe2KAMLaOJ4UJZbNW85/DRQ=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "0SGJv3vkB3mDzm2fEqyRhGBL+b0=", + "checksumSHA1": "A6izWwgFLD54iHpocS2ZA0JG87c=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "r5ng4N9t9KBcTLlcoJBus/Wt8G0=", + "checksumSHA1": "9zEuoQJZTVs2pUTQQOVwSL9KDvo=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "OaJWyTycs9HCUx4mXO/8+cPn6Dc=", + "checksumSHA1": "kM2PZfGUZRmE9wFeHAFjHFPepzk=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "mCnH22sssytnBgmMtiOiZ1fiUAE=", + "checksumSHA1": "ufJjnUN3IoNaycDXS3irWPADAvQ=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "WYjcCFUAHbnfCAYS7EO83a6FwSA=", + "checksumSHA1": "7t0VrdSexJ3Fkft4qx6Y7i+XUag=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "2+Uo711eqenN0yATZUvyVur3BDo=", + "checksumSHA1": "CFz0XzK5dml6LU9NwZmQf7rGiCg=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "E7FkdI3WlMLqnMoinimQQKH2yLA=", + "checksumSHA1": "vqgxILYG9Q90LilSHK37e3TMJlU=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "uJCBS9ImFK2B54NzUEPMKdePuGI=", + "checksumSHA1": "Jic4NwZdIHPlBvO6KwQH8WWOYbM=", "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" + "revision": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "QiY007vq22jp7uk7bDxEq1/YsYI=", + "checksumSHA1": "Nzv5lOussmqZ2h3i9/H2LmJWJBA=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "C3vT4FIPyBCkJ/DRPJGvA2kEV2A=", + "checksumSHA1": "7ZlPzptP9bH3HHJdYsPD+1CH0fA=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "Yy2uufjDcDOtCci5MoDEmmTsdfE=", + "checksumSHA1": "ZjMfE/TWv/Xqzwu+tw4y72uY/bc=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "7mrCMBhJ0IdK1u7tBX3LDxmohxc=", + "checksumSHA1": "0kRLbd9dmqjHMNHLDoiIQTv5Vdc=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "Qyvr+VKOVBA9x/PYyaLBNaPD6CA=", + "checksumSHA1": "AxqtZ/9WzUGzJlHROXKrxwe2fS8=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "wyP62ZVT4AV4hO/NBDh/uvVa6Zg=", + "checksumSHA1": "XxIQmqFCsZoiHnyzJ/5aVMM11B0=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "vGZFW297gcvEB3n5mkX60zDWPaY=", + "checksumSHA1": "QW7MPOpXOPihcLyyLXIBXNmSR8Q=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "/bK6KPyxXraJOySSQUNP2Iezgrc=", + "checksumSHA1": "l5LiS1E96VhqOILV/TKh37eYbeg=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "UCsGrHob/smdv6NU0fCUrSJpQqE=", + "checksumSHA1": "xRIUSsPljkKhI6zvql/7bGJiUAU=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "CeXlAup0Yf2Tw4UO7aDZDLI/wPI=", + "checksumSHA1": "FKVggufINs+t2nWOsbnZo7bi+hw=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "WMfs+FCE3stapwrAvAS3fjFZlHk=", + "checksumSHA1": "ThSWR8EWt3+Klt7DG4HANzmxhEQ=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "qOcKrxfayIRgAKlAZu9XYTSfeA0=", + "checksumSHA1": "d0AbZFEWBxTD9kTLApajDviAra8=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "09i0LjiY4GkYSRNObda25c1hsos=", + "checksumSHA1": "0RWJdclCgo0gzJQVKXqcz6SxMkI=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "7f5Uqi6joNQQGO0D1fuLOH1vqwc=", + "checksumSHA1": "woz67BK+/NdoZm4GzVYnJwzl61A=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "rnRxkR6w0aXOM0V9y3HTNz0+raQ=", + "checksumSHA1": "Dn2rizAeld0NpL5Oj920eiMwL2o=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "7LPSrzoSsTmNDBTltCsrJKJUhyc=", + "checksumSHA1": "F8O+DFqLL3C7QCG43si9N3NleHQ=", "path": "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-12-01/policy", - "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", - "revisionTime": "2018-02-12T16:31:56Z", - "version": "v12.5.0-beta", - "versionExact": "v12.5.0-beta" + "revision": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "oNSB5LmmOu68djMmeORcCDYn/3o=", + "checksumSHA1": "dMmQhV6QYDKOHKHQYv+mJeBExjU=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "TO9sw/AzJ/PhTE5gO+3HYJfl7Lo=", + "checksumSHA1": "KnpIP9m1vO3qKIgEaTH/tzdCQsY=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "FAgW0CqXXC9K8ScnAcoTb5nLBF0=", + "checksumSHA1": "bmOcu7B6nT4ubNAFcs4DLWmBAIo=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "dHGgohlhfFkUPVcSkWFJnhwnkV8=", + "checksumSHA1": "O7UKTV+UsCZnvYLzZMLaxS9N5Jk=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "oZDb0i9D6dludQmrSGDFF3UeZHc=", + "checksumSHA1": "lrA+cOUwjF47b1it8r93jaw6MSE=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "UEgAKa3mlclVQ+TopgpxIkN/T9Y=", + "checksumSHA1": "g9eP5AgV9yXRkY36M8h7aDW9oi8=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "LApakbrvkkhEu3hJVuLkERdGrSk=", + "checksumSHA1": "f9IwwrByqa3ypvYApuuZD5rIMvE=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "X56B9OyWsdOtpvblfATNgPB/xzI=", + "checksumSHA1": "7OuPXkxF0oxJ1hHKZHps7Tw3E1g=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "ySVXlzloGIus0rS4fpdN3hSOgz8=", + "checksumSHA1": "3N5Et8QnWsHJYN+v/0J/VSQUkJ0=", "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": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { - "checksumSHA1": "0f2bCAIQjO9op810x5LnuZnAmM0=", + "checksumSHA1": "Fb2OanEbwZVaGHYLf9Y4FAajsOM=", "path": "github.com/Azure/azure-sdk-for-go/version", - "revision": "1e334c402ea1460704b0263e5d188f28ad946ce1", - "revisionTime": "2018-02-16T17:41:56Z" + "revision": "56332fec5b308fbb6615fa1af6117394cdba186d", + "revisionTime": "2018-03-26T23:29:47Z", + "version": "v15.0.0", + "versionExact": "v15.0.0" }, { "checksumSHA1": "RzIYmvG1ReOud+kafFsZTDIZSK0=", From 80db232c73a278ae8a4bb57b13d9d8d5c94774bc Mon Sep 17 00:00:00 2001 From: tombuildsstuff Date: Thu, 5 Apr 2018 12:23:37 +0200 Subject: [PATCH 2/7] Upgrading to v10.6.0 of Azure/go-autorest --- .../Azure/go-autorest/autorest/adal/README.md | 19 +- .../Azure/go-autorest/autorest/adal/msi.go | 20 -- .../go-autorest/autorest/adal/msi_windows.go | 25 -- .../Azure/go-autorest/autorest/adal/token.go | 131 ++++++---- .../go-autorest/autorest/authorization.go | 82 +++--- .../Azure/go-autorest/autorest/autorest.go | 18 ++ .../Azure/go-autorest/autorest/azure/async.go | 89 +++++-- .../Azure/go-autorest/autorest/azure/azure.go | 125 ++++++++- .../autorest/azure/environments.go | 23 +- .../autorest/azure/metadata_environment.go | 245 ++++++++++++++++++ .../Azure/go-autorest/autorest/azure/rp.go | 17 +- .../Azure/go-autorest/autorest/client.go | 5 +- .../Azure/go-autorest/autorest/sender.go | 18 +- .../go-autorest/autorest/validation/error.go | 48 ++++ .../autorest/validation/validation.go | 4 +- .../Azure/go-autorest/autorest/version.go | 31 +-- vendor/vendor.json | 70 +++-- 17 files changed, 716 insertions(+), 254 deletions(-) delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/adal/msi.go delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/adal/msi_windows.go create mode 100644 vendor/github.com/Azure/go-autorest/autorest/azure/metadata_environment.go create mode 100644 vendor/github.com/Azure/go-autorest/autorest/validation/error.go diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/README.md b/vendor/github.com/Azure/go-autorest/autorest/adal/README.md index 08966c9cf892..7b0c4bc4d21a 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/adal/README.md +++ b/vendor/github.com/Azure/go-autorest/autorest/adal/README.md @@ -1,19 +1,24 @@ -# Azure Active Directory library for Go +# Azure Active Directory authentication for Go -This project provides a stand alone Azure Active Directory library for Go. The code was extracted -from [go-autorest](https://github.com/Azure/go-autorest/) project, which is used as a base for -[azure-sdk-for-go](https://github.com/Azure/azure-sdk-for-go). +This is a standalone package for authenticating with Azure Active +Directory from other Go libraries and applications, in particular the [Azure SDK +for Go](https://github.com/Azure/azure-sdk-for-go). +Note: Despite the package's name it is not related to other "ADAL" libraries +maintained in the [github.com/AzureAD](https://github.com/AzureAD) org. Issues +should be opened in [this repo's](https://github.com/Azure/go-autorest/issues) +or [the SDK's](https://github.com/Azure/azure-sdk-for-go/issues) issue +trackers. -## Installation +## Install -``` +```bash go get -u github.com/Azure/go-autorest/autorest/adal ``` ## Usage -An Active Directory application is required in order to use this library. An application can be registered in the [Azure Portal](https://portal.azure.com/) follow these [guidelines](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-integrating-applications) or using the [Azure CLI](https://github.com/Azure/azure-cli). +An Active Directory application is required in order to use this library. An application can be registered in the [Azure Portal](https://portal.azure.com/) by following these [guidelines](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-integrating-applications) or using the [Azure CLI](https://github.com/Azure/azure-cli). ### Register an Azure AD Application with secret diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/msi.go b/vendor/github.com/Azure/go-autorest/autorest/adal/msi.go deleted file mode 100644 index 5e02d52ac27c..000000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/adal/msi.go +++ /dev/null @@ -1,20 +0,0 @@ -// +build !windows - -package adal - -// 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. - -// msiPath is the path to the MSI Extension settings file (to discover the endpoint) -var msiPath = "/var/lib/waagent/ManagedIdentity-Settings" diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/msi_windows.go b/vendor/github.com/Azure/go-autorest/autorest/adal/msi_windows.go deleted file mode 100644 index 261b568829c8..000000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/adal/msi_windows.go +++ /dev/null @@ -1,25 +0,0 @@ -// +build windows - -package adal - -// 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 ( - "os" - "strings" -) - -// msiPath is the path to the MSI Extension settings file (to discover the endpoint) -var msiPath = strings.Join([]string{os.Getenv("SystemDrive"), "WindowsAzure/Config/ManagedIdentity-Settings"}, "/") 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..b61b3eb8ea54 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" @@ -53,6 +54,9 @@ const ( // metadataHeader is the header required by MSI extension metadataHeader = "Metadata" + + // msiEndpoint is the well known endpoint for getting MSI authentications tokens + msiEndpoint = "http://169.254.169.254/metadata/identity/oauth2/token" ) // OAuthTokenProvider is an interface which should be implemented by an access token retriever @@ -242,13 +246,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 +286,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 +318,7 @@ func NewServicePrincipalTokenFromManualToken(oauthConfig OAuthConfig, clientID s return nil, err } - spt.Token = token + spt.token = token return spt, nil } @@ -439,24 +444,7 @@ func NewServicePrincipalTokenFromAuthorizationCode(oauthConfig OAuthConfig, clie // GetMSIVMEndpoint gets the MSI endpoint on Virtual Machines. func GetMSIVMEndpoint() (string, error) { - return getMSIVMEndpoint(msiPath) -} - -func getMSIVMEndpoint(path string) (string, error) { - // Read MSI settings - bytes, err := ioutil.ReadFile(path) - if err != nil { - return "", err - } - msiSettings := struct { - URL string `json:"url"` - }{} - err = json.Unmarshal(bytes, &msiSettings) - if err != nil { - return "", err - } - - return msiSettings.URL, nil + return msiEndpoint, nil } // NewServicePrincipalTokenFromMSI creates a ServicePrincipalToken via the MSI VM Extension. @@ -489,16 +477,22 @@ func newServicePrincipalTokenFromMSI(msiEndpoint, resource string, userAssignedI return nil, err } - oauthConfig, err := NewOAuthConfig(msiEndpointURL.String(), "") - if err != nil { - return nil, err + v := url.Values{} + v.Set("resource", resource) + v.Set("api-version", "2018-02-01") + if userAssignedID != nil { + v.Set("client_id", *userAssignedID) } + msiEndpointURL.RawQuery = v.Encode() spt := &ServicePrincipalToken{ - oauthConfig: *oauthConfig, + oauthConfig: OAuthConfig{ + TokenEndpoint: *msiEndpointURL, + }, secret: &ServicePrincipalMSISecret{}, resource: resource, autoRefresh: true, + refreshLock: &sync.RWMutex{}, refreshWithin: defaultRefresh, sender: &http.Client{}, refreshCallbacks: callbacks, @@ -532,10 +526,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 +543,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 +553,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) } @@ -574,34 +579,48 @@ func (spt *ServicePrincipalToken) getGrantType() string { } } -func (spt *ServicePrincipalToken) refreshInternal(resource string) error { - v := url.Values{} - v.Set("client_id", spt.clientID) - v.Set("resource", resource) - - if spt.RefreshToken != "" { - v.Set("grant_type", OAuthGrantTypeRefreshToken) - v.Set("refresh_token", spt.RefreshToken) - } else { - v.Set("grant_type", spt.getGrantType()) - err := spt.secret.SetAuthenticationValues(spt, &v) - if err != nil { - return err - } +func isIMDS(u url.URL) bool { + imds, err := url.Parse(msiEndpoint) + if err != nil { + return false } + return u.Host == imds.Host && u.Path == imds.Path +} - s := v.Encode() - body := ioutil.NopCloser(strings.NewReader(s)) - req, err := http.NewRequest(http.MethodPost, spt.oauthConfig.TokenEndpoint.String(), body) +func (spt *ServicePrincipalToken) refreshInternal(resource string) error { + req, err := http.NewRequest(http.MethodPost, spt.oauthConfig.TokenEndpoint.String(), nil) if err != nil { return fmt.Errorf("adal: Failed to build the refresh request. Error = '%v'", err) } - req.ContentLength = int64(len(s)) - req.Header.Set(contentType, mimeTypeFormPost) + if !isIMDS(spt.oauthConfig.TokenEndpoint) { + v := url.Values{} + v.Set("client_id", spt.clientID) + v.Set("resource", resource) + + if spt.token.RefreshToken != "" { + v.Set("grant_type", OAuthGrantTypeRefreshToken) + v.Set("refresh_token", spt.token.RefreshToken) + } else { + v.Set("grant_type", spt.getGrantType()) + err := spt.secret.SetAuthenticationValues(spt, &v) + if err != nil { + return err + } + } + + s := v.Encode() + body := ioutil.NopCloser(strings.NewReader(s)) + req.ContentLength = int64(len(s)) + req.Header.Set(contentType, mimeTypeFormPost) + req.Body = body + } + if _, ok := spt.secret.(*ServicePrincipalMSISecret); ok { + req.Method = http.MethodGet req.Header.Set(metadataHeader, "true") } + resp, err := spt.sender.Do(req) if err != nil { return fmt.Errorf("adal: Failed to execute the refresh request. Error = '%v'", err) @@ -629,7 +648,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 +668,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..c51eac0a7830 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/authorization.go +++ b/vendor/github.com/Azure/go-autorest/autorest/authorization.go @@ -104,10 +104,6 @@ func NewBearerAuthorizer(tp adal.OAuthTokenProvider) *BearerAuthorizer { return &BearerAuthorizer{tokenProvider: tp} } -func (ba *BearerAuthorizer) withBearerAuthorization() PrepareDecorator { - return WithHeader(headerAuthorization, fmt.Sprintf("Bearer %s", ba.tokenProvider.OAuthToken())) -} - // WithAuthorization returns a PrepareDecorator that adds an HTTP Authorization header whose // value is "Bearer " followed by the token. // @@ -115,19 +111,23 @@ func (ba *BearerAuthorizer) withBearerAuthorization() PrepareDecorator { func (ba *BearerAuthorizer) WithAuthorization() PrepareDecorator { return func(p Preparer) Preparer { return PreparerFunc(func(r *http.Request) (*http.Request, error) { - refresher, ok := ba.tokenProvider.(adal.Refresher) - if ok { - err := refresher.EnsureFresh() - if err != nil { - var resp *http.Response - if tokError, ok := err.(adal.TokenRefreshError); ok { - resp = tokError.Response() + r, err := p.Prepare(r) + if err == nil { + refresher, ok := ba.tokenProvider.(adal.Refresher) + if ok { + err := refresher.EnsureFresh() + if err != nil { + var resp *http.Response + if tokError, ok := err.(adal.TokenRefreshError); ok { + resp = tokError.Response() + } + return r, NewErrorWithError(err, "azure.BearerAuthorizer", "WithAuthorization", resp, + "Failed to refresh the Token for request to %s", r.URL) } - return r, NewErrorWithError(err, "azure.BearerAuthorizer", "WithAuthorization", resp, - "Failed to refresh the Token for request to %s", r.URL) } + return Prepare(r, WithHeader(headerAuthorization, fmt.Sprintf("Bearer %s", ba.tokenProvider.OAuthToken()))) } - return (ba.withBearerAuthorization()(p)).Prepare(r) + return r, err }) } } @@ -157,25 +157,28 @@ func NewBearerAuthorizerCallback(sender Sender, callback BearerAuthorizerCallbac func (bacb *BearerAuthorizerCallback) WithAuthorization() PrepareDecorator { return func(p Preparer) Preparer { return PreparerFunc(func(r *http.Request) (*http.Request, error) { - // make a copy of the request and remove the body as it's not - // required and avoids us having to create a copy of it. - rCopy := *r - removeRequestBody(&rCopy) - - resp, err := bacb.sender.Do(&rCopy) - if err == nil && resp.StatusCode == 401 { - defer resp.Body.Close() - if hasBearerChallenge(resp) { - bc, err := newBearerChallenge(resp) - if err != nil { - return r, err - } - if bacb.callback != nil { - ba, err := bacb.callback(bc.values[tenantID], bc.values["resource"]) + r, err := p.Prepare(r) + if err == nil { + // make a copy of the request and remove the body as it's not + // required and avoids us having to create a copy of it. + rCopy := *r + removeRequestBody(&rCopy) + + resp, err := bacb.sender.Do(&rCopy) + if err == nil && resp.StatusCode == 401 { + defer resp.Body.Close() + if hasBearerChallenge(resp) { + bc, err := newBearerChallenge(resp) if err != nil { return r, err } - return ba.WithAuthorization()(p).Prepare(r) + if bacb.callback != nil { + ba, err := bacb.callback(bc.values[tenantID], bc.values["resource"]) + if err != nil { + return r, err + } + return Prepare(r, ba.WithAuthorization()) + } } } } @@ -233,3 +236,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/autorest.go b/vendor/github.com/Azure/go-autorest/autorest/autorest.go index f86b66a410b1..aafdf021fd6f 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/autorest.go +++ b/vendor/github.com/Azure/go-autorest/autorest/autorest.go @@ -72,6 +72,7 @@ package autorest // limitations under the License. import ( + "context" "net/http" "time" ) @@ -130,3 +131,20 @@ func NewPollingRequest(resp *http.Response, cancel <-chan struct{}) (*http.Reque return req, nil } + +// NewPollingRequestWithContext allocates and returns a new http.Request with the specified context to poll for the passed response. +func NewPollingRequestWithContext(ctx context.Context, resp *http.Response) (*http.Request, error) { + location := GetLocation(resp) + if location == "" { + return nil, NewErrorWithResponse("autorest", "NewPollingRequestWithContext", resp, "Location header missing from response that requires polling") + } + + req, err := Prepare((&http.Request{}).WithContext(ctx), + AsGet(), + WithBaseURL(location)) + if err != nil { + return nil, NewErrorWithError(err, "autorest", "NewPollingRequestWithContext", nil, "Failure creating poll request to %s", location) + } + + return req, nil +} 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..a58e5ef3f1c9 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 @@ -217,7 +249,7 @@ func DoPollForAsynchronous(delay time.Duration) autorest.SendDecorator { if err != nil { return resp, err } - r.Cancel = resp.Request.Cancel + r = r.WithContext(resp.Request.Context()) delay = autorest.GetRetryAfter(resp, delay) resp, err = autorest.SendWithSender(s, r, @@ -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..18d029526ff5 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 @@ -24,7 +21,9 @@ import ( "fmt" "io/ioutil" "net/http" + "regexp" "strconv" + "strings" "github.com/Azure/go-autorest/autorest" ) @@ -43,21 +42,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 { + result += fmt.Sprintf(" Details=%v", se.Details) + } + result += fmt.Sprintf(" Details=%v", string(d)) + } + + if se.InnerError != nil { + d, err := json.Marshal(se.InnerError) if err != nil { - return fmt.Sprintf("Code=%q Message=%q Details=%v", se.Code, se.Message, *se.Details) + result += fmt.Sprintf(" InnerError=%v", se.InnerError) } - return fmt.Sprintf("Code=%q Message=%q Details=%v", se.Code, se.Message, string(d)) + 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 fmt.Sprintf("Code=%q Message=%q", se.Code, se.Message) + 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. @@ -83,6 +149,41 @@ func IsAzureError(e error) bool { return ok } +// Resource contains details about an Azure resource. +type Resource struct { + SubscriptionID string + ResourceGroup string + Provider string + ResourceType string + ResourceName string +} + +// ParseResourceID parses a resource ID into a ResourceDetails struct. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-template-functions-resource#return-value-4. +func ParseResourceID(resourceID string) (Resource, error) { + + const resourceIDPatternText = `(?i)subscriptions/(.+)/resourceGroups/(.+)/providers/(.+?)/(.+?)/(.+)` + resourceIDPattern := regexp.MustCompile(resourceIDPatternText) + match := resourceIDPattern.FindStringSubmatch(resourceID) + + if len(match) == 0 { + return Resource{}, fmt.Errorf("parsing failed for %s. Invalid resource Id format", resourceID) + } + + v := strings.Split(match[5], "/") + resourceName := v[len(v)-1] + + result := Resource{ + SubscriptionID: match[1], + ResourceGroup: match[2], + Provider: match[3], + ResourceType: match[4], + ResourceName: resourceName, + } + + return result, nil +} + // NewErrorWithError creates a new Error conforming object from the // passed packageType, method, statusCode of the given resp (UndefinedStatusCode // if resp is nil), message, and original error. message is treated as a format 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..7e41f7fd99c9 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,8 @@ type Environment struct { GalleryEndpoint string `json:"galleryEndpoint"` KeyVaultEndpoint string `json:"keyVaultEndpoint"` GraphEndpoint string `json:"graphEndpoint"` + ServiceBusEndpoint string `json:"serviceBusEndpoint"` + BatchManagementEndpoint string `json:"batchManagementEndpoint"` StorageEndpointSuffix string `json:"storageEndpointSuffix"` SQLDatabaseDNSSuffix string `json:"sqlDatabaseDNSSuffix"` TrafficManagerDNSSuffix string `json:"trafficManagerDNSSuffix"` @@ -52,6 +54,7 @@ type Environment struct { ServiceManagementVMDNSSuffix string `json:"serviceManagementVMDNSSuffix"` ResourceManagerVMDNSSuffix string `json:"resourceManagerVMDNSSuffix"` ContainerRegistryDNSSuffix string `json:"containerRegistryDNSSuffix"` + TokenAudience string `json:"tokenAudience"` } var ( @@ -66,14 +69,17 @@ var ( GalleryEndpoint: "https://gallery.azure.com/", KeyVaultEndpoint: "https://vault.azure.net/", GraphEndpoint: "https://graph.windows.net/", + ServiceBusEndpoint: "https://servicebus.windows.net/", + BatchManagementEndpoint: "https://batch.core.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", + TokenAudience: "https://management.azure.com/", } // USGovernmentCloud is the cloud environment for the US Government @@ -83,10 +89,12 @@ 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/", + BatchManagementEndpoint: "https://batch.core.usgovcloudapi.net/", StorageEndpointSuffix: "core.usgovcloudapi.net", SQLDatabaseDNSSuffix: "database.usgovcloudapi.net", TrafficManagerDNSSuffix: "usgovtrafficmanager.net", @@ -95,6 +103,7 @@ var ( ServiceManagementVMDNSSuffix: "usgovcloudapp.net", ResourceManagerVMDNSSuffix: "cloudapp.windowsazure.us", ContainerRegistryDNSSuffix: "azurecr.io", + TokenAudience: "https://management.usgovcloudapi.net/", } // ChinaCloud is the cloud environment operated in China @@ -108,14 +117,17 @@ var ( GalleryEndpoint: "https://gallery.chinacloudapi.cn/", KeyVaultEndpoint: "https://vault.azure.cn/", GraphEndpoint: "https://graph.chinacloudapi.cn/", + ServiceBusEndpoint: "https://servicebus.chinacloudapi.cn/", + BatchManagementEndpoint: "https://batch.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", + TokenAudience: "https://management.chinacloudapi.cn/", } // GermanCloud is the cloud environment operated in Germany @@ -129,6 +141,8 @@ var ( GalleryEndpoint: "https://gallery.cloudapi.de/", KeyVaultEndpoint: "https://vault.microsoftazure.de/", GraphEndpoint: "https://graph.cloudapi.de/", + ServiceBusEndpoint: "https://servicebus.cloudapi.de/", + BatchManagementEndpoint: "https://batch.cloudapi.de/", StorageEndpointSuffix: "core.cloudapi.de", SQLDatabaseDNSSuffix: "database.cloudapi.de", TrafficManagerDNSSuffix: "azuretrafficmanager.de", @@ -137,6 +151,7 @@ var ( ServiceManagementVMDNSSuffix: "azurecloudapp.de", ResourceManagerVMDNSSuffix: "cloudapp.microsoftazure.de", ContainerRegistryDNSSuffix: "azurecr.io", + TokenAudience: "https://management.microsoftazure.de/", } ) diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/metadata_environment.go b/vendor/github.com/Azure/go-autorest/autorest/azure/metadata_environment.go new file mode 100644 index 000000000000..507f9e95cf11 --- /dev/null +++ b/vendor/github.com/Azure/go-autorest/autorest/azure/metadata_environment.go @@ -0,0 +1,245 @@ +package azure + +import ( + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "strings" + + "github.com/Azure/go-autorest/autorest" +) + +// 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. + +type audience []string + +type authentication struct { + LoginEndpoint string `json:"loginEndpoint"` + Audiences audience `json:"audiences"` +} + +type environmentMetadataInfo struct { + GalleryEndpoint string `json:"galleryEndpoint"` + GraphEndpoint string `json:"graphEndpoint"` + PortalEndpoint string `json:"portalEndpoint"` + Authentication authentication `json:"authentication"` +} + +// EnvironmentProperty represent property names that clients can override +type EnvironmentProperty string + +const ( + // EnvironmentName ... + EnvironmentName EnvironmentProperty = "name" + // EnvironmentManagementPortalURL .. + EnvironmentManagementPortalURL EnvironmentProperty = "managementPortalURL" + // EnvironmentPublishSettingsURL ... + EnvironmentPublishSettingsURL EnvironmentProperty = "publishSettingsURL" + // EnvironmentServiceManagementEndpoint ... + EnvironmentServiceManagementEndpoint EnvironmentProperty = "serviceManagementEndpoint" + // EnvironmentResourceManagerEndpoint ... + EnvironmentResourceManagerEndpoint EnvironmentProperty = "resourceManagerEndpoint" + // EnvironmentActiveDirectoryEndpoint ... + EnvironmentActiveDirectoryEndpoint EnvironmentProperty = "activeDirectoryEndpoint" + // EnvironmentGalleryEndpoint ... + EnvironmentGalleryEndpoint EnvironmentProperty = "galleryEndpoint" + // EnvironmentKeyVaultEndpoint ... + EnvironmentKeyVaultEndpoint EnvironmentProperty = "keyVaultEndpoint" + // EnvironmentGraphEndpoint ... + EnvironmentGraphEndpoint EnvironmentProperty = "graphEndpoint" + // EnvironmentServiceBusEndpoint ... + EnvironmentServiceBusEndpoint EnvironmentProperty = "serviceBusEndpoint" + // EnvironmentBatchManagementEndpoint ... + EnvironmentBatchManagementEndpoint EnvironmentProperty = "batchManagementEndpoint" + // EnvironmentStorageEndpointSuffix ... + EnvironmentStorageEndpointSuffix EnvironmentProperty = "storageEndpointSuffix" + // EnvironmentSQLDatabaseDNSSuffix ... + EnvironmentSQLDatabaseDNSSuffix EnvironmentProperty = "sqlDatabaseDNSSuffix" + // EnvironmentTrafficManagerDNSSuffix ... + EnvironmentTrafficManagerDNSSuffix EnvironmentProperty = "trafficManagerDNSSuffix" + // EnvironmentKeyVaultDNSSuffix ... + EnvironmentKeyVaultDNSSuffix EnvironmentProperty = "keyVaultDNSSuffix" + // EnvironmentServiceBusEndpointSuffix ... + EnvironmentServiceBusEndpointSuffix EnvironmentProperty = "serviceBusEndpointSuffix" + // EnvironmentServiceManagementVMDNSSuffix ... + EnvironmentServiceManagementVMDNSSuffix EnvironmentProperty = "serviceManagementVMDNSSuffix" + // EnvironmentResourceManagerVMDNSSuffix ... + EnvironmentResourceManagerVMDNSSuffix EnvironmentProperty = "resourceManagerVMDNSSuffix" + // EnvironmentContainerRegistryDNSSuffix ... + EnvironmentContainerRegistryDNSSuffix EnvironmentProperty = "containerRegistryDNSSuffix" + // EnvironmentTokenAudience ... + EnvironmentTokenAudience EnvironmentProperty = "tokenAudience" +) + +// OverrideProperty represents property name and value that clients can override +type OverrideProperty struct { + Key EnvironmentProperty + Value string +} + +// EnvironmentFromURL loads an Environment from a URL +// This function is particularly useful in the Hybrid Cloud model, where one may define their own +// endpoints. +func EnvironmentFromURL(resourceManagerEndpoint string, properties ...OverrideProperty) (environment Environment, err error) { + var metadataEnvProperties environmentMetadataInfo + + if resourceManagerEndpoint == "" { + return environment, fmt.Errorf("Metadata resource manager endpoint is empty") + } + + if metadataEnvProperties, err = retrieveMetadataEnvironment(resourceManagerEndpoint); err != nil { + return environment, err + } + + // Give priority to user's override values + overrideProperties(&environment, properties) + + if environment.Name == "" { + environment.Name = "HybridEnvironment" + } + stampDNSSuffix := environment.StorageEndpointSuffix + if stampDNSSuffix == "" { + stampDNSSuffix = strings.TrimSuffix(strings.TrimPrefix(strings.Replace(resourceManagerEndpoint, strings.Split(resourceManagerEndpoint, ".")[0], "", 1), "."), "/") + environment.StorageEndpointSuffix = stampDNSSuffix + } + if environment.KeyVaultDNSSuffix == "" { + environment.KeyVaultDNSSuffix = fmt.Sprintf("%s.%s", "vault", stampDNSSuffix) + } + if environment.KeyVaultEndpoint == "" { + environment.KeyVaultEndpoint = fmt.Sprintf("%s%s", "https://", environment.KeyVaultDNSSuffix) + } + if environment.TokenAudience == "" { + environment.TokenAudience = metadataEnvProperties.Authentication.Audiences[0] + } + if environment.ActiveDirectoryEndpoint == "" { + environment.ActiveDirectoryEndpoint = metadataEnvProperties.Authentication.LoginEndpoint + } + if environment.ResourceManagerEndpoint == "" { + environment.ResourceManagerEndpoint = resourceManagerEndpoint + } + if environment.GalleryEndpoint == "" { + environment.GalleryEndpoint = metadataEnvProperties.GalleryEndpoint + } + if environment.GraphEndpoint == "" { + environment.GraphEndpoint = metadataEnvProperties.GraphEndpoint + } + + return environment, nil +} + +func overrideProperties(environment *Environment, properties []OverrideProperty) { + for _, property := range properties { + switch property.Key { + case EnvironmentName: + { + environment.Name = property.Value + } + case EnvironmentManagementPortalURL: + { + environment.ManagementPortalURL = property.Value + } + case EnvironmentPublishSettingsURL: + { + environment.PublishSettingsURL = property.Value + } + case EnvironmentServiceManagementEndpoint: + { + environment.ServiceManagementEndpoint = property.Value + } + case EnvironmentResourceManagerEndpoint: + { + environment.ResourceManagerEndpoint = property.Value + } + case EnvironmentActiveDirectoryEndpoint: + { + environment.ActiveDirectoryEndpoint = property.Value + } + case EnvironmentGalleryEndpoint: + { + environment.GalleryEndpoint = property.Value + } + case EnvironmentKeyVaultEndpoint: + { + environment.KeyVaultEndpoint = property.Value + } + case EnvironmentGraphEndpoint: + { + environment.GraphEndpoint = property.Value + } + case EnvironmentServiceBusEndpoint: + { + environment.ServiceBusEndpoint = property.Value + } + case EnvironmentBatchManagementEndpoint: + { + environment.BatchManagementEndpoint = property.Value + } + case EnvironmentStorageEndpointSuffix: + { + environment.StorageEndpointSuffix = property.Value + } + case EnvironmentSQLDatabaseDNSSuffix: + { + environment.SQLDatabaseDNSSuffix = property.Value + } + case EnvironmentTrafficManagerDNSSuffix: + { + environment.TrafficManagerDNSSuffix = property.Value + } + case EnvironmentKeyVaultDNSSuffix: + { + environment.KeyVaultDNSSuffix = property.Value + } + case EnvironmentServiceBusEndpointSuffix: + { + environment.ServiceBusEndpointSuffix = property.Value + } + case EnvironmentServiceManagementVMDNSSuffix: + { + environment.ServiceManagementVMDNSSuffix = property.Value + } + case EnvironmentResourceManagerVMDNSSuffix: + { + environment.ResourceManagerVMDNSSuffix = property.Value + } + case EnvironmentContainerRegistryDNSSuffix: + { + environment.ContainerRegistryDNSSuffix = property.Value + } + case EnvironmentTokenAudience: + { + environment.TokenAudience = property.Value + } + } + } +} + +func retrieveMetadataEnvironment(endpoint string) (environment environmentMetadataInfo, err error) { + client := autorest.NewClientWithUserAgent("") + managementEndpoint := fmt.Sprintf("%s%s", strings.TrimSuffix(endpoint, "/"), "/metadata/endpoints?api-version=1.0") + req, _ := http.NewRequest("GET", managementEndpoint, nil) + response, err := client.Do(req) + if err != nil { + return environment, err + } + defer response.Body.Close() + jsonResponse, err := ioutil.ReadAll(response.Body) + if err != nil { + return environment, err + } + err = json.Unmarshal(jsonResponse, &environment) + return environment, err +} 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..65ad0afc82d3 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") } @@ -118,7 +115,7 @@ func register(client autorest.Client, originalReq *http.Request, re RequestError if err != nil { return err } - req.Cancel = originalReq.Cancel + req = req.WithContext(originalReq.Context()) resp, err := autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...), @@ -157,7 +154,7 @@ func register(client autorest.Client, originalReq *http.Request, re RequestError if err != nil { return err } - req.Cancel = originalReq.Cancel + req = req.WithContext(originalReq.Context()) resp, err := autorest.SendWithSender(client, req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...), @@ -181,9 +178,9 @@ func register(client autorest.Client, originalReq *http.Request, re RequestError break } - delayed := autorest.DelayWithRetryAfter(resp, originalReq.Cancel) - if !delayed { - autorest.DelayForBackoff(client.PollingDelay, 0, originalReq.Cancel) + delayed := autorest.DelayWithRetryAfter(resp, originalReq.Context().Done()) + if !delayed && !autorest.DelayForBackoff(client.PollingDelay, 0, originalReq.Context().Done()) { + return originalReq.Context().Err() } } if !(time.Since(now) < client.PollingDuration) { diff --git a/vendor/github.com/Azure/go-autorest/autorest/client.go b/vendor/github.com/Azure/go-autorest/autorest/client.go index d329cb737799..4e92dcad077a 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/client.go +++ b/vendor/github.com/Azure/go-autorest/autorest/client.go @@ -203,9 +203,10 @@ func (c Client) Do(r *http.Request) (*http.Response, error) { r, _ = Prepare(r, WithUserAgent(c.UserAgent)) } + // NOTE: c.WithInspection() must be last in the list so that it can inspect all preceding operations r, err := Prepare(r, - c.WithInspection(), - c.WithAuthorization()) + c.WithAuthorization(), + c.WithInspection()) if err != nil { var resp *http.Response if detErr, ok := err.(DetailedError); ok { diff --git a/vendor/github.com/Azure/go-autorest/autorest/sender.go b/vendor/github.com/Azure/go-autorest/autorest/sender.go index c5efd59a219f..b4f762325f6c 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/sender.go +++ b/vendor/github.com/Azure/go-autorest/autorest/sender.go @@ -86,7 +86,7 @@ func SendWithSender(s Sender, r *http.Request, decorators ...SendDecorator) (*ht func AfterDelay(d time.Duration) SendDecorator { return func(s Sender) Sender { return SenderFunc(func(r *http.Request) (*http.Response, error) { - if !DelayForBackoff(d, 0, r.Cancel) { + if !DelayForBackoff(d, 0, r.Context().Done()) { return nil, fmt.Errorf("autorest: AfterDelay canceled before full delay") } return s.Do(r) @@ -165,7 +165,7 @@ func DoPollForStatusCodes(duration time.Duration, delay time.Duration, codes ... resp, err = s.Do(r) if err == nil && ResponseHasStatusCode(resp, codes...) { - r, err = NewPollingRequest(resp, r.Cancel) + r, err = NewPollingRequestWithContext(r.Context(), resp) for err == nil && ResponseHasStatusCode(resp, codes...) { Respond(resp, @@ -198,7 +198,9 @@ func DoRetryForAttempts(attempts int, backoff time.Duration) SendDecorator { if err == nil { return resp, err } - DelayForBackoff(backoff, attempt, r.Cancel) + if !DelayForBackoff(backoff, attempt, r.Context().Done()) { + return nil, r.Context().Err() + } } return resp, err }) @@ -226,9 +228,9 @@ func DoRetryForStatusCodes(attempts int, backoff time.Duration, codes ...int) Se if err == nil && !ResponseHasStatusCode(resp, codes...) || IsTokenRefreshError(err) { return resp, err } - delayed := DelayWithRetryAfter(resp, r.Cancel) - if !delayed { - DelayForBackoff(backoff, attempt, r.Cancel) + delayed := DelayWithRetryAfter(resp, r.Context().Done()) + if !delayed && !DelayForBackoff(backoff, attempt, r.Context().Done()) { + return nil, r.Context().Err() } // don't count a 429 against the number of attempts // so that we continue to retry until it succeeds @@ -277,7 +279,9 @@ func DoRetryForDuration(d time.Duration, backoff time.Duration) SendDecorator { if err == nil { return resp, err } - DelayForBackoff(backoff, attempt, r.Cancel) + if !DelayForBackoff(backoff, attempt, r.Context().Done()) { + return nil, r.Context().Err() + } } return resp, err }) 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..4ad7754adab4 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/version.go +++ b/vendor/github.com/Azure/go-autorest/autorest/version.go @@ -14,36 +14,7 @@ package autorest // See the License for the specific language governing permissions and // limitations under the License. -import ( - "bytes" - "fmt" - "strings" - "sync" -) - -const ( - major = 8 - minor = 0 - patch = 0 - tag = "" -) - -var once sync.Once -var version string - // Version returns the semantic version (see http://semver.org). func Version() string { - once.Do(func() { - semver := fmt.Sprintf("%d.%d.%d", major, minor, patch) - verBuilder := bytes.NewBufferString(semver) - if tag != "" && tag != "-" { - updated := strings.TrimPrefix(tag, "-") - _, err := verBuilder.WriteString("-" + updated) - if err == nil { - verBuilder = bytes.NewBufferString(semver) - } - } - version = verBuilder.String() - }) - return version + return "v10.5.0" } diff --git a/vendor/vendor.json b/vendor/vendor.json index 2d771a195b26..72b876f7a1c6 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -291,66 +291,60 @@ "versionExact": "v15.0.0" }, { - "checksumSHA1": "RzIYmvG1ReOud+kafFsZTDIZSK0=", - "comment": "v9.7.0", + "checksumSHA1": "yWr3Vmf8wvJYTg+UR3zOjd9Kq3g=", "path": "github.com/Azure/go-autorest/autorest", - "revision": "8c58b4788dedd95779efe0ac2055bb6a1b9b8e01", - "revisionTime": "2018-01-06T16:29:27Z", - "version": "v9.7.0", - "versionExact": "v9.7.0" + "revision": "9ad9326b278af8fa5cc67c30c0ce9a58cc0862b2", + "revisionTime": "2018-04-04T23:29:44Z", + "version": "v10.6.0", + "versionExact": "v10.6.0" }, { - "checksumSHA1": "OxKbGGQUfsDtM4Fz4ysBpallhOE=", - "comment": "v9.7.0", + "checksumSHA1": "2Mju3jwpFTNGwZT243jaHZ8f0dg=", "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": "9ad9326b278af8fa5cc67c30c0ce9a58cc0862b2", + "revisionTime": "2018-04-04T23:29:44Z", + "version": "v10.6.0", + "versionExact": "v10.6.0" }, { - "checksumSHA1": "PwTnRhiCu8p2D1M2nsM0ADL4FM0=", - "comment": "v9.7.0", + "checksumSHA1": "vUHo41PG/G6Qq+vqD65l9KHFxUs=", "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": "9ad9326b278af8fa5cc67c30c0ce9a58cc0862b2", + "revisionTime": "2018-04-04T23:29:44Z", + "version": "v10.6.0", + "versionExact": "v10.6.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": "9ad9326b278af8fa5cc67c30c0ce9a58cc0862b2", + "revisionTime": "2018-04-04T23:29:44Z", + "version": "v10.6.0", + "versionExact": "v10.6.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": "9ad9326b278af8fa5cc67c30c0ce9a58cc0862b2", + "revisionTime": "2018-04-04T23:29:44Z", + "version": "v10.6.0", + "versionExact": "v10.6.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": "9ad9326b278af8fa5cc67c30c0ce9a58cc0862b2", + "revisionTime": "2018-04-04T23:29:44Z", + "version": "v10.6.0", + "versionExact": "v10.6.0" }, { - "checksumSHA1": "HfqZyKllcHQDvTwgCaYL1jUPmW0=", + "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": "9ad9326b278af8fa5cc67c30c0ce9a58cc0862b2", + "revisionTime": "2018-04-04T23:29:44Z", + "version": "v10.6.0", + "versionExact": "v10.6.0" }, { "checksumSHA1": "jQh1fnoKPKMURvKkpdRjN695nAQ=", From c6e7b0fa240c49eaf2eb5d158064b1ca7c65cba5 Mon Sep 17 00:00:00 2001 From: tombuildsstuff Date: Thu, 5 Apr 2018 13:52:25 +0200 Subject: [PATCH 3/7] Downgrading the Automation SDK to v12.5.0-beta of the Azure SDK for Go --- .../mgmt/2015-10-31/automation/account.go | 26 +- .../mgmt/2015-10-31/automation/activity.go | 47 +- .../agentregistrationinformation.go | 44 +- .../mgmt/2015-10-31/automation/certificate.go | 104 +- .../mgmt/2015-10-31/automation/client.go | 18 +- .../mgmt/2015-10-31/automation/connection.go | 104 +- .../2015-10-31/automation/connectiontype.go | 84 +- .../mgmt/2015-10-31/automation/credential.go | 104 +- .../automation/dsccompilationjob.go | 84 +- .../automation/dsccompilationjobstream.go | 116 - .../2015-10-31/automation/dscconfiguration.go | 186 +- .../mgmt/2015-10-31/automation/dscnode.go | 83 +- .../automation/dscnodeconfiguration.go | 86 +- .../mgmt/2015-10-31/automation/fields.go | 26 +- .../automation/hybridrunbookworkergroup.go | 85 +- .../mgmt/2015-10-31/automation/job.go | 151 +- .../mgmt/2015-10-31/automation/jobschedule.go | 83 +- .../mgmt/2015-10-31/automation/jobstream.go | 47 +- .../mgmt/2015-10-31/automation/keys.go | 113 - .../2015-10-31/automation/linkedworkspace.go | 113 - .../mgmt/2015-10-31/automation/models.go | 4141 ++++++----------- .../mgmt/2015-10-31/automation/module.go | 102 +- .../mgmt/2015-10-31/automation/nodereports.go | 71 +- .../2015-10-31/automation/objectdatatypes.go | 43 +- .../mgmt/2015-10-31/automation/operations.go | 8 +- .../mgmt/2015-10-31/automation/runbook.go | 136 +- .../2015-10-31/automation/runbookdraft.go | 244 +- .../mgmt/2015-10-31/automation/schedule.go | 102 +- .../mgmt/2015-10-31/automation/statistics.go | 14 +- .../automation/{testjob.go => testjobs.go} | 157 +- .../2015-10-31/automation/testjobstreams.go | 50 +- .../mgmt/2015-10-31/automation/usages.go | 10 +- .../mgmt/2015-10-31/automation/variable.go | 102 +- .../mgmt/2015-10-31/automation/version.go | 6 +- .../mgmt/2015-10-31/automation/webhook.go | 119 +- vendor/vendor.json | 10 +- 36 files changed, 2490 insertions(+), 4529 deletions(-) delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dsccompilationjobstream.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/keys.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/linkedworkspace.go rename vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/{testjob.go => testjobs.go} (55%) 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 037f73a92408..c3ce360165aa 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 @@ -31,24 +31,24 @@ type AccountClient struct { } // NewAccountClient creates an instance of the AccountClient client. -func NewAccountClient(subscriptionID string) AccountClient { - return NewAccountClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewAccountClient(subscriptionID string, resourceGroupName string) AccountClient { + return NewAccountClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) } // NewAccountClientWithBaseURI creates an instance of the AccountClient client. -func NewAccountClientWithBaseURI(baseURI string, subscriptionID string) AccountClient { - return AccountClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewAccountClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) AccountClient { + return AccountClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} } // 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.NewError("automation.AccountClient", "CreateOrUpdate", err.Error()) + return result, validation.NewErrorWithValidationError(err, "automation.AccountClient", "CreateOrUpdate") } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, parameters) @@ -86,7 +86,7 @@ func (client AccountClient) CreateOrUpdatePreparer(ctx context.Context, resource } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsJSON(), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}", pathParameters), @@ -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.NewError("automation.AccountClient", "Delete", err.Error()) + return result, validation.NewErrorWithValidationError(err, "automation.AccountClient", "Delete") } 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.NewError("automation.AccountClient", "Get", err.Error()) + return result, validation.NewErrorWithValidationError(err, "automation.AccountClient", "Get") } 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.NewError("automation.AccountClient", "ListByResourceGroup", err.Error()) + return result, validation.NewErrorWithValidationError(err, "automation.AccountClient", "ListByResourceGroup") } 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.NewError("automation.AccountClient", "Update", err.Error()) + return result, validation.NewErrorWithValidationError(err, "automation.AccountClient", "Update") } req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, parameters) @@ -493,7 +493,7 @@ func (client AccountClient) UpdatePreparer(ctx context.Context, resourceGroupNam } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsJSON(), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}", pathParameters), 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 ac9db9eb863f..a9f8809970bc 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 @@ -31,27 +31,27 @@ type ActivityClient struct { } // NewActivityClient creates an instance of the ActivityClient client. -func NewActivityClient(subscriptionID string) ActivityClient { - return NewActivityClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewActivityClient(subscriptionID string, resourceGroupName string) ActivityClient { + return NewActivityClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) } // NewActivityClientWithBaseURI creates an instance of the ActivityClient client. -func NewActivityClientWithBaseURI(baseURI string, subscriptionID string) ActivityClient { - return ActivityClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewActivityClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) ActivityClient { + return ActivityClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} } // Get retrieve the activity in the module identified by module name and activity name. // -// resourceGroupName is the resource group name. 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, resourceGroupName string, automationAccountName string, moduleName string, activityName string) (result Activity, err error) { +// 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: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.ActivityClient", "Get", err.Error()) + {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") } - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, moduleName, activityName) + req, err := client.GetPreparer(ctx, automationAccountName, moduleName, activityName) if err != nil { err = autorest.NewErrorWithError(err, "automation.ActivityClient", "Get", nil, "Failure preparing request") return @@ -73,12 +73,12 @@ func (client ActivityClient) Get(ctx context.Context, resourceGroupName string, } // GetPreparer prepares the Get request. -func (client ActivityClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, activityName string) (*http.Request, error) { +func (client ActivityClient) GetPreparer(ctx context.Context, automationAccountName string, moduleName string, activityName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "activityName": autorest.Encode("path", activityName), "automationAccountName": autorest.Encode("path", automationAccountName), "moduleName": autorest.Encode("path", moduleName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -117,17 +117,16 @@ func (client ActivityClient) GetResponder(resp *http.Response) (result Activity, // ListByModule retrieve a list of activities in the module identified by module name. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. moduleName -// is the name of module. -func (client ActivityClient) ListByModule(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (result ActivityListResultPage, err error) { +// automationAccountName is the automation account name. moduleName is the name of module. +func (client ActivityClient) ListByModule(ctx context.Context, automationAccountName string, moduleName string) (result ActivityListResultPage, 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.NewError("automation.ActivityClient", "ListByModule", err.Error()) + {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") } result.fn = client.listByModuleNextResults - req, err := client.ListByModulePreparer(ctx, resourceGroupName, automationAccountName, moduleName) + req, err := client.ListByModulePreparer(ctx, automationAccountName, moduleName) if err != nil { err = autorest.NewErrorWithError(err, "automation.ActivityClient", "ListByModule", nil, "Failure preparing request") return @@ -149,11 +148,11 @@ func (client ActivityClient) ListByModule(ctx context.Context, resourceGroupName } // ListByModulePreparer prepares the ListByModule request. -func (client ActivityClient) ListByModulePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (*http.Request, error) { +func (client ActivityClient) ListByModulePreparer(ctx context.Context, automationAccountName string, moduleName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "moduleName": autorest.Encode("path", moduleName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -212,7 +211,7 @@ func (client ActivityClient) listByModuleNextResults(lastResults ActivityListRes } // ListByModuleComplete enumerates all values, automatically crossing page boundaries as required. -func (client ActivityClient) ListByModuleComplete(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (result ActivityListResultIterator, err error) { - result.page, err = client.ListByModule(ctx, resourceGroupName, automationAccountName, moduleName) +func (client ActivityClient) ListByModuleComplete(ctx context.Context, automationAccountName string, moduleName string) (result ActivityListResultIterator, err error) { + result.page, err = client.ListByModule(ctx, automationAccountName, moduleName) return } 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 365936df4f91..e7a717c201e8 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 @@ -31,27 +31,27 @@ type AgentRegistrationInformationClient struct { } // NewAgentRegistrationInformationClient creates an instance of the AgentRegistrationInformationClient client. -func NewAgentRegistrationInformationClient(subscriptionID string) AgentRegistrationInformationClient { - return NewAgentRegistrationInformationClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewAgentRegistrationInformationClient(subscriptionID string, resourceGroupName string) AgentRegistrationInformationClient { + return NewAgentRegistrationInformationClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) } // NewAgentRegistrationInformationClientWithBaseURI creates an instance of the AgentRegistrationInformationClient // client. -func NewAgentRegistrationInformationClientWithBaseURI(baseURI string, subscriptionID string) AgentRegistrationInformationClient { - return AgentRegistrationInformationClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewAgentRegistrationInformationClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) AgentRegistrationInformationClient { + return AgentRegistrationInformationClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} } // Get retrieve the automation agent registration information. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -func (client AgentRegistrationInformationClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string) (result AgentRegistration, err error) { +// automationAccountName is the automation account name. +func (client AgentRegistrationInformationClient) Get(ctx context.Context, automationAccountName string) (result AgentRegistration, 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.NewError("automation.AgentRegistrationInformationClient", "Get", err.Error()) + {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") } - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName) + req, err := client.GetPreparer(ctx, automationAccountName) if err != nil { err = autorest.NewErrorWithError(err, "automation.AgentRegistrationInformationClient", "Get", nil, "Failure preparing request") return @@ -73,10 +73,10 @@ func (client AgentRegistrationInformationClient) Get(ctx context.Context, resour } // GetPreparer prepares the Get request. -func (client AgentRegistrationInformationClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { +func (client AgentRegistrationInformationClient) GetPreparer(ctx context.Context, automationAccountName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -115,16 +115,16 @@ func (client AgentRegistrationInformationClient) GetResponder(resp *http.Respons // RegenerateKey regenerate a primary or secondary agent registration key // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. parameters -// is the name of the agent registration key to be regenerated -func (client AgentRegistrationInformationClient) RegenerateKey(ctx context.Context, resourceGroupName string, automationAccountName string, parameters AgentRegistrationRegenerateKeyParameter) (result AgentRegistration, err error) { +// automationAccountName is the automation account name. parameters is the name of the agent registration key to be +// regenerated +func (client AgentRegistrationInformationClient) RegenerateKey(ctx context.Context, automationAccountName string, parameters AgentRegistrationRegenerateKeyParameter) (result AgentRegistration, 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.NewError("automation.AgentRegistrationInformationClient", "RegenerateKey", err.Error()) + {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") } - req, err := client.RegenerateKeyPreparer(ctx, resourceGroupName, automationAccountName, parameters) + req, err := client.RegenerateKeyPreparer(ctx, automationAccountName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.AgentRegistrationInformationClient", "RegenerateKey", nil, "Failure preparing request") return @@ -146,10 +146,10 @@ func (client AgentRegistrationInformationClient) RegenerateKey(ctx context.Conte } // RegenerateKeyPreparer prepares the RegenerateKey request. -func (client AgentRegistrationInformationClient) RegenerateKeyPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, parameters AgentRegistrationRegenerateKeyParameter) (*http.Request, error) { +func (client AgentRegistrationInformationClient) RegenerateKeyPreparer(ctx context.Context, automationAccountName string, parameters AgentRegistrationRegenerateKeyParameter) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -159,7 +159,7 @@ func (client AgentRegistrationInformationClient) RegenerateKeyPreparer(ctx conte } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsJSON(), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/agentRegistrationInformation/regenerateKey", pathParameters), 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 11a65b7c908b..2fa5144f3a44 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 @@ -31,32 +31,31 @@ type CertificateClient struct { } // NewCertificateClient creates an instance of the CertificateClient client. -func NewCertificateClient(subscriptionID string) CertificateClient { - return NewCertificateClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewCertificateClient(subscriptionID string, resourceGroupName string) CertificateClient { + return NewCertificateClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) } // NewCertificateClientWithBaseURI creates an instance of the CertificateClient client. -func NewCertificateClientWithBaseURI(baseURI string, subscriptionID string) CertificateClient { - return CertificateClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewCertificateClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) CertificateClient { + return CertificateClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} } // CreateOrUpdate create a certificate. // -// resourceGroupName is the resource group name. 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, resourceGroupName string, automationAccountName string, certificateName string, parameters CertificateCreateOrUpdateParameters) (result Certificate, err error) { +// 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: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: client.ResourceGroupName, + Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, 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.NewError("automation.CertificateClient", "CreateOrUpdate", err.Error()) + return result, validation.NewErrorWithValidationError(err, "automation.CertificateClient", "CreateOrUpdate") } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, certificateName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, automationAccountName, certificateName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.CertificateClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -78,11 +77,11 @@ func (client CertificateClient) CreateOrUpdate(ctx context.Context, resourceGrou } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client CertificateClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string, parameters CertificateCreateOrUpdateParameters) (*http.Request, error) { +func (client CertificateClient) CreateOrUpdatePreparer(ctx context.Context, automationAccountName string, certificateName string, parameters CertificateCreateOrUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "certificateName": autorest.Encode("path", certificateName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -92,7 +91,7 @@ func (client CertificateClient) CreateOrUpdatePreparer(ctx context.Context, reso } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsJSON(), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}", pathParameters), @@ -123,16 +122,15 @@ func (client CertificateClient) CreateOrUpdateResponder(resp *http.Response) (re // Delete delete the certificate. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// certificateName is the name of certificate. -func (client CertificateClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string) (result autorest.Response, err error) { +// automationAccountName is the automation account name. certificateName is the name of certificate. +func (client CertificateClient) Delete(ctx context.Context, automationAccountName string, certificateName string) (result autorest.Response, 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.NewError("automation.CertificateClient", "Delete", err.Error()) + {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") } - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, certificateName) + req, err := client.DeletePreparer(ctx, automationAccountName, certificateName) if err != nil { err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Delete", nil, "Failure preparing request") return @@ -154,11 +152,11 @@ func (client CertificateClient) Delete(ctx context.Context, resourceGroupName st } // DeletePreparer prepares the Delete request. -func (client CertificateClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string) (*http.Request, error) { +func (client CertificateClient) DeletePreparer(ctx context.Context, automationAccountName string, certificateName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "certificateName": autorest.Encode("path", certificateName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -196,16 +194,15 @@ func (client CertificateClient) DeleteResponder(resp *http.Response) (result aut // Get retrieve the certificate identified by certificate name. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// certificateName is the name of certificate. -func (client CertificateClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string) (result Certificate, err error) { +// automationAccountName is the automation account name. certificateName is the name of certificate. +func (client CertificateClient) Get(ctx context.Context, automationAccountName string, certificateName string) (result Certificate, 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.NewError("automation.CertificateClient", "Get", err.Error()) + {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") } - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, certificateName) + req, err := client.GetPreparer(ctx, automationAccountName, certificateName) if err != nil { err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Get", nil, "Failure preparing request") return @@ -227,11 +224,11 @@ func (client CertificateClient) Get(ctx context.Context, resourceGroupName strin } // GetPreparer prepares the Get request. -func (client CertificateClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string) (*http.Request, error) { +func (client CertificateClient) GetPreparer(ctx context.Context, automationAccountName string, certificateName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "certificateName": autorest.Encode("path", certificateName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -270,16 +267,16 @@ func (client CertificateClient) GetResponder(resp *http.Response) (result Certif // ListByAutomationAccount retrieve a list of certificates. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -func (client CertificateClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result CertificateListResultPage, err error) { +// automationAccountName is the automation account name. +func (client CertificateClient) ListByAutomationAccount(ctx context.Context, automationAccountName string) (result CertificateListResultPage, 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.NewError("automation.CertificateClient", "ListByAutomationAccount", err.Error()) + {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") } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName) if err != nil { err = autorest.NewErrorWithError(err, "automation.CertificateClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -301,10 +298,10 @@ func (client CertificateClient) ListByAutomationAccount(ctx context.Context, res } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client CertificateClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { +func (client CertificateClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -363,24 +360,23 @@ func (client CertificateClient) listByAutomationAccountNextResults(lastResults C } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client CertificateClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result CertificateListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) +func (client CertificateClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string) (result CertificateListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, automationAccountName) return } // Update update a certificate. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// certificateName is the parameters supplied to the update certificate operation. parameters is the parameters -// supplied to the update certificate operation. -func (client CertificateClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string, parameters CertificateUpdateParameters) (result Certificate, err error) { +// automationAccountName is the automation account name. certificateName is the parameters supplied to the update +// certificate operation. parameters is the parameters supplied to the update certificate operation. +func (client CertificateClient) Update(ctx context.Context, automationAccountName string, certificateName string, parameters CertificateUpdateParameters) (result Certificate, 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.NewError("automation.CertificateClient", "Update", err.Error()) + {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") } - req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, certificateName, parameters) + req, err := client.UpdatePreparer(ctx, automationAccountName, certificateName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Update", nil, "Failure preparing request") return @@ -402,11 +398,11 @@ func (client CertificateClient) Update(ctx context.Context, resourceGroupName st } // UpdatePreparer prepares the Update request. -func (client CertificateClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string, parameters CertificateUpdateParameters) (*http.Request, error) { +func (client CertificateClient) UpdatePreparer(ctx context.Context, automationAccountName string, certificateName string, parameters CertificateUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "certificateName": autorest.Encode("path", certificateName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -416,7 +412,7 @@ func (client CertificateClient) UpdatePreparer(ctx context.Context, resourceGrou } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsJSON(), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}", pathParameters), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/client.go index 707fd618586a..b66b006734a9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/client.go @@ -32,20 +32,22 @@ const ( // BaseClient is the base client for Automation. type BaseClient struct { autorest.Client - BaseURI string - SubscriptionID string + BaseURI string + SubscriptionID string + ResourceGroupName string } // New creates an instance of the BaseClient client. -func New(subscriptionID string) BaseClient { - return NewWithBaseURI(DefaultBaseURI, subscriptionID) +func New(subscriptionID string, resourceGroupName string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) } // NewWithBaseURI creates an instance of the BaseClient client. -func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { +func NewWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) BaseClient { return BaseClient{ - Client: autorest.NewClientWithUserAgent(UserAgent()), - BaseURI: baseURI, - SubscriptionID: subscriptionID, + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + ResourceGroupName: resourceGroupName, } } 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 39287927d6eb..8e1e68e53e6f 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 @@ -31,32 +31,31 @@ type ConnectionClient struct { } // NewConnectionClient creates an instance of the ConnectionClient client. -func NewConnectionClient(subscriptionID string) ConnectionClient { - return NewConnectionClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewConnectionClient(subscriptionID string, resourceGroupName string) ConnectionClient { + return NewConnectionClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) } // NewConnectionClientWithBaseURI creates an instance of the ConnectionClient client. -func NewConnectionClientWithBaseURI(baseURI string, subscriptionID string) ConnectionClient { - return ConnectionClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewConnectionClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) ConnectionClient { + return ConnectionClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} } // CreateOrUpdate create or update a connection. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// connectionName is the parameters supplied to the create or update connection operation. parameters is the -// parameters supplied to the create or update connection operation. -func (client ConnectionClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string, parameters ConnectionCreateOrUpdateParameters) (result Connection, err error) { +// automationAccountName is the automation account name. connectionName is the parameters supplied to the create or +// update connection operation. parameters is the parameters supplied to the create or update connection operation. +func (client ConnectionClient) CreateOrUpdate(ctx context.Context, automationAccountName string, connectionName string, parameters ConnectionCreateOrUpdateParameters) (result Connection, err error) { if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: client.ResourceGroupName, + Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, 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.NewError("automation.ConnectionClient", "CreateOrUpdate", err.Error()) + return result, validation.NewErrorWithValidationError(err, "automation.ConnectionClient", "CreateOrUpdate") } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, connectionName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, automationAccountName, connectionName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -78,11 +77,11 @@ func (client ConnectionClient) CreateOrUpdate(ctx context.Context, resourceGroup } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ConnectionClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string, parameters ConnectionCreateOrUpdateParameters) (*http.Request, error) { +func (client ConnectionClient) CreateOrUpdatePreparer(ctx context.Context, automationAccountName string, connectionName string, parameters ConnectionCreateOrUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -92,7 +91,7 @@ func (client ConnectionClient) CreateOrUpdatePreparer(ctx context.Context, resou } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsJSON(), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}", pathParameters), @@ -123,16 +122,15 @@ func (client ConnectionClient) CreateOrUpdateResponder(resp *http.Response) (res // Delete delete the connection. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// connectionName is the name of connection. -func (client ConnectionClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string) (result Connection, err error) { +// automationAccountName is the automation account name. connectionName is the name of connection. +func (client ConnectionClient) Delete(ctx context.Context, automationAccountName string, connectionName string) (result Connection, 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.NewError("automation.ConnectionClient", "Delete", err.Error()) + {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") } - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, connectionName) + req, err := client.DeletePreparer(ctx, automationAccountName, connectionName) if err != nil { err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Delete", nil, "Failure preparing request") return @@ -154,11 +152,11 @@ func (client ConnectionClient) Delete(ctx context.Context, resourceGroupName str } // DeletePreparer prepares the Delete request. -func (client ConnectionClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string) (*http.Request, error) { +func (client ConnectionClient) DeletePreparer(ctx context.Context, automationAccountName string, connectionName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -197,16 +195,15 @@ func (client ConnectionClient) DeleteResponder(resp *http.Response) (result Conn // Get retrieve the connection identified by connection name. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// connectionName is the name of connection. -func (client ConnectionClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string) (result Connection, err error) { +// automationAccountName is the automation account name. connectionName is the name of connection. +func (client ConnectionClient) Get(ctx context.Context, automationAccountName string, connectionName string) (result Connection, 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.NewError("automation.ConnectionClient", "Get", err.Error()) + {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") } - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, connectionName) + req, err := client.GetPreparer(ctx, automationAccountName, connectionName) if err != nil { err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Get", nil, "Failure preparing request") return @@ -228,11 +225,11 @@ func (client ConnectionClient) Get(ctx context.Context, resourceGroupName string } // GetPreparer prepares the Get request. -func (client ConnectionClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string) (*http.Request, error) { +func (client ConnectionClient) GetPreparer(ctx context.Context, automationAccountName string, connectionName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -271,16 +268,16 @@ func (client ConnectionClient) GetResponder(resp *http.Response) (result Connect // ListByAutomationAccount retrieve a list of connections. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -func (client ConnectionClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result ConnectionListResultPage, err error) { +// automationAccountName is the automation account name. +func (client ConnectionClient) ListByAutomationAccount(ctx context.Context, automationAccountName string) (result ConnectionListResultPage, 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.NewError("automation.ConnectionClient", "ListByAutomationAccount", err.Error()) + {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") } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName) if err != nil { err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -302,10 +299,10 @@ func (client ConnectionClient) ListByAutomationAccount(ctx context.Context, reso } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client ConnectionClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { +func (client ConnectionClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -364,24 +361,23 @@ func (client ConnectionClient) listByAutomationAccountNextResults(lastResults Co } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client ConnectionClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result ConnectionListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) +func (client ConnectionClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string) (result ConnectionListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, automationAccountName) return } // Update update a connection. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// connectionName is the parameters supplied to the update a connection operation. parameters is the parameters -// supplied to the update a connection operation. -func (client ConnectionClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string, parameters ConnectionUpdateParameters) (result Connection, err error) { +// automationAccountName is the automation account name. connectionName is the parameters supplied to the update a +// connection operation. parameters is the parameters supplied to the update a connection operation. +func (client ConnectionClient) Update(ctx context.Context, automationAccountName string, connectionName string, parameters ConnectionUpdateParameters) (result Connection, 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.NewError("automation.ConnectionClient", "Update", err.Error()) + {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") } - req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, connectionName, parameters) + req, err := client.UpdatePreparer(ctx, automationAccountName, connectionName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Update", nil, "Failure preparing request") return @@ -403,11 +399,11 @@ func (client ConnectionClient) Update(ctx context.Context, resourceGroupName str } // UpdatePreparer prepares the Update request. -func (client ConnectionClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string, parameters ConnectionUpdateParameters) (*http.Request, error) { +func (client ConnectionClient) UpdatePreparer(ctx context.Context, automationAccountName string, connectionName string, parameters ConnectionUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -417,7 +413,7 @@ func (client ConnectionClient) UpdatePreparer(ctx context.Context, resourceGroup } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsJSON(), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}", pathParameters), 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 a5ce642d08d0..ee64b17abf86 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 @@ -31,32 +31,32 @@ type ConnectionTypeClient struct { } // NewConnectionTypeClient creates an instance of the ConnectionTypeClient client. -func NewConnectionTypeClient(subscriptionID string) ConnectionTypeClient { - return NewConnectionTypeClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewConnectionTypeClient(subscriptionID string, resourceGroupName string) ConnectionTypeClient { + return NewConnectionTypeClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) } // NewConnectionTypeClientWithBaseURI creates an instance of the ConnectionTypeClient client. -func NewConnectionTypeClientWithBaseURI(baseURI string, subscriptionID string) ConnectionTypeClient { - return ConnectionTypeClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewConnectionTypeClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) ConnectionTypeClient { + return ConnectionTypeClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} } // CreateOrUpdate create a connectiontype. // -// resourceGroupName is the resource group name. 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, resourceGroupName string, automationAccountName string, connectionTypeName string, parameters ConnectionTypeCreateOrUpdateParameters) (result ConnectionType, err error) { +// 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: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: client.ResourceGroupName, + Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, 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.NewError("automation.ConnectionTypeClient", "CreateOrUpdate", err.Error()) + return result, validation.NewErrorWithValidationError(err, "automation.ConnectionTypeClient", "CreateOrUpdate") } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, connectionTypeName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, automationAccountName, connectionTypeName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -78,11 +78,11 @@ func (client ConnectionTypeClient) CreateOrUpdate(ctx context.Context, resourceG } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ConnectionTypeClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string, parameters ConnectionTypeCreateOrUpdateParameters) (*http.Request, error) { +func (client ConnectionTypeClient) CreateOrUpdatePreparer(ctx context.Context, automationAccountName string, connectionTypeName string, parameters ConnectionTypeCreateOrUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "connectionTypeName": autorest.Encode("path", connectionTypeName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -92,7 +92,7 @@ func (client ConnectionTypeClient) CreateOrUpdatePreparer(ctx context.Context, r } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsJSON(), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}", pathParameters), @@ -123,16 +123,15 @@ func (client ConnectionTypeClient) CreateOrUpdateResponder(resp *http.Response) // Delete delete the connectiontype. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// connectionTypeName is the name of connectiontype. -func (client ConnectionTypeClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string) (result autorest.Response, err error) { +// automationAccountName is the automation account name. connectionTypeName is the name of connectiontype. +func (client ConnectionTypeClient) Delete(ctx context.Context, automationAccountName string, connectionTypeName string) (result autorest.Response, 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.NewError("automation.ConnectionTypeClient", "Delete", err.Error()) + {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") } - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, connectionTypeName) + req, err := client.DeletePreparer(ctx, automationAccountName, connectionTypeName) if err != nil { err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "Delete", nil, "Failure preparing request") return @@ -154,11 +153,11 @@ func (client ConnectionTypeClient) Delete(ctx context.Context, resourceGroupName } // DeletePreparer prepares the Delete request. -func (client ConnectionTypeClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string) (*http.Request, error) { +func (client ConnectionTypeClient) DeletePreparer(ctx context.Context, automationAccountName string, connectionTypeName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "connectionTypeName": autorest.Encode("path", connectionTypeName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -196,16 +195,15 @@ func (client ConnectionTypeClient) DeleteResponder(resp *http.Response) (result // Get retrieve the connectiontype identified by connectiontype name. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// connectionTypeName is the name of connectiontype. -func (client ConnectionTypeClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string) (result ConnectionType, err error) { +// automationAccountName is the automation account name. connectionTypeName is the name of connectiontype. +func (client ConnectionTypeClient) Get(ctx context.Context, automationAccountName string, connectionTypeName string) (result ConnectionType, 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.NewError("automation.ConnectionTypeClient", "Get", err.Error()) + {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") } - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, connectionTypeName) + req, err := client.GetPreparer(ctx, automationAccountName, connectionTypeName) if err != nil { err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "Get", nil, "Failure preparing request") return @@ -227,11 +225,11 @@ func (client ConnectionTypeClient) Get(ctx context.Context, resourceGroupName st } // GetPreparer prepares the Get request. -func (client ConnectionTypeClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string) (*http.Request, error) { +func (client ConnectionTypeClient) GetPreparer(ctx context.Context, automationAccountName string, connectionTypeName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "connectionTypeName": autorest.Encode("path", connectionTypeName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -270,16 +268,16 @@ func (client ConnectionTypeClient) GetResponder(resp *http.Response) (result Con // ListByAutomationAccount retrieve a list of connectiontypes. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -func (client ConnectionTypeClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result ConnectionTypeListResultPage, err error) { +// automationAccountName is the automation account name. +func (client ConnectionTypeClient) ListByAutomationAccount(ctx context.Context, automationAccountName string) (result ConnectionTypeListResultPage, 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.NewError("automation.ConnectionTypeClient", "ListByAutomationAccount", err.Error()) + {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") } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName) if err != nil { err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -301,10 +299,10 @@ func (client ConnectionTypeClient) ListByAutomationAccount(ctx context.Context, } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client ConnectionTypeClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { +func (client ConnectionTypeClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -363,7 +361,7 @@ func (client ConnectionTypeClient) listByAutomationAccountNextResults(lastResult } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client ConnectionTypeClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result ConnectionTypeListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) +func (client ConnectionTypeClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string) (result ConnectionTypeListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, automationAccountName) return } 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 11f696368414..80efdeaef210 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 @@ -31,34 +31,33 @@ type CredentialClient struct { } // NewCredentialClient creates an instance of the CredentialClient client. -func NewCredentialClient(subscriptionID string) CredentialClient { - return NewCredentialClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewCredentialClient(subscriptionID string, resourceGroupName string) CredentialClient { + return NewCredentialClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) } // NewCredentialClientWithBaseURI creates an instance of the CredentialClient client. -func NewCredentialClientWithBaseURI(baseURI string, subscriptionID string) CredentialClient { - return CredentialClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewCredentialClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) CredentialClient { + return CredentialClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} } // CreateOrUpdate create a credential. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// credentialName is the parameters supplied to the create or update credential operation. parameters is the -// parameters supplied to the create or update credential operation. -func (client CredentialClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string, parameters CredentialCreateOrUpdateParameters) (result Credential, err error) { +// automationAccountName is the automation account name. credentialName is the parameters supplied to the create or +// update credential operation. parameters is the parameters supplied to the create or update credential operation. +func (client CredentialClient) CreateOrUpdate(ctx context.Context, automationAccountName string, credentialName string, parameters CredentialCreateOrUpdateParameters) (result Credential, err error) { if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: client.ResourceGroupName, + Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.CredentialCreateOrUpdateProperties", Name: validation.Null, Rule: true, 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.NewError("automation.CredentialClient", "CreateOrUpdate", err.Error()) + return result, validation.NewErrorWithValidationError(err, "automation.CredentialClient", "CreateOrUpdate") } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, credentialName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, automationAccountName, credentialName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.CredentialClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -80,11 +79,11 @@ func (client CredentialClient) CreateOrUpdate(ctx context.Context, resourceGroup } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client CredentialClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string, parameters CredentialCreateOrUpdateParameters) (*http.Request, error) { +func (client CredentialClient) CreateOrUpdatePreparer(ctx context.Context, automationAccountName string, credentialName string, parameters CredentialCreateOrUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "credentialName": autorest.Encode("path", credentialName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -94,7 +93,7 @@ func (client CredentialClient) CreateOrUpdatePreparer(ctx context.Context, resou } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsJSON(), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}", pathParameters), @@ -125,16 +124,15 @@ func (client CredentialClient) CreateOrUpdateResponder(resp *http.Response) (res // Delete delete the credential. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// credentialName is the name of credential. -func (client CredentialClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string) (result autorest.Response, err error) { +// automationAccountName is the automation account name. credentialName is the name of credential. +func (client CredentialClient) Delete(ctx context.Context, automationAccountName string, credentialName string) (result autorest.Response, 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.NewError("automation.CredentialClient", "Delete", err.Error()) + {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") } - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, credentialName) + req, err := client.DeletePreparer(ctx, automationAccountName, credentialName) if err != nil { err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Delete", nil, "Failure preparing request") return @@ -156,11 +154,11 @@ func (client CredentialClient) Delete(ctx context.Context, resourceGroupName str } // DeletePreparer prepares the Delete request. -func (client CredentialClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string) (*http.Request, error) { +func (client CredentialClient) DeletePreparer(ctx context.Context, automationAccountName string, credentialName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "credentialName": autorest.Encode("path", credentialName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -198,16 +196,15 @@ func (client CredentialClient) DeleteResponder(resp *http.Response) (result auto // Get retrieve the credential identified by credential name. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// credentialName is the name of credential. -func (client CredentialClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string) (result Credential, err error) { +// automationAccountName is the automation account name. credentialName is the name of credential. +func (client CredentialClient) Get(ctx context.Context, automationAccountName string, credentialName string) (result Credential, 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.NewError("automation.CredentialClient", "Get", err.Error()) + {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") } - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, credentialName) + req, err := client.GetPreparer(ctx, automationAccountName, credentialName) if err != nil { err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Get", nil, "Failure preparing request") return @@ -229,11 +226,11 @@ func (client CredentialClient) Get(ctx context.Context, resourceGroupName string } // GetPreparer prepares the Get request. -func (client CredentialClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string) (*http.Request, error) { +func (client CredentialClient) GetPreparer(ctx context.Context, automationAccountName string, credentialName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "credentialName": autorest.Encode("path", credentialName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -272,16 +269,16 @@ func (client CredentialClient) GetResponder(resp *http.Response) (result Credent // ListByAutomationAccount retrieve a list of credentials. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -func (client CredentialClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result CredentialListResultPage, err error) { +// automationAccountName is the automation account name. +func (client CredentialClient) ListByAutomationAccount(ctx context.Context, automationAccountName string) (result CredentialListResultPage, 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.NewError("automation.CredentialClient", "ListByAutomationAccount", err.Error()) + {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") } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName) if err != nil { err = autorest.NewErrorWithError(err, "automation.CredentialClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -303,10 +300,10 @@ func (client CredentialClient) ListByAutomationAccount(ctx context.Context, reso } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client CredentialClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { +func (client CredentialClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -365,24 +362,23 @@ func (client CredentialClient) listByAutomationAccountNextResults(lastResults Cr } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client CredentialClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result CredentialListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) +func (client CredentialClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string) (result CredentialListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, automationAccountName) return } // Update update a credential. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// credentialName is the parameters supplied to the Update credential operation. parameters is the parameters -// supplied to the Update credential operation. -func (client CredentialClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string, parameters CredentialUpdateParameters) (result Credential, err error) { +// automationAccountName is the automation account name. credentialName is the parameters supplied to the Update +// credential operation. parameters is the parameters supplied to the Update credential operation. +func (client CredentialClient) Update(ctx context.Context, automationAccountName string, credentialName string, parameters CredentialUpdateParameters) (result Credential, 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.NewError("automation.CredentialClient", "Update", err.Error()) + {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") } - req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, credentialName, parameters) + req, err := client.UpdatePreparer(ctx, automationAccountName, credentialName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Update", nil, "Failure preparing request") return @@ -404,11 +400,11 @@ func (client CredentialClient) Update(ctx context.Context, resourceGroupName str } // UpdatePreparer prepares the Update request. -func (client CredentialClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string, parameters CredentialUpdateParameters) (*http.Request, error) { +func (client CredentialClient) UpdatePreparer(ctx context.Context, automationAccountName string, credentialName string, parameters CredentialUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "credentialName": autorest.Encode("path", credentialName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -418,7 +414,7 @@ func (client CredentialClient) UpdatePreparer(ctx context.Context, resourceGroup } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsJSON(), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}", pathParameters), 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 148d7c66aebb..013cefbbc2a1 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 @@ -32,31 +32,30 @@ type DscCompilationJobClient struct { } // NewDscCompilationJobClient creates an instance of the DscCompilationJobClient client. -func NewDscCompilationJobClient(subscriptionID string) DscCompilationJobClient { - return NewDscCompilationJobClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewDscCompilationJobClient(subscriptionID string, resourceGroupName string) DscCompilationJobClient { + return NewDscCompilationJobClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) } // NewDscCompilationJobClientWithBaseURI creates an instance of the DscCompilationJobClient client. -func NewDscCompilationJobClientWithBaseURI(baseURI string, subscriptionID string) DscCompilationJobClient { - return DscCompilationJobClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewDscCompilationJobClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) DscCompilationJobClient { + return DscCompilationJobClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} } // Create creates the Dsc compilation job of the configuration. // -// resourceGroupName is the resource group name. 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, resourceGroupName string, automationAccountName string, compilationJobID uuid.UUID, parameters DscCompilationJobCreateParameters) (result DscCompilationJob, err error) { +// 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: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: client.ResourceGroupName, + Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {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.NewError("automation.DscCompilationJobClient", "Create", err.Error()) + return result, validation.NewErrorWithValidationError(err, "automation.DscCompilationJobClient", "Create") } - req, err := client.CreatePreparer(ctx, resourceGroupName, automationAccountName, compilationJobID, parameters) + req, err := client.CreatePreparer(ctx, automationAccountName, compilationJobID, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "Create", nil, "Failure preparing request") return @@ -78,11 +77,11 @@ func (client DscCompilationJobClient) Create(ctx context.Context, resourceGroupN } // CreatePreparer prepares the Create request. -func (client DscCompilationJobClient) CreatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, compilationJobID uuid.UUID, parameters DscCompilationJobCreateParameters) (*http.Request, error) { +func (client DscCompilationJobClient) CreatePreparer(ctx context.Context, automationAccountName string, compilationJobID uuid.UUID, parameters DscCompilationJobCreateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "compilationJobId": autorest.Encode("path", compilationJobID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -92,7 +91,7 @@ func (client DscCompilationJobClient) CreatePreparer(ctx context.Context, resour } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsJSON(), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{compilationJobId}", pathParameters), @@ -123,16 +122,15 @@ func (client DscCompilationJobClient) CreateResponder(resp *http.Response) (resu // Get retrieve the Dsc configuration compilation job identified by job id. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// compilationJobID is the Dsc configuration compilation job id. -func (client DscCompilationJobClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, compilationJobID uuid.UUID) (result DscCompilationJob, err error) { +// 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: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.DscCompilationJobClient", "Get", err.Error()) + {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") } - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, compilationJobID) + req, err := client.GetPreparer(ctx, automationAccountName, compilationJobID) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "Get", nil, "Failure preparing request") return @@ -154,11 +152,11 @@ func (client DscCompilationJobClient) Get(ctx context.Context, resourceGroupName } // GetPreparer prepares the Get request. -func (client DscCompilationJobClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, compilationJobID uuid.UUID) (*http.Request, error) { +func (client DscCompilationJobClient) GetPreparer(ctx context.Context, automationAccountName string, compilationJobID uuid.UUID) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "compilationJobId": autorest.Encode("path", compilationJobID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -197,16 +195,15 @@ func (client DscCompilationJobClient) GetResponder(resp *http.Response) (result // GetStream retrieve the job stream identified by job stream id. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. jobID is the -// job id. jobStreamID is the job stream id. -func (client DscCompilationJobClient) GetStream(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID, jobStreamID string) (result JobStream, err error) { +// automationAccountName is the automation account name. jobID is the job id. jobStreamID is the job stream id. +func (client DscCompilationJobClient) GetStream(ctx context.Context, automationAccountName string, jobID uuid.UUID, jobStreamID string) (result JobStream, 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.NewError("automation.DscCompilationJobClient", "GetStream", err.Error()) + {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") } - req, err := client.GetStreamPreparer(ctx, resourceGroupName, automationAccountName, jobID, jobStreamID) + req, err := client.GetStreamPreparer(ctx, automationAccountName, jobID, jobStreamID) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "GetStream", nil, "Failure preparing request") return @@ -228,12 +225,12 @@ func (client DscCompilationJobClient) GetStream(ctx context.Context, resourceGro } // GetStreamPreparer prepares the GetStream request. -func (client DscCompilationJobClient) GetStreamPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID, jobStreamID string) (*http.Request, error) { +func (client DscCompilationJobClient) GetStreamPreparer(ctx context.Context, automationAccountName string, jobID uuid.UUID, jobStreamID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "jobId": autorest.Encode("path", jobID), "jobStreamId": autorest.Encode("path", jobStreamID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -272,17 +269,16 @@ func (client DscCompilationJobClient) GetStreamResponder(resp *http.Response) (r // ListByAutomationAccount retrieve a list of dsc compilation jobs. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. filter is -// the filter to apply on the operation. -func (client DscCompilationJobClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result DscCompilationJobListResultPage, err error) { +// automationAccountName is the automation account name. filter is the filter to apply on the operation. +func (client DscCompilationJobClient) ListByAutomationAccount(ctx context.Context, automationAccountName string, filter string) (result DscCompilationJobListResultPage, 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.NewError("automation.DscCompilationJobClient", "ListByAutomationAccount", err.Error()) + {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") } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) + req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName, filter) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -304,10 +300,10 @@ func (client DscCompilationJobClient) ListByAutomationAccount(ctx context.Contex } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client DscCompilationJobClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { +func (client DscCompilationJobClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -369,7 +365,7 @@ func (client DscCompilationJobClient) listByAutomationAccountNextResults(lastRes } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client DscCompilationJobClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result DscCompilationJobListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) +func (client DscCompilationJobClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string, filter string) (result DscCompilationJobListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, automationAccountName, filter) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dsccompilationjobstream.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dsccompilationjobstream.go deleted file mode 100644 index 6e103018fe4c..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/dsccompilationjobstream.go +++ /dev/null @@ -1,116 +0,0 @@ -package automation - -// 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" - "github.com/satori/go.uuid" - "net/http" -) - -// DscCompilationJobStreamClient is the automation Client -type DscCompilationJobStreamClient struct { - BaseClient -} - -// NewDscCompilationJobStreamClient creates an instance of the DscCompilationJobStreamClient client. -func NewDscCompilationJobStreamClient(subscriptionID string) DscCompilationJobStreamClient { - return NewDscCompilationJobStreamClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDscCompilationJobStreamClientWithBaseURI creates an instance of the DscCompilationJobStreamClient client. -func NewDscCompilationJobStreamClientWithBaseURI(baseURI string, subscriptionID string) DscCompilationJobStreamClient { - return DscCompilationJobStreamClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// ListByJob retrieve all the job streams for the compilation Job. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. jobID is the -// job id. -func (client DscCompilationJobStreamClient) ListByJob(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (result JobStreamListResult, 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.NewError("automation.DscCompilationJobStreamClient", "ListByJob", err.Error()) - } - - req, err := client.ListByJobPreparer(ctx, resourceGroupName, automationAccountName, jobID) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscCompilationJobStreamClient", "ListByJob", nil, "Failure preparing request") - return - } - - resp, err := client.ListByJobSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.DscCompilationJobStreamClient", "ListByJob", resp, "Failure sending request") - return - } - - result, err = client.ListByJobResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscCompilationJobStreamClient", "ListByJob", resp, "Failure responding to request") - } - - return -} - -// ListByJobPreparer prepares the ListByJob request. -func (client DscCompilationJobStreamClient) ListByJobPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "jobId": autorest.Encode("path", jobID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2015-10-31" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{jobId}/streams/", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByJobSender sends the ListByJob request. The method will close the -// http.Response Body if it receives an error. -func (client DscCompilationJobStreamClient) ListByJobSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListByJobResponder handles the response to the ListByJob request. The method always -// closes the http.Response Body. -func (client DscCompilationJobStreamClient) ListByJobResponder(resp *http.Response) (result JobStreamListResult, 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/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 87d1abc507ae..df6e2b9cd8ab 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 @@ -31,24 +31,23 @@ type DscConfigurationClient struct { } // NewDscConfigurationClient creates an instance of the DscConfigurationClient client. -func NewDscConfigurationClient(subscriptionID string) DscConfigurationClient { - return NewDscConfigurationClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewDscConfigurationClient(subscriptionID string, resourceGroupName string) DscConfigurationClient { + return NewDscConfigurationClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) } // NewDscConfigurationClientWithBaseURI creates an instance of the DscConfigurationClient client. -func NewDscConfigurationClientWithBaseURI(baseURI string, subscriptionID string) DscConfigurationClient { - return DscConfigurationClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewDscConfigurationClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) DscConfigurationClient { + return DscConfigurationClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} } // CreateOrUpdate create the configuration identified by configuration name. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// configurationName is the create or update parameters for configuration. parameters is the create or update -// parameters for configuration. -func (client DscConfigurationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string, parameters DscConfigurationCreateOrUpdateParameters) (result DscConfiguration, err error) { +// automationAccountName is the automation account name. configurationName is the create or update parameters for +// configuration. parameters is the create or update parameters for configuration. +func (client DscConfigurationClient) CreateOrUpdate(ctx context.Context, automationAccountName string, configurationName string, parameters DscConfigurationCreateOrUpdateParameters) (result DscConfiguration, err error) { if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: client.ResourceGroupName, + Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.DscConfigurationCreateOrUpdateProperties", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.DscConfigurationCreateOrUpdateProperties.Source", Name: validation.Null, Rule: true, @@ -58,10 +57,10 @@ func (client DscConfigurationClient) CreateOrUpdate(ctx context.Context, resourc }}, }}, }}}}}); err != nil { - return result, validation.NewError("automation.DscConfigurationClient", "CreateOrUpdate", err.Error()) + return result, validation.NewErrorWithValidationError(err, "automation.DscConfigurationClient", "CreateOrUpdate") } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, configurationName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, automationAccountName, configurationName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -83,11 +82,11 @@ func (client DscConfigurationClient) CreateOrUpdate(ctx context.Context, resourc } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DscConfigurationClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string, parameters DscConfigurationCreateOrUpdateParameters) (*http.Request, error) { +func (client DscConfigurationClient) CreateOrUpdatePreparer(ctx context.Context, automationAccountName string, configurationName string, parameters DscConfigurationCreateOrUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "configurationName": autorest.Encode("path", configurationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -97,7 +96,7 @@ func (client DscConfigurationClient) CreateOrUpdatePreparer(ctx context.Context, } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsJSON(), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}", pathParameters), @@ -128,16 +127,15 @@ func (client DscConfigurationClient) CreateOrUpdateResponder(resp *http.Response // Delete delete the dsc configuration identified by configuration name. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// configurationName is the configuration name. -func (client DscConfigurationClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (result autorest.Response, err error) { +// automationAccountName is the automation account name. configurationName is the configuration name. +func (client DscConfigurationClient) Delete(ctx context.Context, automationAccountName string, configurationName string) (result autorest.Response, 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.NewError("automation.DscConfigurationClient", "Delete", err.Error()) + {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") } - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, configurationName) + req, err := client.DeletePreparer(ctx, automationAccountName, configurationName) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Delete", nil, "Failure preparing request") return @@ -159,11 +157,11 @@ func (client DscConfigurationClient) Delete(ctx context.Context, resourceGroupNa } // DeletePreparer prepares the Delete request. -func (client DscConfigurationClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (*http.Request, error) { +func (client DscConfigurationClient) DeletePreparer(ctx context.Context, automationAccountName string, configurationName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "configurationName": autorest.Encode("path", configurationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -201,16 +199,15 @@ func (client DscConfigurationClient) DeleteResponder(resp *http.Response) (resul // Get retrieve the configuration identified by configuration name. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// configurationName is the configuration name. -func (client DscConfigurationClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (result DscConfiguration, err error) { +// automationAccountName is the automation account name. configurationName is the configuration name. +func (client DscConfigurationClient) Get(ctx context.Context, automationAccountName string, configurationName string) (result DscConfiguration, 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.NewError("automation.DscConfigurationClient", "Get", err.Error()) + {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") } - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, configurationName) + req, err := client.GetPreparer(ctx, automationAccountName, configurationName) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Get", nil, "Failure preparing request") return @@ -232,11 +229,11 @@ func (client DscConfigurationClient) Get(ctx context.Context, resourceGroupName } // GetPreparer prepares the Get request. -func (client DscConfigurationClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (*http.Request, error) { +func (client DscConfigurationClient) GetPreparer(ctx context.Context, automationAccountName string, configurationName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "configurationName": autorest.Encode("path", configurationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -275,16 +272,15 @@ func (client DscConfigurationClient) GetResponder(resp *http.Response) (result D // GetContent retrieve the configuration script identified by configuration name. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// configurationName is the configuration name. -func (client DscConfigurationClient) GetContent(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (result String, err error) { +// automationAccountName is the automation account name. configurationName is the configuration name. +func (client DscConfigurationClient) GetContent(ctx context.Context, automationAccountName string, configurationName string) (result ReadCloser, 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.NewError("automation.DscConfigurationClient", "GetContent", err.Error()) + {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") } - req, err := client.GetContentPreparer(ctx, resourceGroupName, automationAccountName, configurationName) + req, err := client.GetContentPreparer(ctx, automationAccountName, configurationName) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "GetContent", nil, "Failure preparing request") return @@ -306,11 +302,11 @@ func (client DscConfigurationClient) GetContent(ctx context.Context, resourceGro } // GetContentPreparer prepares the GetContent request. -func (client DscConfigurationClient) GetContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (*http.Request, error) { +func (client DscConfigurationClient) GetContentPreparer(ctx context.Context, automationAccountName string, configurationName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "configurationName": autorest.Encode("path", configurationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -336,29 +332,28 @@ func (client DscConfigurationClient) GetContentSender(req *http.Request) (*http. // GetContentResponder handles the response to the GetContent request. The method always // closes the http.Response Body. -func (client DscConfigurationClient) GetContentResponder(resp *http.Response) (result String, err error) { +func (client DscConfigurationClient) GetContentResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) + azure.WithErrorUnlessStatusCode(http.StatusOK)) result.Response = autorest.Response{Response: resp} return } // ListByAutomationAccount retrieve a list of configurations. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -func (client DscConfigurationClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result DscConfigurationListResultPage, err error) { +// automationAccountName is the automation account name. +func (client DscConfigurationClient) ListByAutomationAccount(ctx context.Context, automationAccountName string) (result DscConfigurationListResultPage, 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.NewError("automation.DscConfigurationClient", "ListByAutomationAccount", err.Error()) + {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") } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -380,10 +375,10 @@ func (client DscConfigurationClient) ListByAutomationAccount(ctx context.Context } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client DscConfigurationClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { +func (client DscConfigurationClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -442,86 +437,7 @@ func (client DscConfigurationClient) listByAutomationAccountNextResults(lastResu } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client DscConfigurationClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result DscConfigurationListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) - return -} - -// Update create the configuration identified by configuration name. -// -// automationAccountName is the automation account name. configurationName is the create or update parameters for -// configuration. parameters is the create or update parameters for configuration. -func (client DscConfigurationClient) Update(ctx context.Context, automationAccountName string, configurationName string, parameters *DscConfigurationUpdateParameters) (result DscConfiguration, 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.NewError("automation.DscConfigurationClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, automationAccountName, configurationName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client DscConfigurationClient) UpdatePreparer(ctx context.Context, automationAccountName string, configurationName string, parameters *DscConfigurationUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "configurationName": autorest.Encode("path", configurationName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2015-10-31" - 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.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if parameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(parameters)) - } - 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 DscConfigurationClient) 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 DscConfigurationClient) UpdateResponder(resp *http.Response) (result DscConfiguration, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} +func (client DscConfigurationClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string) (result DscConfigurationListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, automationAccountName) return } 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 a51206bccabe..2a6fb84b37c8 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 @@ -31,27 +31,26 @@ type DscNodeClient struct { } // NewDscNodeClient creates an instance of the DscNodeClient client. -func NewDscNodeClient(subscriptionID string) DscNodeClient { - return NewDscNodeClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewDscNodeClient(subscriptionID string, resourceGroupName string) DscNodeClient { + return NewDscNodeClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) } // NewDscNodeClientWithBaseURI creates an instance of the DscNodeClient client. -func NewDscNodeClientWithBaseURI(baseURI string, subscriptionID string) DscNodeClient { - return DscNodeClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewDscNodeClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) DscNodeClient { + return DscNodeClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} } // Delete delete the dsc node identified by node id. // -// resourceGroupName is the resource group name. automationAccountName is automation account name. nodeID is the -// node id. -func (client DscNodeClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string) (result DscNode, err error) { +// automationAccountName is automation account name. nodeID is the node id. +func (client DscNodeClient) Delete(ctx context.Context, automationAccountName string, nodeID string) (result DscNode, 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.NewError("automation.DscNodeClient", "Delete", err.Error()) + {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") } - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, nodeID) + req, err := client.DeletePreparer(ctx, automationAccountName, nodeID) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Delete", nil, "Failure preparing request") return @@ -73,11 +72,11 @@ func (client DscNodeClient) Delete(ctx context.Context, resourceGroupName string } // DeletePreparer prepares the Delete request. -func (client DscNodeClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string) (*http.Request, error) { +func (client DscNodeClient) DeletePreparer(ctx context.Context, automationAccountName string, nodeID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "nodeId": autorest.Encode("path", nodeID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -116,16 +115,15 @@ func (client DscNodeClient) DeleteResponder(resp *http.Response) (result DscNode // Get retrieve the dsc node identified by node id. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. nodeID is -// the node id. -func (client DscNodeClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string) (result DscNode, err error) { +// automationAccountName is the automation account name. nodeID is the node id. +func (client DscNodeClient) Get(ctx context.Context, automationAccountName string, nodeID string) (result DscNode, 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.NewError("automation.DscNodeClient", "Get", err.Error()) + {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") } - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, nodeID) + req, err := client.GetPreparer(ctx, automationAccountName, nodeID) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Get", nil, "Failure preparing request") return @@ -147,11 +145,11 @@ func (client DscNodeClient) Get(ctx context.Context, resourceGroupName string, a } // GetPreparer prepares the Get request. -func (client DscNodeClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string) (*http.Request, error) { +func (client DscNodeClient) GetPreparer(ctx context.Context, automationAccountName string, nodeID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "nodeId": autorest.Encode("path", nodeID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -190,17 +188,16 @@ func (client DscNodeClient) GetResponder(resp *http.Response) (result DscNode, e // ListByAutomationAccount retrieve a list of dsc nodes. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. filter is -// the filter to apply on the operation. -func (client DscNodeClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result DscNodeListResultPage, err error) { +// automationAccountName is the automation account name. filter is the filter to apply on the operation. +func (client DscNodeClient) ListByAutomationAccount(ctx context.Context, automationAccountName string, filter string) (result DscNodeListResultPage, 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.NewError("automation.DscNodeClient", "ListByAutomationAccount", err.Error()) + {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") } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) + req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName, filter) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -222,10 +219,10 @@ func (client DscNodeClient) ListByAutomationAccount(ctx context.Context, resourc } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client DscNodeClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { +func (client DscNodeClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -287,23 +284,23 @@ func (client DscNodeClient) listByAutomationAccountNextResults(lastResults DscNo } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client DscNodeClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result DscNodeListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) +func (client DscNodeClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string, filter string) (result DscNodeListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, automationAccountName, filter) return } // Update update the dsc node. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. nodeID is -// parameters supplied to the update dsc node. parameters is parameters supplied to the update dsc node. -func (client DscNodeClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, parameters DscNodeUpdateParameters) (result DscNode, err error) { +// automationAccountName is the automation account name. nodeID is parameters supplied to the update dsc node. +// parameters is parameters supplied to the update dsc node. +func (client DscNodeClient) Update(ctx context.Context, automationAccountName string, nodeID string, parameters DscNodeUpdateParameters) (result DscNode, 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.NewError("automation.DscNodeClient", "Update", err.Error()) + {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") } - req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, nodeID, parameters) + req, err := client.UpdatePreparer(ctx, automationAccountName, nodeID, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Update", nil, "Failure preparing request") return @@ -325,11 +322,11 @@ func (client DscNodeClient) Update(ctx context.Context, resourceGroupName string } // UpdatePreparer prepares the Update request. -func (client DscNodeClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, parameters DscNodeUpdateParameters) (*http.Request, error) { +func (client DscNodeClient) UpdatePreparer(ctx context.Context, automationAccountName string, nodeID string, parameters DscNodeUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "nodeId": autorest.Encode("path", nodeID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -339,7 +336,7 @@ func (client DscNodeClient) UpdatePreparer(ctx context.Context, resourceGroupNam } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsJSON(), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}", pathParameters), 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 e2684c9b1552..3028f786d1a9 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 @@ -31,24 +31,23 @@ type DscNodeConfigurationClient struct { } // NewDscNodeConfigurationClient creates an instance of the DscNodeConfigurationClient client. -func NewDscNodeConfigurationClient(subscriptionID string) DscNodeConfigurationClient { - return NewDscNodeConfigurationClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewDscNodeConfigurationClient(subscriptionID string, resourceGroupName string) DscNodeConfigurationClient { + return NewDscNodeConfigurationClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) } // NewDscNodeConfigurationClientWithBaseURI creates an instance of the DscNodeConfigurationClient client. -func NewDscNodeConfigurationClientWithBaseURI(baseURI string, subscriptionID string) DscNodeConfigurationClient { - return DscNodeConfigurationClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewDscNodeConfigurationClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) DscNodeConfigurationClient { + return DscNodeConfigurationClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} } // CreateOrUpdate create the node configuration identified by node configuration name. // -// resourceGroupName is the resource group 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. -func (client DscNodeConfigurationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string, parameters DscNodeConfigurationCreateOrUpdateParameters) (result DscNodeConfiguration, err error) { +// 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: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: client.ResourceGroupName, + Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Source", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.Source.Hash", Name: validation.Null, Rule: false, @@ -58,10 +57,10 @@ func (client DscNodeConfigurationClient) CreateOrUpdate(ctx context.Context, res }}, {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.NewError("automation.DscNodeConfigurationClient", "CreateOrUpdate", err.Error()) + return result, validation.NewErrorWithValidationError(err, "automation.DscNodeConfigurationClient", "CreateOrUpdate") } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, nodeConfigurationName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, automationAccountName, nodeConfigurationName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -83,11 +82,11 @@ func (client DscNodeConfigurationClient) CreateOrUpdate(ctx context.Context, res } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DscNodeConfigurationClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string, parameters DscNodeConfigurationCreateOrUpdateParameters) (*http.Request, error) { +func (client DscNodeConfigurationClient) CreateOrUpdatePreparer(ctx context.Context, automationAccountName string, nodeConfigurationName string, parameters DscNodeConfigurationCreateOrUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "nodeConfigurationName": autorest.Encode("path", nodeConfigurationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -97,7 +96,7 @@ func (client DscNodeConfigurationClient) CreateOrUpdatePreparer(ctx context.Cont } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsJSON(), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}", pathParameters), @@ -119,7 +118,7 @@ func (client DscNodeConfigurationClient) CreateOrUpdateResponder(resp *http.Resp err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} @@ -128,16 +127,15 @@ func (client DscNodeConfigurationClient) CreateOrUpdateResponder(resp *http.Resp // Delete delete the Dsc node configurations by node configuration. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// nodeConfigurationName is the Dsc node configuration name. -func (client DscNodeConfigurationClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string) (result autorest.Response, err error) { +// automationAccountName is the automation account name. nodeConfigurationName is the Dsc node configuration name. +func (client DscNodeConfigurationClient) Delete(ctx context.Context, automationAccountName string, nodeConfigurationName string) (result autorest.Response, 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.NewError("automation.DscNodeConfigurationClient", "Delete", err.Error()) + {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") } - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, nodeConfigurationName) + req, err := client.DeletePreparer(ctx, automationAccountName, nodeConfigurationName) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "Delete", nil, "Failure preparing request") return @@ -159,11 +157,11 @@ func (client DscNodeConfigurationClient) Delete(ctx context.Context, resourceGro } // DeletePreparer prepares the Delete request. -func (client DscNodeConfigurationClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string) (*http.Request, error) { +func (client DscNodeConfigurationClient) DeletePreparer(ctx context.Context, automationAccountName string, nodeConfigurationName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "nodeConfigurationName": autorest.Encode("path", nodeConfigurationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -201,16 +199,15 @@ func (client DscNodeConfigurationClient) DeleteResponder(resp *http.Response) (r // Get retrieve the Dsc node configurations by node configuration. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// nodeConfigurationName is the Dsc node configuration name. -func (client DscNodeConfigurationClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string) (result DscNodeConfiguration, err error) { +// automationAccountName is the automation account name. nodeConfigurationName is the Dsc node configuration name. +func (client DscNodeConfigurationClient) Get(ctx context.Context, automationAccountName string, nodeConfigurationName string) (result DscNodeConfiguration, 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.NewError("automation.DscNodeConfigurationClient", "Get", err.Error()) + {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") } - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, nodeConfigurationName) + req, err := client.GetPreparer(ctx, automationAccountName, nodeConfigurationName) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "Get", nil, "Failure preparing request") return @@ -232,11 +229,11 @@ func (client DscNodeConfigurationClient) Get(ctx context.Context, resourceGroupN } // GetPreparer prepares the Get request. -func (client DscNodeConfigurationClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string) (*http.Request, error) { +func (client DscNodeConfigurationClient) GetPreparer(ctx context.Context, automationAccountName string, nodeConfigurationName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "nodeConfigurationName": autorest.Encode("path", nodeConfigurationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -275,17 +272,16 @@ func (client DscNodeConfigurationClient) GetResponder(resp *http.Response) (resu // ListByAutomationAccount retrieve a list of dsc node configurations. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. filter is -// the filter to apply on the operation. -func (client DscNodeConfigurationClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result DscNodeConfigurationListResultPage, err error) { +// automationAccountName is the automation account name. filter is the filter to apply on the operation. +func (client DscNodeConfigurationClient) ListByAutomationAccount(ctx context.Context, automationAccountName string, filter string) (result DscNodeConfigurationListResultPage, 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.NewError("automation.DscNodeConfigurationClient", "ListByAutomationAccount", err.Error()) + {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") } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) + req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName, filter) if err != nil { err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -307,10 +303,10 @@ func (client DscNodeConfigurationClient) ListByAutomationAccount(ctx context.Con } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client DscNodeConfigurationClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { +func (client DscNodeConfigurationClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -372,7 +368,7 @@ func (client DscNodeConfigurationClient) listByAutomationAccountNextResults(last } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client DscNodeConfigurationClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result DscNodeConfigurationListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) +func (client DscNodeConfigurationClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string, filter string) (result DscNodeConfigurationListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, automationAccountName, filter) return } 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 756ad090d914..122fa0fc1e5c 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 @@ -31,27 +31,27 @@ type FieldsClient struct { } // NewFieldsClient creates an instance of the FieldsClient client. -func NewFieldsClient(subscriptionID string) FieldsClient { - return NewFieldsClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewFieldsClient(subscriptionID string, resourceGroupName string) FieldsClient { + return NewFieldsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) } // NewFieldsClientWithBaseURI creates an instance of the FieldsClient client. -func NewFieldsClientWithBaseURI(baseURI string, subscriptionID string) FieldsClient { - return FieldsClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewFieldsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) FieldsClient { + return FieldsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} } // ListByType retrieve a list of fields of a given type identified by module name. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. moduleName -// is the name of module. typeName is the name of type. -func (client FieldsClient) ListByType(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, typeName string) (result TypeFieldListResult, err error) { +// automationAccountName is the automation account name. moduleName is the name of module. typeName is the name of +// type. +func (client FieldsClient) ListByType(ctx context.Context, automationAccountName string, moduleName string, typeName string) (result TypeFieldListResult, 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.NewError("automation.FieldsClient", "ListByType", err.Error()) + {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") } - req, err := client.ListByTypePreparer(ctx, resourceGroupName, automationAccountName, moduleName, typeName) + req, err := client.ListByTypePreparer(ctx, automationAccountName, moduleName, typeName) if err != nil { err = autorest.NewErrorWithError(err, "automation.FieldsClient", "ListByType", nil, "Failure preparing request") return @@ -73,11 +73,11 @@ func (client FieldsClient) ListByType(ctx context.Context, resourceGroupName str } // ListByTypePreparer prepares the ListByType request. -func (client FieldsClient) ListByTypePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, typeName string) (*http.Request, error) { +func (client FieldsClient) ListByTypePreparer(ctx context.Context, automationAccountName string, moduleName string, typeName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "moduleName": autorest.Encode("path", moduleName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "typeName": autorest.Encode("path", 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 d480a44178ce..2ee7969edae8 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 @@ -31,27 +31,27 @@ type HybridRunbookWorkerGroupClient struct { } // NewHybridRunbookWorkerGroupClient creates an instance of the HybridRunbookWorkerGroupClient client. -func NewHybridRunbookWorkerGroupClient(subscriptionID string) HybridRunbookWorkerGroupClient { - return NewHybridRunbookWorkerGroupClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewHybridRunbookWorkerGroupClient(subscriptionID string, resourceGroupName string) HybridRunbookWorkerGroupClient { + return NewHybridRunbookWorkerGroupClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) } // NewHybridRunbookWorkerGroupClientWithBaseURI creates an instance of the HybridRunbookWorkerGroupClient client. -func NewHybridRunbookWorkerGroupClientWithBaseURI(baseURI string, subscriptionID string) HybridRunbookWorkerGroupClient { - return HybridRunbookWorkerGroupClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewHybridRunbookWorkerGroupClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) HybridRunbookWorkerGroupClient { + return HybridRunbookWorkerGroupClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} } // Delete delete a hybrid runbook worker group. // -// resourceGroupName is the resource group name. automationAccountName is automation account name. -// hybridRunbookWorkerGroupName is the hybrid runbook worker group name -func (client HybridRunbookWorkerGroupClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string) (result autorest.Response, err error) { +// 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: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.HybridRunbookWorkerGroupClient", "Delete", err.Error()) + {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") } - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName) + req, err := client.DeletePreparer(ctx, automationAccountName, hybridRunbookWorkerGroupName) if err != nil { err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Delete", nil, "Failure preparing request") return @@ -73,11 +73,11 @@ func (client HybridRunbookWorkerGroupClient) Delete(ctx context.Context, resourc } // DeletePreparer prepares the Delete request. -func (client HybridRunbookWorkerGroupClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string) (*http.Request, error) { +func (client HybridRunbookWorkerGroupClient) DeletePreparer(ctx context.Context, automationAccountName string, hybridRunbookWorkerGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "hybridRunbookWorkerGroupName": autorest.Encode("path", hybridRunbookWorkerGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -115,16 +115,16 @@ func (client HybridRunbookWorkerGroupClient) DeleteResponder(resp *http.Response // Get retrieve a hybrid runbook worker group. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// hybridRunbookWorkerGroupName is the hybrid runbook worker group name -func (client HybridRunbookWorkerGroupClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string) (result HybridRunbookWorkerGroup, err error) { +// automationAccountName is the automation account name. hybridRunbookWorkerGroupName is the hybrid runbook worker +// group name +func (client HybridRunbookWorkerGroupClient) Get(ctx context.Context, automationAccountName string, hybridRunbookWorkerGroupName string) (result HybridRunbookWorkerGroup, 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.NewError("automation.HybridRunbookWorkerGroupClient", "Get", err.Error()) + {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") } - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName) + req, err := client.GetPreparer(ctx, automationAccountName, hybridRunbookWorkerGroupName) if err != nil { err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Get", nil, "Failure preparing request") return @@ -146,11 +146,11 @@ func (client HybridRunbookWorkerGroupClient) Get(ctx context.Context, resourceGr } // GetPreparer prepares the Get request. -func (client HybridRunbookWorkerGroupClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string) (*http.Request, error) { +func (client HybridRunbookWorkerGroupClient) GetPreparer(ctx context.Context, automationAccountName string, hybridRunbookWorkerGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "hybridRunbookWorkerGroupName": autorest.Encode("path", hybridRunbookWorkerGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -189,16 +189,16 @@ func (client HybridRunbookWorkerGroupClient) GetResponder(resp *http.Response) ( // ListByAutomationAccount retrieve a list of hybrid runbook worker groups. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -func (client HybridRunbookWorkerGroupClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result HybridRunbookWorkerGroupsListResultPage, err error) { +// automationAccountName is the automation account name. +func (client HybridRunbookWorkerGroupClient) ListByAutomationAccount(ctx context.Context, automationAccountName string) (result HybridRunbookWorkerGroupsListResultPage, 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.NewError("automation.HybridRunbookWorkerGroupClient", "ListByAutomationAccount", err.Error()) + {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") } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName) if err != nil { err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -220,10 +220,10 @@ func (client HybridRunbookWorkerGroupClient) ListByAutomationAccount(ctx context } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client HybridRunbookWorkerGroupClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { +func (client HybridRunbookWorkerGroupClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -282,24 +282,23 @@ func (client HybridRunbookWorkerGroupClient) listByAutomationAccountNextResults( } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client HybridRunbookWorkerGroupClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result HybridRunbookWorkerGroupsListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) +func (client HybridRunbookWorkerGroupClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string) (result HybridRunbookWorkerGroupsListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, automationAccountName) return } // Update update a hybrid runbook worker group. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// hybridRunbookWorkerGroupName is the hybrid runbook worker group name parameters is the hybrid runbook worker -// group -func (client HybridRunbookWorkerGroupClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string, parameters HybridRunbookWorkerGroupUpdateParameters) (result HybridRunbookWorkerGroup, err error) { +// automationAccountName is the automation account name. hybridRunbookWorkerGroupName is the hybrid runbook worker +// group name parameters is the hybrid runbook worker group +func (client HybridRunbookWorkerGroupClient) Update(ctx context.Context, automationAccountName string, hybridRunbookWorkerGroupName string, parameters HybridRunbookWorkerGroupUpdateParameters) (result HybridRunbookWorkerGroup, 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.NewError("automation.HybridRunbookWorkerGroupClient", "Update", err.Error()) + {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") } - req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName, parameters) + req, err := client.UpdatePreparer(ctx, automationAccountName, hybridRunbookWorkerGroupName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Update", nil, "Failure preparing request") return @@ -321,11 +320,11 @@ func (client HybridRunbookWorkerGroupClient) Update(ctx context.Context, resourc } // UpdatePreparer prepares the Update request. -func (client HybridRunbookWorkerGroupClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string, parameters HybridRunbookWorkerGroupUpdateParameters) (*http.Request, error) { +func (client HybridRunbookWorkerGroupClient) UpdatePreparer(ctx context.Context, automationAccountName string, hybridRunbookWorkerGroupName string, parameters HybridRunbookWorkerGroupUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "hybridRunbookWorkerGroupName": autorest.Encode("path", hybridRunbookWorkerGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -335,7 +334,7 @@ func (client HybridRunbookWorkerGroupClient) UpdatePreparer(ctx context.Context, } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsJSON(), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}", pathParameters), 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 72cd180f957b..44412bbe7c52 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 @@ -32,30 +32,30 @@ type JobClient struct { } // NewJobClient creates an instance of the JobClient client. -func NewJobClient(subscriptionID string) JobClient { - return NewJobClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewJobClient(subscriptionID string, resourceGroupName string) JobClient { + return NewJobClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) } // NewJobClientWithBaseURI creates an instance of the JobClient client. -func NewJobClientWithBaseURI(baseURI string, subscriptionID string) JobClient { - return JobClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewJobClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) JobClient { + return JobClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} } // Create create a job of the runbook. // -// resourceGroupName is the resource group name. 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, resourceGroupName string, automationAccountName string, jobID uuid.UUID, parameters JobCreateParameters) (result Job, err error) { +// 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: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: client.ResourceGroupName, + Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {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.NewError("automation.JobClient", "Create", err.Error()) + return result, validation.NewErrorWithValidationError(err, "automation.JobClient", "Create") } - req, err := client.CreatePreparer(ctx, resourceGroupName, automationAccountName, jobID, parameters) + req, err := client.CreatePreparer(ctx, automationAccountName, jobID, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.JobClient", "Create", nil, "Failure preparing request") return @@ -77,11 +77,11 @@ func (client JobClient) Create(ctx context.Context, resourceGroupName string, au } // CreatePreparer prepares the Create request. -func (client JobClient) CreatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID, parameters JobCreateParameters) (*http.Request, error) { +func (client JobClient) CreatePreparer(ctx context.Context, automationAccountName string, jobID uuid.UUID, parameters JobCreateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "jobId": autorest.Encode("path", jobID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -91,7 +91,7 @@ func (client JobClient) CreatePreparer(ctx context.Context, resourceGroupName st } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsJSON(), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}", pathParameters), @@ -122,16 +122,15 @@ func (client JobClient) CreateResponder(resp *http.Response) (result Job, err er // Get retrieve the job identified by job id. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. jobID is the -// job id. -func (client JobClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (result Job, err error) { +// automationAccountName is the automation account name. jobID is the job id. +func (client JobClient) Get(ctx context.Context, automationAccountName string, jobID uuid.UUID) (result Job, 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.NewError("automation.JobClient", "Get", err.Error()) + {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") } - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, jobID) + req, err := client.GetPreparer(ctx, automationAccountName, jobID) if err != nil { err = autorest.NewErrorWithError(err, "automation.JobClient", "Get", nil, "Failure preparing request") return @@ -153,11 +152,11 @@ func (client JobClient) Get(ctx context.Context, resourceGroupName string, autom } // GetPreparer prepares the Get request. -func (client JobClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (*http.Request, error) { +func (client JobClient) GetPreparer(ctx context.Context, automationAccountName string, jobID uuid.UUID) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "jobId": autorest.Encode("path", jobID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -196,16 +195,15 @@ func (client JobClient) GetResponder(resp *http.Response) (result Job, err error // GetOutput retrieve the job output identified by job id. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. jobID is the -// job id. -func (client JobClient) GetOutput(ctx context.Context, resourceGroupName string, automationAccountName string, jobID string) (result ReadCloser, err error) { +// automationAccountName is the automation account name. jobID is the job id. +func (client JobClient) GetOutput(ctx context.Context, automationAccountName string, jobID string) (result ReadCloser, 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.NewError("automation.JobClient", "GetOutput", err.Error()) + {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") } - req, err := client.GetOutputPreparer(ctx, resourceGroupName, automationAccountName, jobID) + req, err := client.GetOutputPreparer(ctx, automationAccountName, jobID) if err != nil { err = autorest.NewErrorWithError(err, "automation.JobClient", "GetOutput", nil, "Failure preparing request") return @@ -227,11 +225,11 @@ func (client JobClient) GetOutput(ctx context.Context, resourceGroupName string, } // GetOutputPreparer prepares the GetOutput request. -func (client JobClient) GetOutputPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobID string) (*http.Request, error) { +func (client JobClient) GetOutputPreparer(ctx context.Context, automationAccountName string, jobID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "jobId": autorest.Encode("path", jobID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -269,16 +267,15 @@ func (client JobClient) GetOutputResponder(resp *http.Response) (result ReadClos // GetRunbookContent retrieve the runbook content of the job identified by job id. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. jobID is the -// job id. -func (client JobClient) GetRunbookContent(ctx context.Context, resourceGroupName string, automationAccountName string, jobID string) (result ReadCloser, err error) { +// automationAccountName is the automation account name. jobID is the job id. +func (client JobClient) GetRunbookContent(ctx context.Context, automationAccountName string, jobID string) (result ReadCloser, 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.NewError("automation.JobClient", "GetRunbookContent", err.Error()) + {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") } - req, err := client.GetRunbookContentPreparer(ctx, resourceGroupName, automationAccountName, jobID) + req, err := client.GetRunbookContentPreparer(ctx, automationAccountName, jobID) if err != nil { err = autorest.NewErrorWithError(err, "automation.JobClient", "GetRunbookContent", nil, "Failure preparing request") return @@ -300,11 +297,11 @@ func (client JobClient) GetRunbookContent(ctx context.Context, resourceGroupName } // GetRunbookContentPreparer prepares the GetRunbookContent request. -func (client JobClient) GetRunbookContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobID string) (*http.Request, error) { +func (client JobClient) GetRunbookContentPreparer(ctx context.Context, automationAccountName string, jobID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "jobId": autorest.Encode("path", jobID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -342,17 +339,16 @@ func (client JobClient) GetRunbookContentResponder(resp *http.Response) (result // ListByAutomationAccount retrieve a list of jobs. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. filter is -// the filter to apply on the operation. -func (client JobClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result JobListResultPage, err error) { +// automationAccountName is the automation account name. filter is the filter to apply on the operation. +func (client JobClient) ListByAutomationAccount(ctx context.Context, automationAccountName string, filter string) (result JobListResultPage, 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.NewError("automation.JobClient", "ListByAutomationAccount", err.Error()) + {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") } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) + req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName, filter) if err != nil { err = autorest.NewErrorWithError(err, "automation.JobClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -374,10 +370,10 @@ func (client JobClient) ListByAutomationAccount(ctx context.Context, resourceGro } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client JobClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { +func (client JobClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -439,23 +435,22 @@ func (client JobClient) listByAutomationAccountNextResults(lastResults JobListRe } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result JobListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) +func (client JobClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string, filter string) (result JobListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, automationAccountName, filter) return } // Resume resume the job identified by jobId. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. jobID is the -// job id. -func (client JobClient) Resume(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (result autorest.Response, err error) { +// automationAccountName is the automation account name. jobID is the job id. +func (client JobClient) Resume(ctx context.Context, automationAccountName string, jobID uuid.UUID) (result autorest.Response, 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.NewError("automation.JobClient", "Resume", err.Error()) + {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") } - req, err := client.ResumePreparer(ctx, resourceGroupName, automationAccountName, jobID) + req, err := client.ResumePreparer(ctx, automationAccountName, jobID) if err != nil { err = autorest.NewErrorWithError(err, "automation.JobClient", "Resume", nil, "Failure preparing request") return @@ -477,11 +472,11 @@ func (client JobClient) Resume(ctx context.Context, resourceGroupName string, au } // ResumePreparer prepares the Resume request. -func (client JobClient) ResumePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (*http.Request, error) { +func (client JobClient) ResumePreparer(ctx context.Context, automationAccountName string, jobID uuid.UUID) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "jobId": autorest.Encode("path", jobID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -519,16 +514,15 @@ func (client JobClient) ResumeResponder(resp *http.Response) (result autorest.Re // Stop stop the job identified by jobId. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. jobID is the -// job id. -func (client JobClient) Stop(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (result autorest.Response, err error) { +// automationAccountName is the automation account name. jobID is the job id. +func (client JobClient) Stop(ctx context.Context, automationAccountName string, jobID uuid.UUID) (result autorest.Response, 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.NewError("automation.JobClient", "Stop", err.Error()) + {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") } - req, err := client.StopPreparer(ctx, resourceGroupName, automationAccountName, jobID) + req, err := client.StopPreparer(ctx, automationAccountName, jobID) if err != nil { err = autorest.NewErrorWithError(err, "automation.JobClient", "Stop", nil, "Failure preparing request") return @@ -550,11 +544,11 @@ func (client JobClient) Stop(ctx context.Context, resourceGroupName string, auto } // StopPreparer prepares the Stop request. -func (client JobClient) StopPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (*http.Request, error) { +func (client JobClient) StopPreparer(ctx context.Context, automationAccountName string, jobID uuid.UUID) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "jobId": autorest.Encode("path", jobID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -592,16 +586,15 @@ func (client JobClient) StopResponder(resp *http.Response) (result autorest.Resp // Suspend suspend the job identified by jobId. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. jobID is the -// job id. -func (client JobClient) Suspend(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (result autorest.Response, err error) { +// automationAccountName is the automation account name. jobID is the job id. +func (client JobClient) Suspend(ctx context.Context, automationAccountName string, jobID uuid.UUID) (result autorest.Response, 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.NewError("automation.JobClient", "Suspend", err.Error()) + {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") } - req, err := client.SuspendPreparer(ctx, resourceGroupName, automationAccountName, jobID) + req, err := client.SuspendPreparer(ctx, automationAccountName, jobID) if err != nil { err = autorest.NewErrorWithError(err, "automation.JobClient", "Suspend", nil, "Failure preparing request") return @@ -623,11 +616,11 @@ func (client JobClient) Suspend(ctx context.Context, resourceGroupName string, a } // SuspendPreparer prepares the Suspend request. -func (client JobClient) SuspendPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (*http.Request, error) { +func (client JobClient) SuspendPreparer(ctx context.Context, automationAccountName string, jobID uuid.UUID) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "jobId": autorest.Encode("path", jobID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } 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 fdcd16cb4515..e1302e5b16bc 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 @@ -32,33 +32,32 @@ type JobScheduleClient struct { } // NewJobScheduleClient creates an instance of the JobScheduleClient client. -func NewJobScheduleClient(subscriptionID string) JobScheduleClient { - return NewJobScheduleClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewJobScheduleClient(subscriptionID string, resourceGroupName string) JobScheduleClient { + return NewJobScheduleClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) } // NewJobScheduleClientWithBaseURI creates an instance of the JobScheduleClient client. -func NewJobScheduleClientWithBaseURI(baseURI string, subscriptionID string) JobScheduleClient { - return JobScheduleClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewJobScheduleClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) JobScheduleClient { + return JobScheduleClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} } // Create create a job schedule. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// jobScheduleID is the job schedule name. parameters is the parameters supplied to the create job schedule -// operation. -func (client JobScheduleClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID, parameters JobScheduleCreateParameters) (result JobSchedule, err error) { +// automationAccountName is the automation account name. jobScheduleID is the job schedule name. parameters is the +// parameters supplied to the create job schedule operation. +func (client JobScheduleClient) Create(ctx context.Context, automationAccountName string, jobScheduleID uuid.UUID, parameters JobScheduleCreateParameters) (result JobSchedule, err error) { if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: client.ResourceGroupName, + Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.JobScheduleCreateProperties", Name: validation.Null, Rule: true, 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.NewError("automation.JobScheduleClient", "Create", err.Error()) + return result, validation.NewErrorWithValidationError(err, "automation.JobScheduleClient", "Create") } - req, err := client.CreatePreparer(ctx, resourceGroupName, automationAccountName, jobScheduleID, parameters) + req, err := client.CreatePreparer(ctx, automationAccountName, jobScheduleID, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Create", nil, "Failure preparing request") return @@ -80,11 +79,11 @@ func (client JobScheduleClient) Create(ctx context.Context, resourceGroupName st } // CreatePreparer prepares the Create request. -func (client JobScheduleClient) CreatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID, parameters JobScheduleCreateParameters) (*http.Request, error) { +func (client JobScheduleClient) CreatePreparer(ctx context.Context, automationAccountName string, jobScheduleID uuid.UUID, parameters JobScheduleCreateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "jobScheduleId": autorest.Encode("path", jobScheduleID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -94,7 +93,7 @@ func (client JobScheduleClient) CreatePreparer(ctx context.Context, resourceGrou } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsJSON(), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}", pathParameters), @@ -125,16 +124,15 @@ func (client JobScheduleClient) CreateResponder(resp *http.Response) (result Job // Delete delete the job schedule identified by job schedule name. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// jobScheduleID is the job schedule name. -func (client JobScheduleClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID) (result autorest.Response, err error) { +// automationAccountName is the automation account name. jobScheduleID is the job schedule name. +func (client JobScheduleClient) Delete(ctx context.Context, automationAccountName string, jobScheduleID uuid.UUID) (result autorest.Response, 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.NewError("automation.JobScheduleClient", "Delete", err.Error()) + {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") } - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, jobScheduleID) + req, err := client.DeletePreparer(ctx, automationAccountName, jobScheduleID) if err != nil { err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Delete", nil, "Failure preparing request") return @@ -156,11 +154,11 @@ func (client JobScheduleClient) Delete(ctx context.Context, resourceGroupName st } // DeletePreparer prepares the Delete request. -func (client JobScheduleClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID) (*http.Request, error) { +func (client JobScheduleClient) DeletePreparer(ctx context.Context, automationAccountName string, jobScheduleID uuid.UUID) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "jobScheduleId": autorest.Encode("path", jobScheduleID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -198,16 +196,15 @@ func (client JobScheduleClient) DeleteResponder(resp *http.Response) (result aut // Get retrieve the job schedule identified by job schedule name. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -// jobScheduleID is the job schedule name. -func (client JobScheduleClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID) (result JobSchedule, err error) { +// automationAccountName is the automation account name. jobScheduleID is the job schedule name. +func (client JobScheduleClient) Get(ctx context.Context, automationAccountName string, jobScheduleID uuid.UUID) (result JobSchedule, 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.NewError("automation.JobScheduleClient", "Get", err.Error()) + {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") } - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, jobScheduleID) + req, err := client.GetPreparer(ctx, automationAccountName, jobScheduleID) if err != nil { err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Get", nil, "Failure preparing request") return @@ -229,11 +226,11 @@ func (client JobScheduleClient) Get(ctx context.Context, resourceGroupName strin } // GetPreparer prepares the Get request. -func (client JobScheduleClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID) (*http.Request, error) { +func (client JobScheduleClient) GetPreparer(ctx context.Context, automationAccountName string, jobScheduleID uuid.UUID) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "jobScheduleId": autorest.Encode("path", jobScheduleID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -272,16 +269,16 @@ func (client JobScheduleClient) GetResponder(resp *http.Response) (result JobSch // ListByAutomationAccount retrieve a list of job schedules. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -func (client JobScheduleClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result JobScheduleListResultPage, err error) { +// automationAccountName is the automation account name. +func (client JobScheduleClient) ListByAutomationAccount(ctx context.Context, automationAccountName string) (result JobScheduleListResultPage, 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.NewError("automation.JobScheduleClient", "ListByAutomationAccount", err.Error()) + {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") } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName) if err != nil { err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -303,10 +300,10 @@ func (client JobScheduleClient) ListByAutomationAccount(ctx context.Context, res } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client JobScheduleClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { +func (client JobScheduleClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -365,7 +362,7 @@ func (client JobScheduleClient) listByAutomationAccountNextResults(lastResults J } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobScheduleClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result JobScheduleListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) +func (client JobScheduleClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string) (result JobScheduleListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, automationAccountName) return } 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 71d0b27fbbe3..16755555fd33 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 @@ -31,27 +31,26 @@ type JobStreamClient struct { } // NewJobStreamClient creates an instance of the JobStreamClient client. -func NewJobStreamClient(subscriptionID string) JobStreamClient { - return NewJobStreamClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewJobStreamClient(subscriptionID string, resourceGroupName string) JobStreamClient { + return NewJobStreamClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) } // NewJobStreamClientWithBaseURI creates an instance of the JobStreamClient client. -func NewJobStreamClientWithBaseURI(baseURI string, subscriptionID string) JobStreamClient { - return JobStreamClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewJobStreamClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) JobStreamClient { + return JobStreamClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} } // Get retrieve the job stream identified by job stream id. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. jobID is the -// job id. jobStreamID is the job stream id. -func (client JobStreamClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, jobID string, jobStreamID string) (result JobStream, err error) { +// automationAccountName is the automation account name. jobID is the job id. jobStreamID is the job stream id. +func (client JobStreamClient) Get(ctx context.Context, automationAccountName string, jobID string, jobStreamID string) (result JobStream, 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.NewError("automation.JobStreamClient", "Get", err.Error()) + {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") } - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, jobID, jobStreamID) + req, err := client.GetPreparer(ctx, automationAccountName, jobID, jobStreamID) if err != nil { err = autorest.NewErrorWithError(err, "automation.JobStreamClient", "Get", nil, "Failure preparing request") return @@ -73,12 +72,12 @@ func (client JobStreamClient) Get(ctx context.Context, resourceGroupName string, } // GetPreparer prepares the Get request. -func (client JobStreamClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobID string, jobStreamID string) (*http.Request, error) { +func (client JobStreamClient) GetPreparer(ctx context.Context, automationAccountName string, jobID string, jobStreamID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "jobId": autorest.Encode("path", jobID), "jobStreamId": autorest.Encode("path", jobStreamID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -117,17 +116,17 @@ func (client JobStreamClient) GetResponder(resp *http.Response) (result JobStrea // ListByJob retrieve a list of jobs streams identified by job id. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. jobID is the -// job Id. filter is the filter to apply on the operation. -func (client JobStreamClient) ListByJob(ctx context.Context, resourceGroupName string, automationAccountName string, jobID string, filter string) (result JobStreamListResultPage, err error) { +// automationAccountName is the automation account name. jobID is the job Id. filter is the filter to apply on the +// operation. +func (client JobStreamClient) ListByJob(ctx context.Context, automationAccountName string, jobID string, filter string) (result JobStreamListResultPage, 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.NewError("automation.JobStreamClient", "ListByJob", err.Error()) + {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") } result.fn = client.listByJobNextResults - req, err := client.ListByJobPreparer(ctx, resourceGroupName, automationAccountName, jobID, filter) + req, err := client.ListByJobPreparer(ctx, automationAccountName, jobID, filter) if err != nil { err = autorest.NewErrorWithError(err, "automation.JobStreamClient", "ListByJob", nil, "Failure preparing request") return @@ -149,11 +148,11 @@ func (client JobStreamClient) ListByJob(ctx context.Context, resourceGroupName s } // ListByJobPreparer prepares the ListByJob request. -func (client JobStreamClient) ListByJobPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobID string, filter string) (*http.Request, error) { +func (client JobStreamClient) ListByJobPreparer(ctx context.Context, automationAccountName string, jobID string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "jobId": autorest.Encode("path", jobID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -215,7 +214,7 @@ func (client JobStreamClient) listByJobNextResults(lastResults JobStreamListResu } // ListByJobComplete enumerates all values, automatically crossing page boundaries as required. -func (client JobStreamClient) ListByJobComplete(ctx context.Context, resourceGroupName string, automationAccountName string, jobID string, filter string) (result JobStreamListResultIterator, err error) { - result.page, err = client.ListByJob(ctx, resourceGroupName, automationAccountName, jobID, filter) +func (client JobStreamClient) ListByJobComplete(ctx context.Context, automationAccountName string, jobID string, filter string) (result JobStreamListResultIterator, err error) { + result.page, err = client.ListByJob(ctx, automationAccountName, jobID, filter) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/keys.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/keys.go deleted file mode 100644 index 88018fecd17a..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/keys.go +++ /dev/null @@ -1,113 +0,0 @@ -package automation - -// 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" -) - -// KeysClient is the automation Client -type KeysClient struct { - BaseClient -} - -// NewKeysClient creates an instance of the KeysClient client. -func NewKeysClient(subscriptionID string, resourceGroupName string) KeysClient { - return NewKeysClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) -} - -// NewKeysClientWithBaseURI creates an instance of the KeysClient client. -func NewKeysClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) KeysClient { - return KeysClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} -} - -// ListByAutomationAccount retrieve the automation keys for an account. -// -// automationAccountName is the automation account name. -func (client KeysClient) ListByAutomationAccount(ctx context.Context, automationAccountName string) (result KeyListResult, 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.NewError("automation.KeysClient", "ListByAutomationAccount", err.Error()) - } - - req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.KeysClient", "ListByAutomationAccount", nil, "Failure preparing request") - return - } - - resp, err := client.ListByAutomationAccountSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.KeysClient", "ListByAutomationAccount", resp, "Failure sending request") - return - } - - result, err = client.ListByAutomationAccountResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.KeysClient", "ListByAutomationAccount", resp, "Failure responding to request") - } - - return -} - -// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client KeysClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2015-10-31" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/listKeys", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the -// http.Response Body if it receives an error. -func (client KeysClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always -// closes the http.Response Body. -func (client KeysClient) ListByAutomationAccountResponder(resp *http.Response) (result KeyListResult, 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/automation/mgmt/2015-10-31/automation/linkedworkspace.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/linkedworkspace.go deleted file mode 100644 index 07bd7f664551..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/linkedworkspace.go +++ /dev/null @@ -1,113 +0,0 @@ -package automation - -// 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" -) - -// LinkedWorkspaceClient is the automation Client -type LinkedWorkspaceClient struct { - BaseClient -} - -// NewLinkedWorkspaceClient creates an instance of the LinkedWorkspaceClient client. -func NewLinkedWorkspaceClient(subscriptionID string) LinkedWorkspaceClient { - return NewLinkedWorkspaceClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewLinkedWorkspaceClientWithBaseURI creates an instance of the LinkedWorkspaceClient client. -func NewLinkedWorkspaceClientWithBaseURI(baseURI string, subscriptionID string) LinkedWorkspaceClient { - return LinkedWorkspaceClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get retrieve the linked workspace for the account id. -// -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -func (client LinkedWorkspaceClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string) (result LinkedWorkspace, 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.NewError("automation.LinkedWorkspaceClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.LinkedWorkspaceClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.LinkedWorkspaceClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.LinkedWorkspaceClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client LinkedWorkspaceClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2015-10-31" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/linkedWorkspace", 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 LinkedWorkspaceClient) 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 LinkedWorkspaceClient) GetResponder(resp *http.Response) (result LinkedWorkspace, 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/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 240df47a9a14..d38eb8bb6bdd 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 @@ -40,26 +40,16 @@ const ( Unavailable AccountState = "Unavailable" ) -// PossibleAccountStateValues returns an array of possible values for the AccountState const type. -func PossibleAccountStateValues() []AccountState { - return []AccountState{Ok, Suspended, Unavailable} -} - // AgentRegistrationKeyName enumerates the values for agent registration key name. type AgentRegistrationKeyName string const ( // Primary ... - Primary AgentRegistrationKeyName = "primary" + Primary AgentRegistrationKeyName = "Primary" // Secondary ... - Secondary AgentRegistrationKeyName = "secondary" + Secondary AgentRegistrationKeyName = "Secondary" ) -// PossibleAgentRegistrationKeyNameValues returns an array of possible values for the AgentRegistrationKeyName const type. -func PossibleAgentRegistrationKeyNameValues() []AgentRegistrationKeyName { - return []AgentRegistrationKeyName{Primary, Secondary} -} - // ContentSourceType enumerates the values for content source type. type ContentSourceType string @@ -70,11 +60,6 @@ const ( URI ContentSourceType = "uri" ) -// PossibleContentSourceTypeValues returns an array of possible values for the ContentSourceType const type. -func PossibleContentSourceTypeValues() []ContentSourceType { - return []ContentSourceType{EmbeddedContent, URI} -} - // DscConfigurationProvisioningState enumerates the values for dsc configuration provisioning state. type DscConfigurationProvisioningState string @@ -83,11 +68,6 @@ const ( Succeeded DscConfigurationProvisioningState = "Succeeded" ) -// PossibleDscConfigurationProvisioningStateValues returns an array of possible values for the DscConfigurationProvisioningState const type. -func PossibleDscConfigurationProvisioningStateValues() []DscConfigurationProvisioningState { - return []DscConfigurationProvisioningState{Succeeded} -} - // DscConfigurationState enumerates the values for dsc configuration state. type DscConfigurationState string @@ -100,11 +80,6 @@ const ( DscConfigurationStatePublished DscConfigurationState = "Published" ) -// PossibleDscConfigurationStateValues returns an array of possible values for the DscConfigurationState const type. -func PossibleDscConfigurationStateValues() []DscConfigurationState { - return []DscConfigurationState{DscConfigurationStateEdit, DscConfigurationStateNew, DscConfigurationStatePublished} -} - // HTTPStatusCode enumerates the values for http status code. type HTTPStatusCode string @@ -205,30 +180,6 @@ const ( UseProxy HTTPStatusCode = "UseProxy" ) -// PossibleHTTPStatusCodeValues returns an array of possible values for the HTTPStatusCode const type. -func PossibleHTTPStatusCodeValues() []HTTPStatusCode { - return []HTTPStatusCode{Accepted, Ambiguous, BadGateway, BadRequest, Conflict, Continue, Created, ExpectationFailed, Forbidden, Found, GatewayTimeout, Gone, HTTPVersionNotSupported, InternalServerError, LengthRequired, MethodNotAllowed, Moved, MovedPermanently, MultipleChoices, NoContent, NonAuthoritativeInformation, NotAcceptable, NotFound, NotImplemented, NotModified, OK, PartialContent, PaymentRequired, PreconditionFailed, ProxyAuthenticationRequired, Redirect, RedirectKeepVerb, RedirectMethod, RequestedRangeNotSatisfiable, RequestEntityTooLarge, RequestTimeout, RequestURITooLong, ResetContent, SeeOther, ServiceUnavailable, SwitchingProtocols, TemporaryRedirect, Unauthorized, UnsupportedMediaType, Unused, UpgradeRequired, UseProxy} -} - -// JobProvisioningState enumerates the values for job provisioning state. -type JobProvisioningState string - -const ( - // JobProvisioningStateFailed ... - JobProvisioningStateFailed JobProvisioningState = "Failed" - // JobProvisioningStateProcessing ... - JobProvisioningStateProcessing JobProvisioningState = "Processing" - // JobProvisioningStateSucceeded ... - JobProvisioningStateSucceeded JobProvisioningState = "Succeeded" - // JobProvisioningStateSuspended ... - JobProvisioningStateSuspended JobProvisioningState = "Suspended" -) - -// PossibleJobProvisioningStateValues returns an array of possible values for the JobProvisioningState const type. -func PossibleJobProvisioningStateValues() []JobProvisioningState { - return []JobProvisioningState{JobProvisioningStateFailed, JobProvisioningStateProcessing, JobProvisioningStateSucceeded, JobProvisioningStateSuspended} -} - // JobStatus enumerates the values for job status. type JobStatus string @@ -261,11 +212,6 @@ const ( JobStatusSuspending JobStatus = "Suspending" ) -// PossibleJobStatusValues returns an array of possible values for the JobStatus const type. -func PossibleJobStatusValues() []JobStatus { - return []JobStatus{JobStatusActivating, JobStatusBlocked, JobStatusCompleted, JobStatusDisconnected, JobStatusFailed, JobStatusNew, JobStatusRemoving, JobStatusResuming, JobStatusRunning, JobStatusStopped, JobStatusStopping, JobStatusSuspended, JobStatusSuspending} -} - // JobStreamType enumerates the values for job stream type. type JobStreamType string @@ -286,39 +232,6 @@ const ( Warning JobStreamType = "Warning" ) -// PossibleJobStreamTypeValues returns an array of possible values for the JobStreamType const type. -func PossibleJobStreamTypeValues() []JobStreamType { - return []JobStreamType{Any, Debug, Error, Output, Progress, Verbose, Warning} -} - -// KeyName enumerates the values for key name. -type KeyName string - -const ( - // KeyNamePrimary ... - KeyNamePrimary KeyName = "primary" - // KeyNameSecondary ... - KeyNameSecondary KeyName = "secondary" -) - -// PossibleKeyNameValues returns an array of possible values for the KeyName const type. -func PossibleKeyNameValues() []KeyName { - return []KeyName{KeyNamePrimary, KeyNameSecondary} -} - -// KeyPermissions enumerates the values for key permissions. -type KeyPermissions string - -const ( - // Full ... - Full KeyPermissions = "Full" -) - -// PossibleKeyPermissionsValues returns an array of possible values for the KeyPermissions const type. -func PossibleKeyPermissionsValues() []KeyPermissions { - return []KeyPermissions{Full} -} - // ModuleProvisioningState enumerates the values for module provisioning state. type ModuleProvisioningState string @@ -357,11 +270,6 @@ const ( ModuleProvisioningStateUpdating ModuleProvisioningState = "Updating" ) -// PossibleModuleProvisioningStateValues returns an array of possible values for the ModuleProvisioningState const type. -func PossibleModuleProvisioningStateValues() []ModuleProvisioningState { - return []ModuleProvisioningState{ModuleProvisioningStateActivitiesStored, ModuleProvisioningStateCancelled, ModuleProvisioningStateConnectionTypeImported, ModuleProvisioningStateContentDownloaded, ModuleProvisioningStateContentRetrieved, ModuleProvisioningStateContentStored, ModuleProvisioningStateContentValidated, ModuleProvisioningStateCreated, ModuleProvisioningStateCreating, ModuleProvisioningStateFailed, ModuleProvisioningStateModuleDataStored, ModuleProvisioningStateModuleImportRunbookComplete, ModuleProvisioningStateRunningImportModuleRunbook, ModuleProvisioningStateStartingImportModuleRunbook, ModuleProvisioningStateSucceeded, ModuleProvisioningStateUpdating} -} - // RunbookProvisioningState enumerates the values for runbook provisioning state. type RunbookProvisioningState string @@ -370,11 +278,6 @@ const ( RunbookProvisioningStateSucceeded RunbookProvisioningState = "Succeeded" ) -// PossibleRunbookProvisioningStateValues returns an array of possible values for the RunbookProvisioningState const type. -func PossibleRunbookProvisioningStateValues() []RunbookProvisioningState { - return []RunbookProvisioningState{RunbookProvisioningStateSucceeded} -} - // RunbookState enumerates the values for runbook state. type RunbookState string @@ -387,11 +290,6 @@ const ( RunbookStatePublished RunbookState = "Published" ) -// PossibleRunbookStateValues returns an array of possible values for the RunbookState const type. -func PossibleRunbookStateValues() []RunbookState { - return []RunbookState{RunbookStateEdit, RunbookStateNew, RunbookStatePublished} -} - // RunbookTypeEnum enumerates the values for runbook type enum. type RunbookTypeEnum string @@ -410,11 +308,6 @@ const ( Script RunbookTypeEnum = "Script" ) -// PossibleRunbookTypeEnumValues returns an array of possible values for the RunbookTypeEnum const type. -func PossibleRunbookTypeEnumValues() []RunbookTypeEnum { - return []RunbookTypeEnum{Graph, GraphPowerShell, GraphPowerShellWorkflow, PowerShell, PowerShellWorkflow, Script} -} - // ScheduleDay enumerates the values for schedule day. type ScheduleDay string @@ -435,11 +328,6 @@ const ( Wednesday ScheduleDay = "Wednesday" ) -// PossibleScheduleDayValues returns an array of possible values for the ScheduleDay const type. -func PossibleScheduleDayValues() []ScheduleDay { - return []ScheduleDay{Friday, Monday, Saturday, Sunday, Thursday, Tuesday, Wednesday} -} - // ScheduleFrequency enumerates the values for schedule frequency. type ScheduleFrequency string @@ -456,11 +344,6 @@ const ( Week ScheduleFrequency = "Week" ) -// PossibleScheduleFrequencyValues returns an array of possible values for the ScheduleFrequency const type. -func PossibleScheduleFrequencyValues() []ScheduleFrequency { - return []ScheduleFrequency{Day, Hour, Month, OneTime, Week} -} - // SkuNameEnum enumerates the values for sku name enum. type SkuNameEnum string @@ -471,18 +354,9 @@ const ( Free SkuNameEnum = "Free" ) -// PossibleSkuNameEnumValues returns an array of possible values for the SkuNameEnum const type. -func PossibleSkuNameEnumValues() []SkuNameEnum { - return []SkuNameEnum{Basic, Free} -} - // 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 @@ -492,109 +366,90 @@ type Account struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - Tags map[string]*string `json:"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"` } -// 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 - } - if a.Etag != nil { - objectMap["etag"] = a.Etag +// 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 } - if a.ID != nil { - objectMap["id"] = a.ID + 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.Name != nil { - objectMap["name"] = a.Name + + 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.Type != nil { - objectMap["type"] = a.Type + + 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.Location != nil { - objectMap["location"] = a.Location + + 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.Tags != nil { - objectMap["tags"] = a.Tags + + v = m["type"] + if v != nil { + var typeVar string + err = json.Unmarshal(*m["type"], &typeVar) + if err != nil { + return err + } + a.Type = &typeVar } - 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 + v = m["location"] + if v != nil { + var location string + err = json.Unmarshal(*m["location"], &location) + if err != nil { + return err + } + a.Location = &location } - 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 - } + + v = m["tags"] + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*m["tags"], &tags) + if err != nil { + return err } + a.Tags = &tags } return nil @@ -609,25 +464,7 @@ 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"` -} - -// 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) + Tags *map[string]*string `json:"tags,omitempty"` } // UnmarshalJSON is the custom unmarshaler for AccountCreateOrUpdateParameters struct. @@ -637,45 +474,46 @@ func (acoup *AccountCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { 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 - } + 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 } + acoup.Tags = &tags } return nil @@ -814,25 +652,7 @@ 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"` -} - -// 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) + Tags *map[string]*string `json:"tags,omitempty"` } // UnmarshalJSON is the custom unmarshaler for AccountUpdateParameters struct. @@ -842,45 +662,46 @@ func (aup *AccountUpdateParameters) UnmarshalJSON(body []byte) error { 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 - } + 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 } + aup.Tags = &tags } return nil @@ -903,21 +724,6 @@ type Activity struct { *ActivityProperties `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for Activity. -func (a Activity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if a.ID != nil { - objectMap["id"] = a.ID - } - if a.Name != nil { - objectMap["name"] = a.Name - } - if a.ActivityProperties != nil { - objectMap["properties"] = a.ActivityProperties - } - return json.Marshal(objectMap) -} - // UnmarshalJSON is the custom unmarshaler for Activity struct. func (a *Activity) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -925,36 +731,36 @@ func (a *Activity) UnmarshalJSON(body []byte) error { 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 - } + 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 } + a.ActivityProperties = &properties } return nil @@ -1155,32 +961,14 @@ type AgentRegistrationKeys struct { // AgentRegistrationRegenerateKeyParameter the parameters supplied to the regenerate keys operation. type AgentRegistrationRegenerateKeyParameter struct { - // KeyName - Gets or sets the agent registration key name - primary or secondary. Possible values include: 'Primary', 'Secondary' + // KeyName - Gets or sets the agent registration key name - Primary or Secondary. Possible values include: 'Primary', 'Secondary' KeyName AgentRegistrationKeyName `json:"keyName,omitempty"` // Name - Gets or sets the name of the resource. Name *string `json:"name,omitempty"` // 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"` -} - -// MarshalJSON is the custom marshaler for AgentRegistrationRegenerateKeyParameter. -func (arrkp AgentRegistrationRegenerateKeyParameter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if arrkp.KeyName != "" { - 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) + Tags *map[string]*string `json:"tags,omitempty"` } // Certificate definition of the certificate. @@ -1190,30 +978,10 @@ 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"` } -// MarshalJSON is the custom marshaler for Certificate. -func (c Certificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if c.ID != nil { - objectMap["id"] = c.ID - } - if c.Name != nil { - objectMap["name"] = c.Name - } - if c.Type != nil { - objectMap["type"] = c.Type - } - if c.CertificateProperties != nil { - objectMap["properties"] = c.CertificateProperties - } - return json.Marshal(objectMap) -} - // UnmarshalJSON is the custom unmarshaler for Certificate struct. func (c *Certificate) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -1221,45 +989,36 @@ func (c *Certificate) UnmarshalJSON(body []byte) error { 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 - } + 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 } + c.CertificateProperties = &properties } return nil @@ -1274,18 +1033,6 @@ type CertificateCreateOrUpdateParameters struct { *CertificateCreateOrUpdateProperties `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for CertificateCreateOrUpdateParameters. -func (ccoup CertificateCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ccoup.Name != nil { - objectMap["name"] = ccoup.Name - } - if ccoup.CertificateCreateOrUpdateProperties != nil { - objectMap["properties"] = ccoup.CertificateCreateOrUpdateProperties - } - return json.Marshal(objectMap) -} - // UnmarshalJSON is the custom unmarshaler for CertificateCreateOrUpdateParameters struct. func (ccoup *CertificateCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -1293,27 +1040,26 @@ func (ccoup *CertificateCreateOrUpdateParameters) UnmarshalJSON(body []byte) err 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 - } + 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 } + ccoup.CertificateCreateOrUpdateProperties = &properties } return nil @@ -1457,18 +1203,6 @@ type CertificateUpdateParameters struct { *CertificateUpdateProperties `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for CertificateUpdateParameters. -func (cup CertificateUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cup.Name != nil { - objectMap["name"] = cup.Name - } - if cup.CertificateUpdateProperties != nil { - objectMap["properties"] = cup.CertificateUpdateProperties - } - return json.Marshal(objectMap) -} - // UnmarshalJSON is the custom unmarshaler for CertificateUpdateParameters struct. func (cup *CertificateUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -1476,27 +1210,26 @@ func (cup *CertificateUpdateParameters) UnmarshalJSON(body []byte) error { 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 - } + 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 } + cup.CertificateUpdateProperties = &properties } return nil @@ -1515,30 +1248,10 @@ 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"` } -// MarshalJSON is the custom marshaler for Connection. -func (c Connection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if c.ID != nil { - objectMap["id"] = c.ID - } - if c.Name != nil { - objectMap["name"] = c.Name - } - if c.Type != nil { - objectMap["type"] = c.Type - } - if c.ConnectionProperties != nil { - objectMap["properties"] = c.ConnectionProperties - } - return json.Marshal(objectMap) -} - // UnmarshalJSON is the custom unmarshaler for Connection struct. func (c *Connection) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -1546,45 +1259,36 @@ func (c *Connection) UnmarshalJSON(body []byte) error { 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 - } + 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 } + c.ConnectionProperties = &properties } return nil @@ -1598,18 +1302,6 @@ type ConnectionCreateOrUpdateParameters struct { *ConnectionCreateOrUpdateProperties `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for ConnectionCreateOrUpdateParameters. -func (ccoup ConnectionCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ccoup.Name != nil { - objectMap["name"] = ccoup.Name - } - if ccoup.ConnectionCreateOrUpdateProperties != nil { - objectMap["properties"] = ccoup.ConnectionCreateOrUpdateProperties - } - return json.Marshal(objectMap) -} - // UnmarshalJSON is the custom unmarshaler for ConnectionCreateOrUpdateParameters struct. func (ccoup *ConnectionCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -1617,27 +1309,26 @@ func (ccoup *ConnectionCreateOrUpdateParameters) UnmarshalJSON(body []byte) erro 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 - } + 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 } + ccoup.ConnectionCreateOrUpdateProperties = &properties } return nil @@ -1650,22 +1341,7 @@ 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"` -} - -// 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) + FieldDefinitionValues *map[string]*string `json:"fieldDefinitionValues,omitempty"` } // ConnectionListResult the response model for the list connection operation. @@ -1775,7 +1451,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"` + FieldDefinitionValues *map[string]*string `json:"fieldDefinitionValues,omitempty"` // CreationTime - Gets the creation time. CreationTime *date.Time `json:"creationTime,omitempty"` // LastModifiedTime - Gets the last modified time. @@ -1784,27 +1460,6 @@ 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:"-"` @@ -1812,30 +1467,10 @@ 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"` } -// MarshalJSON is the custom marshaler for ConnectionType. -func (ct ConnectionType) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ct.ID != nil { - objectMap["id"] = ct.ID - } - if ct.Name != nil { - objectMap["name"] = ct.Name - } - if ct.Type != nil { - objectMap["type"] = ct.Type - } - if ct.ConnectionTypeProperties != nil { - objectMap["properties"] = ct.ConnectionTypeProperties - } - return json.Marshal(objectMap) -} - // UnmarshalJSON is the custom unmarshaler for ConnectionType struct. func (ct *ConnectionType) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -1843,45 +1478,36 @@ func (ct *ConnectionType) UnmarshalJSON(body []byte) error { 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 - } + 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 } + ct.ConnectionTypeProperties = &properties } return nil @@ -1893,8 +1519,7 @@ 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"` @@ -1902,18 +1527,6 @@ type ConnectionTypeCreateOrUpdateParameters struct { *ConnectionTypeCreateOrUpdateProperties `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for ConnectionTypeCreateOrUpdateParameters. -func (ctcoup ConnectionTypeCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ctcoup.Name != nil { - objectMap["name"] = ctcoup.Name - } - if ctcoup.ConnectionTypeCreateOrUpdateProperties != nil { - objectMap["properties"] = ctcoup.ConnectionTypeCreateOrUpdateProperties - } - return json.Marshal(objectMap) -} - // UnmarshalJSON is the custom unmarshaler for ConnectionTypeCreateOrUpdateParameters struct. func (ctcoup *ConnectionTypeCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -1921,50 +1534,37 @@ func (ctcoup *ConnectionTypeCreateOrUpdateParameters) UnmarshalJSON(body []byte) 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 - } + 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 } - return nil -} - + v = m["properties"] + if v != nil { + var properties ConnectionTypeCreateOrUpdateProperties + err = json.Unmarshal(*m["properties"], &properties) + if err != nil { + return err + } + ctcoup.ConnectionTypeCreateOrUpdateProperties = &properties + } + + return nil +} + // ConnectionTypeCreateOrUpdateProperties the properties of the create connection type. 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"` -} - -// 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) + FieldDefinitions *map[string]*FieldDefinition `json:"fieldDefinitions,omitempty"` } // ConnectionTypeListResult the response model for the list connection type operation. @@ -2074,7 +1674,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"` + FieldDefinitions *map[string]*FieldDefinition `json:"fieldDefinitions,omitempty"` // CreationTime - Gets the creation time. CreationTime *date.Time `json:"creationTime,omitempty"` // LastModifiedTime - Gets or sets the last modified time. @@ -2083,27 +1683,6 @@ 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. @@ -2112,18 +1691,6 @@ type ConnectionUpdateParameters struct { *ConnectionUpdateProperties `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for ConnectionUpdateParameters. -func (cup ConnectionUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cup.Name != nil { - objectMap["name"] = cup.Name - } - if cup.ConnectionUpdateProperties != nil { - objectMap["properties"] = cup.ConnectionUpdateProperties - } - return json.Marshal(objectMap) -} - // UnmarshalJSON is the custom unmarshaler for ConnectionUpdateParameters struct. func (cup *ConnectionUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -2131,27 +1698,26 @@ func (cup *ConnectionUpdateParameters) UnmarshalJSON(body []byte) error { 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 - } + 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 } + cup.ConnectionUpdateProperties = &properties } return nil @@ -2162,19 +1728,7 @@ 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"` -} - -// 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) + FieldDefinitionValues *map[string]*string `json:"fieldDefinitionValues,omitempty"` } // ContentHash definition of the runbook property type. @@ -2214,30 +1768,10 @@ 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"` } -// MarshalJSON is the custom marshaler for Credential. -func (c Credential) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if c.ID != nil { - objectMap["id"] = c.ID - } - if c.Name != nil { - objectMap["name"] = c.Name - } - if c.Type != nil { - objectMap["type"] = c.Type - } - if c.CredentialProperties != nil { - objectMap["properties"] = c.CredentialProperties - } - return json.Marshal(objectMap) -} - // UnmarshalJSON is the custom unmarshaler for Credential struct. func (c *Credential) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -2245,45 +1779,36 @@ func (c *Credential) UnmarshalJSON(body []byte) error { 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 - } + 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 } + c.CredentialProperties = &properties } return nil @@ -2297,18 +1822,6 @@ type CredentialCreateOrUpdateParameters struct { *CredentialCreateOrUpdateProperties `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for CredentialCreateOrUpdateParameters. -func (ccoup CredentialCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ccoup.Name != nil { - objectMap["name"] = ccoup.Name - } - if ccoup.CredentialCreateOrUpdateProperties != nil { - objectMap["properties"] = ccoup.CredentialCreateOrUpdateProperties - } - return json.Marshal(objectMap) -} - // UnmarshalJSON is the custom unmarshaler for CredentialCreateOrUpdateParameters struct. func (ccoup *CredentialCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -2316,27 +1829,26 @@ func (ccoup *CredentialCreateOrUpdateParameters) UnmarshalJSON(body []byte) erro 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 - } + 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 } + ccoup.CredentialCreateOrUpdateProperties = &properties } return nil @@ -2474,18 +1986,6 @@ type CredentialUpdateParameters struct { *CredentialUpdateProperties `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for CredentialUpdateParameters. -func (cup CredentialUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cup.Name != nil { - objectMap["name"] = cup.Name - } - if cup.CredentialUpdateProperties != nil { - objectMap["properties"] = cup.CredentialUpdateProperties - } - return json.Marshal(objectMap) -} - // UnmarshalJSON is the custom unmarshaler for CredentialUpdateParameters struct. func (cup *CredentialUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -2493,27 +1993,26 @@ func (cup *CredentialUpdateParameters) UnmarshalJSON(body []byte) error { 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 - } + 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 } + cup.CredentialUpdateProperties = &properties } return nil @@ -2532,32 +2031,10 @@ type CredentialUpdateProperties struct { // DscCompilationJob definition of the Dsc Compilation job. type DscCompilationJob struct { autorest.Response `json:"-"` + // ID - Gets the id of the resource. + ID *string `json:"id,omitempty"` // DscCompilationJobProperties - Gets or sets the properties of the Dsc Compilation job. *DscCompilationJobProperties `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"` -} - -// MarshalJSON is the custom marshaler for DscCompilationJob. -func (dcj DscCompilationJob) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dcj.DscCompilationJobProperties != nil { - objectMap["properties"] = dcj.DscCompilationJobProperties - } - if dcj.ID != nil { - objectMap["id"] = dcj.ID - } - if dcj.Name != nil { - objectMap["name"] = dcj.Name - } - if dcj.Type != nil { - objectMap["type"] = dcj.Type - } - return json.Marshal(objectMap) } // UnmarshalJSON is the custom unmarshaler for DscCompilationJob struct. @@ -2567,45 +2044,26 @@ func (dcj *DscCompilationJob) UnmarshalJSON(body []byte) error { if err != nil { return err } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var dscCompilationJobProperties DscCompilationJobProperties - err = json.Unmarshal(*v, &dscCompilationJobProperties) - if err != nil { - return err - } - dcj.DscCompilationJobProperties = &dscCompilationJobProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - dcj.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dcj.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dcj.Type = &typeVar - } + 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 } + dcj.DscCompilationJobProperties = &properties } return nil @@ -2620,25 +2078,7 @@ 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"` -} - -// 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) + Tags *map[string]*string `json:"tags,omitempty"` } // UnmarshalJSON is the custom unmarshaler for DscCompilationJobCreateParameters struct. @@ -2648,45 +2088,46 @@ func (dcjcp *DscCompilationJobCreateParameters) UnmarshalJSON(body []byte) error 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 - } + 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 } + dcjcp.Tags = &tags } return nil @@ -2697,26 +2138,11 @@ 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"` + Parameters *map[string]*string `json:"parameters,omitempty"` // 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:"-"` @@ -2829,10 +2255,6 @@ type DscCompilationJobProperties struct { JobID *uuid.UUID `json:"jobId,omitempty"` // CreationTime - Gets the creation time of the job. CreationTime *date.Time `json:"creationTime,omitempty"` - // ProvisioningState - The current provisioning state of the job. - ProvisioningState *JobProvisioningStateProperty `json:"provisioningState,omitempty"` - // RunOn - Gets or sets the runOn which specifies the group name where the job is to be executed. - RunOn *string `json:"runOn,omitempty"` // Status - Gets or sets the status of the job. Possible values include: 'JobStatusNew', 'JobStatusActivating', 'JobStatusRunning', 'JobStatusCompleted', 'JobStatusFailed', 'JobStatusStopped', 'JobStatusBlocked', 'JobStatusSuspended', 'JobStatusDisconnected', 'JobStatusSuspending', 'JobStatusStopping', 'JobStatusResuming', 'JobStatusRemoving' Status JobStatus `json:"status,omitempty"` // StatusDetails - Gets or sets the status details of the job. @@ -2848,64 +2270,12 @@ 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"` -} - -// 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 - } - if dcjp.ProvisioningState != nil { - objectMap["provisioningState"] = dcjp.ProvisioningState - } - if dcjp.RunOn != nil { - objectMap["runOn"] = dcjp.RunOn - } - if dcjp.Status != "" { - 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) + Parameters *map[string]*string `json:"parameters,omitempty"` } // 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 @@ -2915,109 +2285,90 @@ type DscConfiguration struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - Tags map[string]*string `json:"tags"` + Tags *map[string]*string `json:"tags,omitempty"` + // 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"` } -// 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 - } - if dc.Etag != nil { - objectMap["etag"] = dc.Etag +// 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 } - if dc.ID != nil { - objectMap["id"] = dc.ID + 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.Name != nil { - objectMap["name"] = dc.Name + + 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.Type != nil { - objectMap["type"] = dc.Type + + 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.Location != nil { - objectMap["location"] = dc.Location + + 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.Tags != nil { - objectMap["tags"] = dc.Tags + + v = m["type"] + if v != nil { + var typeVar string + err = json.Unmarshal(*m["type"], &typeVar) + if err != nil { + return err + } + dc.Type = &typeVar } - return json.Marshal(objectMap) -} -// 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 + v = m["location"] + if v != nil { + var location string + err = json.Unmarshal(*m["location"], &location) + if err != nil { + return err + } + dc.Location = &location } - 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 - } + + v = m["tags"] + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*m["tags"], &tags) + if err != nil { + return err } + dc.Tags = &tags } return nil @@ -3029,8 +2380,7 @@ 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"` @@ -3039,25 +2389,7 @@ 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"` -} - -// 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) + Tags *map[string]*string `json:"tags,omitempty"` } // UnmarshalJSON is the custom unmarshaler for DscConfigurationCreateOrUpdateParameters struct. @@ -3067,45 +2399,46 @@ func (dccoup *DscConfigurationCreateOrUpdateParameters) UnmarshalJSON(body []byt 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 - } + 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 } + dccoup.Tags = &tags } return nil @@ -3120,32 +2453,11 @@ 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"` + Parameters *map[string]*DscConfigurationParameter `json:"parameters,omitempty"` // 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:"-"` @@ -3267,7 +2579,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"` + Parameters *map[string]*DscConfigurationParameter `json:"parameters,omitempty"` // 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' @@ -3282,106 +2594,6 @@ 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{}) - if dcp.ProvisioningState != "" { - 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 - } - if dcp.State != "" { - 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) -} - -// DscConfigurationUpdateParameters the parameters supplied to the create or update configuration operation. -type DscConfigurationUpdateParameters struct { - // DscConfigurationCreateOrUpdateProperties - Gets or sets configuration create or update properties. - *DscConfigurationCreateOrUpdateProperties `json:"properties,omitempty"` - // Name - Gets or sets name of the resource. - Name *string `json:"name,omitempty"` - // Tags - Gets or sets the tags attached to the resource. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for DscConfigurationUpdateParameters. -func (dcup DscConfigurationUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dcup.DscConfigurationCreateOrUpdateProperties != nil { - objectMap["properties"] = dcup.DscConfigurationCreateOrUpdateProperties - } - if dcup.Name != nil { - objectMap["name"] = dcup.Name - } - if dcup.Tags != nil { - objectMap["tags"] = dcup.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DscConfigurationUpdateParameters struct. -func (dcup *DscConfigurationUpdateParameters) 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 dscConfigurationCreateOrUpdateProperties DscConfigurationCreateOrUpdateProperties - err = json.Unmarshal(*v, &dscConfigurationCreateOrUpdateProperties) - if err != nil { - return err - } - dcup.DscConfigurationCreateOrUpdateProperties = &dscConfigurationCreateOrUpdateProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dcup.Name = &name - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - dcup.Tags = tags - } - } - } - - return nil -} - // DscMetaConfiguration definition of the DSC Meta Configuration. type DscMetaConfiguration struct { // ConfigurationModeFrequencyMins - Gets or sets the ConfigurationModeFrequencyMins value of the meta configuration. @@ -3403,6 +2615,16 @@ 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. @@ -3421,29 +2643,21 @@ 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"` } // DscNodeConfiguration definition of the dsc node configuration. type DscNodeConfiguration struct { autorest.Response `json:"-"` + // Name - Gets or sets the node configuration name. + Name *string `json:"name,omitempty"` // LastModifiedTime - Gets or sets the last modified time. LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` // CreationTime - Gets or sets creation time. CreationTime *date.Time `json:"creationTime,omitempty"` // Configuration - Gets or sets the configuration of the node. Configuration *DscConfigurationAssociationProperty `json:"configuration,omitempty"` - // ID - Resource Id + // ID - Gets or sets the id of the resource. ID *string `json:"id,omitempty"` - // Name - Resource name - Name *string `json:"name,omitempty"` - // Type - Resource type - Type *string `json:"type,omitempty"` } // DscNodeConfigurationAssociationProperty the dsc nodeconfiguration property associated with the entity. @@ -4029,24 +3243,12 @@ type HybridRunbookWorkerGroupUpdateParameters struct { // Job definition of the job. type Job struct { autorest.Response `json:"-"` - // ID - Id of the resource. + // ID - Gets or sets the id of the resource. ID *string `json:"id,omitempty"` - // JobProperties - The properties of the job. + // JobProperties - Gets or sets the properties of the job. *JobProperties `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for Job. -func (j Job) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if j.ID != nil { - objectMap["id"] = j.ID - } - if j.JobProperties != nil { - objectMap["properties"] = j.JobProperties - } - return json.Marshal(objectMap) -} - // UnmarshalJSON is the custom unmarshaler for Job struct. func (j *Job) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -4054,27 +3256,26 @@ func (j *Job) UnmarshalJSON(body []byte) error { 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 - } + 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 } + j.JobProperties = &properties } return nil @@ -4084,15 +3285,12 @@ func (j *Job) UnmarshalJSON(body []byte) error { type JobCreateParameters struct { // JobCreateProperties - Gets or sets the list of job properties. *JobCreateProperties `json:"properties,omitempty"` -} - -// 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 - } - return json.Marshal(objectMap) + // Name - Gets or sets name of the resource. + Name *string `json:"name,omitempty"` + // 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"` } // UnmarshalJSON is the custom unmarshaler for JobCreateParameters struct. @@ -4102,18 +3300,46 @@ func (jcp *JobCreateParameters) UnmarshalJSON(body []byte) error { 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 - } + 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 } + jcp.Tags = &tags } return nil @@ -4124,26 +3350,11 @@ 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"` + Parameters *map[string]*string `json:"parameters,omitempty"` // 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:"-"` @@ -4273,96 +3484,18 @@ 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"` - // ProvisioningState - The provisioning state of a resource. - ProvisioningState *JobProvisioningStateProperty `json:"provisioningState,omitempty"` -} - -// 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 - } - if jp.Status != "" { - 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 - } - if jp.ProvisioningState != nil { - objectMap["provisioningState"] = jp.ProvisioningState - } - return json.Marshal(objectMap) -} - -// JobProvisioningStateProperty the provisioning state property. -type JobProvisioningStateProperty struct { - // ProvisioningState - The provisioning state of the resource. Possible values include: 'JobProvisioningStateFailed', 'JobProvisioningStateSucceeded', 'JobProvisioningStateSuspended', 'JobProvisioningStateProcessing' - ProvisioningState JobProvisioningState `json:"provisioningState,omitempty"` + Parameters *map[string]*string `json:"parameters,omitempty"` } // JobSchedule definition of the job schedule. type JobSchedule struct { autorest.Response `json:"-"` - // ID - Gets the id of the resource. + // ID - Gets or sets 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"` } -// MarshalJSON is the custom marshaler for JobSchedule. -func (js JobSchedule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if js.ID != nil { - objectMap["id"] = js.ID - } - if js.Name != nil { - objectMap["name"] = js.Name - } - if js.Type != nil { - objectMap["type"] = js.Type - } - if js.JobScheduleProperties != nil { - objectMap["properties"] = js.JobScheduleProperties - } - return json.Marshal(objectMap) -} - // UnmarshalJSON is the custom unmarshaler for JobSchedule struct. func (js *JobSchedule) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -4370,45 +3503,26 @@ func (js *JobSchedule) UnmarshalJSON(body []byte) error { 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 - } + 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 } + js.JobScheduleProperties = &properties } return nil @@ -4420,15 +3534,6 @@ type JobScheduleCreateParameters struct { *JobScheduleCreateProperties `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for JobScheduleCreateParameters. -func (jscp JobScheduleCreateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if jscp.JobScheduleCreateProperties != nil { - objectMap["properties"] = jscp.JobScheduleCreateProperties - } - return json.Marshal(objectMap) -} - // UnmarshalJSON is the custom unmarshaler for JobScheduleCreateParameters struct. func (jscp *JobScheduleCreateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -4436,18 +3541,16 @@ func (jscp *JobScheduleCreateParameters) UnmarshalJSON(body []byte) error { 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 - } + var v *json.RawMessage + + v = m["properties"] + if v != nil { + var properties JobScheduleCreateProperties + err = json.Unmarshal(*m["properties"], &properties) + if err != nil { + return err } + jscp.JobScheduleCreateProperties = &properties } return nil @@ -4462,25 +3565,7 @@ 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"` -} - -// 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) + Parameters *map[string]*string `json:"parameters,omitempty"` } // JobScheduleListResult the response model for the list job schedule operation. @@ -4596,28 +3681,7 @@ 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"` -} - -// 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) + Parameters *map[string]*string `json:"parameters,omitempty"` } // JobStream definition of the job stream. @@ -4629,18 +3693,6 @@ type JobStream struct { *JobStreamProperties `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for JobStream. -func (js JobStream) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if js.ID != nil { - objectMap["id"] = js.ID - } - if js.JobStreamProperties != nil { - objectMap["properties"] = js.JobStreamProperties - } - return json.Marshal(objectMap) -} - // UnmarshalJSON is the custom unmarshaler for JobStream struct. func (js *JobStream) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -4648,27 +3700,26 @@ func (js *JobStream) UnmarshalJSON(body []byte) error { 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 - } + 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 } + js.JobStreamProperties = &properties } return nil @@ -4789,64 +3840,12 @@ 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]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 - } - if jsp.StreamType != "" { - 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) -} - -// Key automation key which is used to register a DSC Node -type Key struct { - // KeyName - Automation key name. Possible values include: 'KeyNamePrimary', 'KeyNameSecondary' - KeyName KeyName `json:"keyName,omitempty"` - // Permissions - Automation key permissions. Possible values include: 'Full' - Permissions KeyPermissions `json:"permissions,omitempty"` - // Value - Value of the Automation Key used for registration. - Value *string `json:"value,omitempty"` -} - -// KeyListResult ... -type KeyListResult struct { - autorest.Response `json:"-"` - // Value - Lists the automation keys. - Value *[]Key `json:"value,omitempty"` -} - -// LinkedWorkspace definition of the linked workspace. -type LinkedWorkspace struct { - autorest.Response `json:"-"` - // ID - Gets the id of the linked workspace. - ID *string `json:"id,omitempty"` + Value *map[string]*map[string]interface{} `json:"value,omitempty"` } // 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 @@ -4856,109 +3855,90 @@ type Module struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - Tags map[string]*string `json:"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"` } -// 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 - } - if mVar.Etag != nil { - objectMap["etag"] = mVar.Etag +// 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 } - if mVar.ID != nil { - objectMap["id"] = mVar.ID + 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.Name != nil { - objectMap["name"] = mVar.Name + + 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.Type != nil { - objectMap["type"] = mVar.Type + + 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.Location != nil { - objectMap["location"] = mVar.Location + + 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.Tags != nil { - objectMap["tags"] = mVar.Tags + + v = m["type"] + if v != nil { + var typeVar string + err = json.Unmarshal(*m["type"], &typeVar) + if err != nil { + return err + } + mVar.Type = &typeVar } - return json.Marshal(objectMap) -} -// 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 + v = m["location"] + if v != nil { + var location string + err = json.Unmarshal(*m["location"], &location) + if err != nil { + return err + } + mVar.Location = &location } - 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 - } + + v = m["tags"] + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*m["tags"], &tags) + if err != nil { + return err } + mVar.Tags = &tags } return nil @@ -4973,25 +3953,7 @@ 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"` -} - -// 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) + Tags *map[string]*string `json:"tags,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ModuleCreateOrUpdateParameters struct. @@ -5001,45 +3963,46 @@ func (mcoup *ModuleCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { 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 - } + 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 } + mcoup.Tags = &tags } return nil @@ -5194,25 +4157,7 @@ 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"` -} - -// 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) + Tags *map[string]*string `json:"tags,omitempty"` } // UnmarshalJSON is the custom unmarshaler for ModuleUpdateParameters struct. @@ -5222,45 +4167,46 @@ func (mup *ModuleUpdateParameters) UnmarshalJSON(body []byte) error { 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 - } + var v *json.RawMessage + + v = m["properties"] + if v != nil { + var properties ModuleUpdateProperties + err = json.Unmarshal(*m["properties"], &properties) + if err != nil { + return err + } + 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 @@ -5297,16 +4243,6 @@ type OperationListResult struct { Value *[]Operation `json:"value,omitempty"` } -// ProxyResource the Resource definition. -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"` -} - // ReadCloser ... type ReadCloser struct { autorest.Response `json:"-"` @@ -5324,28 +4260,7 @@ type Resource struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - 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) + Tags *map[string]*string `json:"tags,omitempty"` } // RunAsCredentialAssociationProperty definition of runas credential to use for hybrid worker. @@ -5357,10 +4272,6 @@ 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 @@ -5370,109 +4281,90 @@ type Runbook struct { // Location - Resource location Location *string `json:"location,omitempty"` // Tags - Resource tags - Tags map[string]*string `json:"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"` } -// 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 - } - if r.Etag != nil { - objectMap["etag"] = r.Etag +// 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 } - if r.ID != nil { - objectMap["id"] = r.ID + 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.Name != nil { - objectMap["name"] = r.Name + + 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.Type != nil { - objectMap["type"] = r.Type + + 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.Location != nil { - objectMap["location"] = r.Location + + 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.Tags != nil { - objectMap["tags"] = r.Tags + + v = m["type"] + if v != nil { + var typeVar string + err = json.Unmarshal(*m["type"], &typeVar) + if err != nil { + return err + } + r.Type = &typeVar } - return json.Marshal(objectMap) -} -// 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 + v = m["location"] + if v != nil { + var location string + err = json.Unmarshal(*m["location"], &location) + if err != nil { + return err + } + r.Location = &location } - 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 - } + + v = m["tags"] + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*m["tags"], &tags) + if err != nil { + return err } + r.Tags = &tags } return nil @@ -5515,25 +4407,7 @@ 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"` -} - -// 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) + Tags *map[string]*string `json:"tags,omitempty"` } // UnmarshalJSON is the custom unmarshaler for RunbookCreateOrUpdateParameters struct. @@ -5543,45 +4417,46 @@ func (rcoup *RunbookCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { 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 - } + 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 + } + 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 @@ -5617,129 +4492,71 @@ 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"` + Parameters *map[string]*RunbookParameter `json:"parameters,omitempty"` // 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) -} - -// RunbookDraftPublishFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type RunbookDraftPublishFuture struct { +// RunbookDraftCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type RunbookDraftCreateOrUpdateFuture 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 RunbookDraftPublishFuture) Result(client RunbookDraftClient) (ar autorest.Response, err error) { +func (future RunbookDraftCreateOrUpdateFuture) Result(client RunbookDraftClient) (ar autorest.Response, err error) { 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 ar, azure.NewAsyncOpIncompleteError("automation.RunbookDraftPublishFuture") + return ar, autorest.NewError("automation.RunbookDraftCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") } if future.PollingMethod() == azure.PollingLocation { - ar, err = client.PublishResponder(future.Response()) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftPublishFuture", "Result", future.Response(), "Failure responding to request") - } + ar, err = client.CreateOrUpdateResponder(future.Response()) 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, + resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftPublishFuture", "Result", resp, "Failure sending request") return } - ar, err = client.PublishResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftPublishFuture", "Result", resp, "Failure responding to request") - } + ar, err = client.CreateOrUpdateResponder(resp) return } -// RunbookDraftReplaceContentFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type RunbookDraftReplaceContentFuture struct { +// RunbookDraftPublishFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type RunbookDraftPublishFuture 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 RunbookDraftReplaceContentFuture) Result(client RunbookDraftClient) (ar autorest.Response, err error) { +func (future RunbookDraftPublishFuture) Result(client RunbookDraftClient) (r Runbook, err error) { var done bool done, err = future.Done(client) if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftReplaceContentFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, azure.NewAsyncOpIncompleteError("automation.RunbookDraftReplaceContentFuture") + return r, autorest.NewError("automation.RunbookDraftPublishFuture", "Result", "asynchronous operation has not completed") } if future.PollingMethod() == azure.PollingLocation { - ar, err = client.ReplaceContentResponder(future.Response()) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftReplaceContentFuture", "Result", future.Response(), "Failure responding to request") - } + r, err = client.PublishResponder(future.Response()) 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, + resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftReplaceContentFuture", "Result", resp, "Failure sending request") return } - ar, err = client.ReplaceContentResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftReplaceContentFuture", "Result", resp, "Failure responding to request") - } + r, err = client.PublishResponder(resp) return } @@ -5882,7 +4699,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"` + Parameters *map[string]*RunbookParameter `json:"parameters,omitempty"` // OutputTypes - Gets or sets the runbook output types. OutputTypes *[]string `json:"outputTypes,omitempty"` // Draft - Gets or sets the draft runbook properties. @@ -5899,57 +4716,6 @@ 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{}) - if rp.RunbookType != "" { - objectMap["runbookType"] = rp.RunbookType - } - if rp.PublishContentLink != nil { - objectMap["publishContentLink"] = rp.PublishContentLink - } - if rp.State != "" { - 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 - } - if rp.ProvisioningState != "" { - 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. @@ -5959,25 +4725,7 @@ 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"` -} - -// 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) + Tags *map[string]*string `json:"tags,omitempty"` } // UnmarshalJSON is the custom unmarshaler for RunbookUpdateParameters struct. @@ -5987,45 +4735,46 @@ func (rup *RunbookUpdateParameters) UnmarshalJSON(body []byte) error { 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 - } + 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 } + rup.Tags = &tags } return nil @@ -6046,34 +4795,14 @@ type RunbookUpdateProperties struct { // Schedule definition of the schedule. type Schedule struct { autorest.Response `json:"-"` - // ID - Gets the id of the resource. + // ID - Gets or sets the id of the resource. ID *string `json:"id,omitempty"` - // Name - Gets name of the schedule. + // Name - Gets or sets the 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"` } -// MarshalJSON is the custom marshaler for Schedule. -func (s Schedule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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.ScheduleProperties != nil { - objectMap["properties"] = s.ScheduleProperties - } - return json.Marshal(objectMap) -} - // UnmarshalJSON is the custom unmarshaler for Schedule struct. func (s *Schedule) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -6081,45 +4810,36 @@ func (s *Schedule) UnmarshalJSON(body []byte) error { 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 - } + var v *json.RawMessage + + 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 + } + 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 @@ -6139,18 +4859,6 @@ type ScheduleCreateOrUpdateParameters struct { *ScheduleCreateOrUpdateProperties `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for ScheduleCreateOrUpdateParameters. -func (scoup ScheduleCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if scoup.Name != nil { - objectMap["name"] = scoup.Name - } - if scoup.ScheduleCreateOrUpdateProperties != nil { - objectMap["properties"] = scoup.ScheduleCreateOrUpdateProperties - } - return json.Marshal(objectMap) -} - // UnmarshalJSON is the custom unmarshaler for ScheduleCreateOrUpdateParameters struct. func (scoup *ScheduleCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -6158,27 +4866,26 @@ func (scoup *ScheduleCreateOrUpdateParameters) UnmarshalJSON(body []byte) error 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 - } + var v *json.RawMessage + + v = m["name"] + if v != nil { + var name string + err = json.Unmarshal(*m["name"], &name) + if err != nil { + return err + } + 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 @@ -6193,7 +4900,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 interface{} `json:"interval,omitempty"` + Interval *map[string]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. @@ -6321,7 +5028,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 interface{} `json:"interval,omitempty"` + Interval *map[string]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. @@ -6344,18 +5051,6 @@ type ScheduleUpdateParameters struct { *ScheduleUpdateProperties `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for ScheduleUpdateParameters. -func (sup ScheduleUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sup.Name != nil { - objectMap["name"] = sup.Name - } - if sup.ScheduleUpdateProperties != nil { - objectMap["properties"] = sup.ScheduleUpdateProperties - } - return json.Marshal(objectMap) -} - // UnmarshalJSON is the custom unmarshaler for ScheduleUpdateParameters struct. func (sup *ScheduleUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -6363,27 +5058,26 @@ func (sup *ScheduleUpdateParameters) UnmarshalJSON(body []byte) error { 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 - } + 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 } + sup.ScheduleUpdateProperties = &properties } return nil @@ -6397,12 +5091,6 @@ type ScheduleUpdateProperties struct { IsEnabled *bool `json:"isEnabled,omitempty"` } -// SetObject ... -type SetObject struct { - autorest.Response `json:"-"` - Value interface{} `json:"value,omitempty"` -} - // Sku the account SKU. type Sku struct { // Name - Gets or sets the SKU name of the account. Possible values include: 'Free', 'Basic' @@ -6468,70 +5156,19 @@ 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"` - // LogActivityTrace - The activity-level tracing options of the runbook. - LogActivityTrace *int32 `json:"logActivityTrace,omitempty"` -} - -// 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 - } - if tj.LogActivityTrace != nil { - objectMap["logActivityTrace"] = tj.LogActivityTrace - } - return json.Marshal(objectMap) + Parameters *map[string]*string `json:"parameters,omitempty"` } // TestJobCreateParameters the parameters supplied to the create test job operation. 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"` + Parameters *map[string]*string `json:"parameters,omitempty"` // 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.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. @@ -6581,34 +5218,14 @@ type UsageListResult struct { // Variable definition of the varible. type Variable struct { autorest.Response `json:"-"` - // ID - Gets the id of the resource. + // ID - Gets or sets the id of the resource. ID *string `json:"id,omitempty"` - // Name - Gets the name of the variable. + // Name - Gets or sets 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"` } -// MarshalJSON is the custom marshaler for Variable. -func (vVar Variable) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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.VariableProperties != nil { - objectMap["properties"] = vVar.VariableProperties - } - return json.Marshal(objectMap) -} - // UnmarshalJSON is the custom unmarshaler for Variable struct. func (vVar *Variable) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -6616,45 +5233,36 @@ func (vVar *Variable) UnmarshalJSON(body []byte) error { 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 - } + 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 } + vVar.VariableProperties = &properties } return nil @@ -6668,18 +5276,6 @@ type VariableCreateOrUpdateParameters struct { *VariableCreateOrUpdateProperties `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for VariableCreateOrUpdateParameters. -func (vcoup VariableCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vcoup.Name != nil { - objectMap["name"] = vcoup.Name - } - if vcoup.VariableCreateOrUpdateProperties != nil { - objectMap["properties"] = vcoup.VariableCreateOrUpdateProperties - } - return json.Marshal(objectMap) -} - // UnmarshalJSON is the custom unmarshaler for VariableCreateOrUpdateParameters struct. func (vcoup *VariableCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -6687,27 +5283,26 @@ func (vcoup *VariableCreateOrUpdateParameters) UnmarshalJSON(body []byte) error 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 - } + var v *json.RawMessage + + v = m["name"] + if v != nil { + var name string + err = json.Unmarshal(*m["name"], &name) + if err != nil { + return err + } + 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 @@ -6847,18 +5442,6 @@ type VariableUpdateParameters struct { *VariableUpdateProperties `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for VariableUpdateParameters. -func (vup VariableUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vup.Name != nil { - objectMap["name"] = vup.Name - } - if vup.VariableUpdateProperties != nil { - objectMap["properties"] = vup.VariableUpdateProperties - } - return json.Marshal(objectMap) -} - // UnmarshalJSON is the custom unmarshaler for VariableUpdateParameters struct. func (vup *VariableUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -6866,27 +5449,26 @@ func (vup *VariableUpdateParameters) UnmarshalJSON(body []byte) error { 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 - } + 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 } + vup.VariableUpdateProperties = &properties } return nil @@ -6903,34 +5485,14 @@ type VariableUpdateProperties struct { // Webhook definition of the webhook type. type Webhook struct { autorest.Response `json:"-"` - // ID - Gets the id of the resource. + // ID - Gets or sets the id of the resource. ID *string `json:"id,omitempty"` - // Name - Gets the name of the webhook. + // Name - Gets or sets the name of the webhook. Name *string `json:"name,omitempty"` - // Type - Gets the type of the resource. - Type *string `json:"type,omitempty"` // WebhookProperties - Gets or sets the webhook properties. *WebhookProperties `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for Webhook. -func (w Webhook) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if w.ID != nil { - objectMap["id"] = w.ID - } - if w.Name != nil { - objectMap["name"] = w.Name - } - if w.Type != nil { - objectMap["type"] = w.Type - } - if w.WebhookProperties != nil { - objectMap["properties"] = w.WebhookProperties - } - return json.Marshal(objectMap) -} - // UnmarshalJSON is the custom unmarshaler for Webhook struct. func (w *Webhook) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -6938,45 +5500,36 @@ func (w *Webhook) UnmarshalJSON(body []byte) error { 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 "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - w.Type = &typeVar - } - case "properties": - if v != nil { - var webhookProperties WebhookProperties - err = json.Unmarshal(*v, &webhookProperties) - if err != nil { - return err - } - w.WebhookProperties = &webhookProperties - } + 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 + } + 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 @@ -6990,18 +5543,6 @@ type WebhookCreateOrUpdateParameters struct { *WebhookCreateOrUpdateProperties `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for WebhookCreateOrUpdateParameters. -func (wcoup WebhookCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if wcoup.Name != nil { - objectMap["name"] = wcoup.Name - } - if wcoup.WebhookCreateOrUpdateProperties != nil { - objectMap["properties"] = wcoup.WebhookCreateOrUpdateProperties - } - return json.Marshal(objectMap) -} - // UnmarshalJSON is the custom unmarshaler for WebhookCreateOrUpdateParameters struct. func (wcoup *WebhookCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -7009,27 +5550,26 @@ func (wcoup *WebhookCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { 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 - } + var v *json.RawMessage + + v = m["name"] + if v != nil { + var name string + err = json.Unmarshal(*m["name"], &name) + if err != nil { + return err + } + 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 @@ -7044,37 +5584,13 @@ 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"` + Parameters *map[string]*string `json:"parameters,omitempty"` // 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:"-"` @@ -7188,7 +5704,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"` + Parameters *map[string]*string `json:"parameters,omitempty"` // 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. @@ -7201,42 +5717,6 @@ 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. @@ -7245,18 +5725,6 @@ type WebhookUpdateParameters struct { *WebhookUpdateProperties `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for WebhookUpdateParameters. -func (wup WebhookUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if wup.Name != nil { - objectMap["name"] = wup.Name - } - if wup.WebhookUpdateProperties != nil { - objectMap["properties"] = wup.WebhookUpdateProperties - } - 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 @@ -7264,27 +5732,26 @@ func (wup *WebhookUpdateParameters) UnmarshalJSON(body []byte) error { 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 - } + var v *json.RawMessage + + v = m["name"] + if v != nil { + var name string + err = json.Unmarshal(*m["name"], &name) + if err != nil { + return err + } + 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 @@ -7297,25 +5764,7 @@ 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"` + Parameters *map[string]*string `json:"parameters,omitempty"` // 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 929cc72ca68b..973e6295f7d3 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 @@ -31,23 +31,23 @@ type ModuleClient struct { } // NewModuleClient creates an instance of the ModuleClient client. -func NewModuleClient(subscriptionID string) ModuleClient { - return NewModuleClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewModuleClient(subscriptionID string, resourceGroupName string) ModuleClient { + return NewModuleClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) } // NewModuleClientWithBaseURI creates an instance of the ModuleClient client. -func NewModuleClientWithBaseURI(baseURI string, subscriptionID string) ModuleClient { - return ModuleClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewModuleClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) ModuleClient { + return ModuleClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} } // CreateOrUpdate create or Update the module identified by module name. // -// resourceGroupName is the resource group name. 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, resourceGroupName string, automationAccountName string, moduleName string, parameters ModuleCreateOrUpdateParameters) (result Module, err error) { +// 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: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: client.ResourceGroupName, + Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.ModuleCreateOrUpdateProperties", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.ModuleCreateOrUpdateProperties.ContentLink", Name: validation.Null, Rule: true, @@ -57,10 +57,10 @@ func (client ModuleClient) CreateOrUpdate(ctx context.Context, resourceGroupName }}, }}, }}}}}); err != nil { - return result, validation.NewError("automation.ModuleClient", "CreateOrUpdate", err.Error()) + return result, validation.NewErrorWithValidationError(err, "automation.ModuleClient", "CreateOrUpdate") } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, moduleName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, automationAccountName, moduleName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.ModuleClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -82,11 +82,11 @@ func (client ModuleClient) CreateOrUpdate(ctx context.Context, resourceGroupName } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ModuleClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, parameters ModuleCreateOrUpdateParameters) (*http.Request, error) { +func (client ModuleClient) CreateOrUpdatePreparer(ctx context.Context, automationAccountName string, moduleName string, parameters ModuleCreateOrUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "moduleName": autorest.Encode("path", moduleName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -96,7 +96,7 @@ func (client ModuleClient) CreateOrUpdatePreparer(ctx context.Context, resourceG } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsJSON(), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}", pathParameters), @@ -127,16 +127,15 @@ func (client ModuleClient) CreateOrUpdateResponder(resp *http.Response) (result // Delete delete the module by name. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. moduleName -// is the module name. -func (client ModuleClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (result autorest.Response, err error) { +// automationAccountName is the automation account name. moduleName is the module name. +func (client ModuleClient) Delete(ctx context.Context, automationAccountName string, moduleName string) (result autorest.Response, 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.NewError("automation.ModuleClient", "Delete", err.Error()) + {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") } - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, moduleName) + req, err := client.DeletePreparer(ctx, automationAccountName, moduleName) if err != nil { err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Delete", nil, "Failure preparing request") return @@ -158,11 +157,11 @@ func (client ModuleClient) Delete(ctx context.Context, resourceGroupName string, } // DeletePreparer prepares the Delete request. -func (client ModuleClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (*http.Request, error) { +func (client ModuleClient) DeletePreparer(ctx context.Context, automationAccountName string, moduleName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "moduleName": autorest.Encode("path", moduleName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -200,16 +199,15 @@ func (client ModuleClient) DeleteResponder(resp *http.Response) (result autorest // Get retrieve the module identified by module name. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. moduleName -// is the module name. -func (client ModuleClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (result Module, err error) { +// automationAccountName is the automation account name. moduleName is the module name. +func (client ModuleClient) Get(ctx context.Context, automationAccountName string, moduleName string) (result Module, 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.NewError("automation.ModuleClient", "Get", err.Error()) + {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") } - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, moduleName) + req, err := client.GetPreparer(ctx, automationAccountName, moduleName) if err != nil { err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Get", nil, "Failure preparing request") return @@ -231,11 +229,11 @@ func (client ModuleClient) Get(ctx context.Context, resourceGroupName string, au } // GetPreparer prepares the Get request. -func (client ModuleClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (*http.Request, error) { +func (client ModuleClient) GetPreparer(ctx context.Context, automationAccountName string, moduleName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "moduleName": autorest.Encode("path", moduleName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -274,16 +272,16 @@ func (client ModuleClient) GetResponder(resp *http.Response) (result Module, err // ListByAutomationAccount retrieve a list of modules. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -func (client ModuleClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result ModuleListResultPage, err error) { +// automationAccountName is the automation account name. +func (client ModuleClient) ListByAutomationAccount(ctx context.Context, automationAccountName string) (result ModuleListResultPage, 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.NewError("automation.ModuleClient", "ListByAutomationAccount", err.Error()) + {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") } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName) if err != nil { err = autorest.NewErrorWithError(err, "automation.ModuleClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -305,10 +303,10 @@ func (client ModuleClient) ListByAutomationAccount(ctx context.Context, resource } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client ModuleClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { +func (client ModuleClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -367,23 +365,23 @@ func (client ModuleClient) listByAutomationAccountNextResults(lastResults Module } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client ModuleClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result ModuleListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) +func (client ModuleClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string) (result ModuleListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, automationAccountName) return } // Update update the module identified by module name. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. moduleName -// is the name of module. parameters is the update parameters for module. -func (client ModuleClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, parameters ModuleUpdateParameters) (result Module, err error) { +// automationAccountName is the automation account name. moduleName is the name of module. parameters is the update +// parameters for module. +func (client ModuleClient) Update(ctx context.Context, automationAccountName string, moduleName string, parameters ModuleUpdateParameters) (result Module, 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.NewError("automation.ModuleClient", "Update", err.Error()) + {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") } - req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, moduleName, parameters) + req, err := client.UpdatePreparer(ctx, automationAccountName, moduleName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Update", nil, "Failure preparing request") return @@ -405,11 +403,11 @@ func (client ModuleClient) Update(ctx context.Context, resourceGroupName string, } // UpdatePreparer prepares the Update request. -func (client ModuleClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, parameters ModuleUpdateParameters) (*http.Request, error) { +func (client ModuleClient) UpdatePreparer(ctx context.Context, automationAccountName string, moduleName string, parameters ModuleUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "moduleName": autorest.Encode("path", moduleName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -419,7 +417,7 @@ func (client ModuleClient) UpdatePreparer(ctx context.Context, resourceGroupName } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsJSON(), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}", pathParameters), 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 2cdc9b7ee487..81a7521af5dc 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 @@ -31,27 +31,26 @@ type NodeReportsClient struct { } // NewNodeReportsClient creates an instance of the NodeReportsClient client. -func NewNodeReportsClient(subscriptionID string) NodeReportsClient { - return NewNodeReportsClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewNodeReportsClient(subscriptionID string, resourceGroupName string) NodeReportsClient { + return NewNodeReportsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) } // NewNodeReportsClientWithBaseURI creates an instance of the NodeReportsClient client. -func NewNodeReportsClientWithBaseURI(baseURI string, subscriptionID string) NodeReportsClient { - return NodeReportsClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewNodeReportsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) NodeReportsClient { + return NodeReportsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} } // Get retrieve the Dsc node report data by node id and report id. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. nodeID is -// the Dsc node id. reportID is the report id. -func (client NodeReportsClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, reportID string) (result DscNodeReport, err error) { +// automationAccountName is the automation account name. nodeID is the Dsc node id. reportID is the report id. +func (client NodeReportsClient) Get(ctx context.Context, automationAccountName string, nodeID string, reportID string) (result DscNodeReport, 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.NewError("automation.NodeReportsClient", "Get", err.Error()) + {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") } - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, nodeID, reportID) + req, err := client.GetPreparer(ctx, automationAccountName, nodeID, reportID) if err != nil { err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "Get", nil, "Failure preparing request") return @@ -73,12 +72,12 @@ func (client NodeReportsClient) Get(ctx context.Context, resourceGroupName strin } // GetPreparer prepares the Get request. -func (client NodeReportsClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, reportID string) (*http.Request, error) { +func (client NodeReportsClient) GetPreparer(ctx context.Context, automationAccountName string, nodeID string, reportID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "nodeId": autorest.Encode("path", nodeID), "reportId": autorest.Encode("path", reportID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -117,16 +116,15 @@ func (client NodeReportsClient) GetResponder(resp *http.Response) (result DscNod // GetContent retrieve the Dsc node reports by node id and report id. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. nodeID is -// the Dsc node id. reportID is the report id. -func (client NodeReportsClient) GetContent(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, reportID string) (result SetObject, err error) { +// automationAccountName is the automation account name. nodeID is the Dsc node id. reportID is the report id. +func (client NodeReportsClient) GetContent(ctx context.Context, automationAccountName string, nodeID string, reportID string) (result ReadCloser, 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.NewError("automation.NodeReportsClient", "GetContent", err.Error()) + {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") } - req, err := client.GetContentPreparer(ctx, resourceGroupName, automationAccountName, nodeID, reportID) + req, err := client.GetContentPreparer(ctx, automationAccountName, nodeID, reportID) if err != nil { err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "GetContent", nil, "Failure preparing request") return @@ -148,12 +146,12 @@ func (client NodeReportsClient) GetContent(ctx context.Context, resourceGroupNam } // GetContentPreparer prepares the GetContent request. -func (client NodeReportsClient) GetContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, reportID string) (*http.Request, error) { +func (client NodeReportsClient) GetContentPreparer(ctx context.Context, automationAccountName string, nodeID string, reportID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "nodeId": autorest.Encode("path", nodeID), "reportId": autorest.Encode("path", reportID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -179,30 +177,29 @@ func (client NodeReportsClient) GetContentSender(req *http.Request) (*http.Respo // GetContentResponder handles the response to the GetContent request. The method always // closes the http.Response Body. -func (client NodeReportsClient) GetContentResponder(resp *http.Response) (result SetObject, err error) { +func (client NodeReportsClient) GetContentResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) + azure.WithErrorUnlessStatusCode(http.StatusOK)) result.Response = autorest.Response{Response: resp} return } // ListByNode retrieve the Dsc node report list by node id. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. nodeID is -// the parameters supplied to the list operation. filter is the filter to apply on the operation. -func (client NodeReportsClient) ListByNode(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, filter string) (result DscNodeReportListResultPage, err error) { +// automationAccountName is the automation account name. nodeID is the parameters supplied to the list operation. +// filter is the filter to apply on the operation. +func (client NodeReportsClient) ListByNode(ctx context.Context, automationAccountName string, nodeID string, filter string) (result DscNodeReportListResultPage, 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.NewError("automation.NodeReportsClient", "ListByNode", err.Error()) + {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") } result.fn = client.listByNodeNextResults - req, err := client.ListByNodePreparer(ctx, resourceGroupName, automationAccountName, nodeID, filter) + req, err := client.ListByNodePreparer(ctx, automationAccountName, nodeID, filter) if err != nil { err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "ListByNode", nil, "Failure preparing request") return @@ -224,11 +221,11 @@ func (client NodeReportsClient) ListByNode(ctx context.Context, resourceGroupNam } // ListByNodePreparer prepares the ListByNode request. -func (client NodeReportsClient) ListByNodePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, filter string) (*http.Request, error) { +func (client NodeReportsClient) ListByNodePreparer(ctx context.Context, automationAccountName string, nodeID string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "nodeId": autorest.Encode("path", nodeID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -290,7 +287,7 @@ func (client NodeReportsClient) listByNodeNextResults(lastResults DscNodeReportL } // ListByNodeComplete enumerates all values, automatically crossing page boundaries as required. -func (client NodeReportsClient) ListByNodeComplete(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, filter string) (result DscNodeReportListResultIterator, err error) { - result.page, err = client.ListByNode(ctx, resourceGroupName, automationAccountName, nodeID, filter) +func (client NodeReportsClient) ListByNodeComplete(ctx context.Context, automationAccountName string, nodeID string, filter string) (result DscNodeReportListResultIterator, err error) { + result.page, err = client.ListByNode(ctx, automationAccountName, nodeID, filter) return } 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 80f1cb735be0..35deda6a2a13 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 @@ -31,27 +31,27 @@ type ObjectDataTypesClient struct { } // NewObjectDataTypesClient creates an instance of the ObjectDataTypesClient client. -func NewObjectDataTypesClient(subscriptionID string) ObjectDataTypesClient { - return NewObjectDataTypesClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewObjectDataTypesClient(subscriptionID string, resourceGroupName string) ObjectDataTypesClient { + return NewObjectDataTypesClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) } // NewObjectDataTypesClientWithBaseURI creates an instance of the ObjectDataTypesClient client. -func NewObjectDataTypesClientWithBaseURI(baseURI string, subscriptionID string) ObjectDataTypesClient { - return ObjectDataTypesClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewObjectDataTypesClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) ObjectDataTypesClient { + return ObjectDataTypesClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} } // ListFieldsByModuleAndType retrieve a list of fields of a given type identified by module name. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. moduleName -// is the name of module. typeName is the name of type. -func (client ObjectDataTypesClient) ListFieldsByModuleAndType(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, typeName string) (result TypeFieldListResult, err error) { +// automationAccountName is the automation account name. moduleName is the name of module. typeName is the name of +// type. +func (client ObjectDataTypesClient) ListFieldsByModuleAndType(ctx context.Context, automationAccountName string, moduleName string, typeName string) (result TypeFieldListResult, 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.NewError("automation.ObjectDataTypesClient", "ListFieldsByModuleAndType", err.Error()) + {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") } - req, err := client.ListFieldsByModuleAndTypePreparer(ctx, resourceGroupName, automationAccountName, moduleName, typeName) + req, err := client.ListFieldsByModuleAndTypePreparer(ctx, automationAccountName, moduleName, typeName) if err != nil { err = autorest.NewErrorWithError(err, "automation.ObjectDataTypesClient", "ListFieldsByModuleAndType", nil, "Failure preparing request") return @@ -73,11 +73,11 @@ func (client ObjectDataTypesClient) ListFieldsByModuleAndType(ctx context.Contex } // ListFieldsByModuleAndTypePreparer prepares the ListFieldsByModuleAndType request. -func (client ObjectDataTypesClient) ListFieldsByModuleAndTypePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, typeName string) (*http.Request, error) { +func (client ObjectDataTypesClient) ListFieldsByModuleAndTypePreparer(ctx context.Context, automationAccountName string, moduleName string, typeName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "moduleName": autorest.Encode("path", moduleName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "typeName": autorest.Encode("path", typeName), } @@ -117,16 +117,15 @@ func (client ObjectDataTypesClient) ListFieldsByModuleAndTypeResponder(resp *htt // ListFieldsByType retrieve a list of fields of a given type across all accessible modules. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. typeName is -// the name of type. -func (client ObjectDataTypesClient) ListFieldsByType(ctx context.Context, resourceGroupName string, automationAccountName string, typeName string) (result TypeFieldListResult, err error) { +// automationAccountName is the automation account name. typeName is the name of type. +func (client ObjectDataTypesClient) ListFieldsByType(ctx context.Context, automationAccountName string, typeName string) (result TypeFieldListResult, 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.NewError("automation.ObjectDataTypesClient", "ListFieldsByType", err.Error()) + {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") } - req, err := client.ListFieldsByTypePreparer(ctx, resourceGroupName, automationAccountName, typeName) + req, err := client.ListFieldsByTypePreparer(ctx, automationAccountName, typeName) if err != nil { err = autorest.NewErrorWithError(err, "automation.ObjectDataTypesClient", "ListFieldsByType", nil, "Failure preparing request") return @@ -148,10 +147,10 @@ func (client ObjectDataTypesClient) ListFieldsByType(ctx context.Context, resour } // ListFieldsByTypePreparer prepares the ListFieldsByType request. -func (client ObjectDataTypesClient) ListFieldsByTypePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, typeName string) (*http.Request, error) { +func (client ObjectDataTypesClient) ListFieldsByTypePreparer(ctx context.Context, automationAccountName string, typeName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "typeName": autorest.Encode("path", typeName), } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/operations.go index b731c2d30ea0..facdcde19b97 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/operations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/operations.go @@ -30,13 +30,13 @@ type OperationsClient struct { } // NewOperationsClient creates an instance of the OperationsClient client. -func NewOperationsClient(subscriptionID string) OperationsClient { - return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewOperationsClient(subscriptionID string, resourceGroupName string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) } // NewOperationsClientWithBaseURI creates an instance of the OperationsClient client. -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { - return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} } // List lists all of the available Automation REST API operations. 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 fc316a1d7c9a..acead52cd9d4 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 @@ -31,24 +31,23 @@ type RunbookClient struct { } // NewRunbookClient creates an instance of the RunbookClient client. -func NewRunbookClient(subscriptionID string) RunbookClient { - return NewRunbookClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewRunbookClient(subscriptionID string, resourceGroupName string) RunbookClient { + return NewRunbookClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) } // NewRunbookClientWithBaseURI creates an instance of the RunbookClient client. -func NewRunbookClientWithBaseURI(baseURI string, subscriptionID string) RunbookClient { - return RunbookClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewRunbookClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) RunbookClient { + return RunbookClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} } // CreateOrUpdate create the runbook identified by runbook name. // -// resourceGroupName is the resource group 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. -func (client RunbookClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters RunbookCreateOrUpdateParameters) (result Runbook, err error) { +// 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: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: client.ResourceGroupName, + Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties.Draft", Name: validation.Null, Rule: false, @@ -66,10 +65,10 @@ func (client RunbookClient) CreateOrUpdate(ctx context.Context, resourceGroupNam }}, }}, }}}}}); err != nil { - return result, validation.NewError("automation.RunbookClient", "CreateOrUpdate", err.Error()) + return result, validation.NewErrorWithValidationError(err, "automation.RunbookClient", "CreateOrUpdate") } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, runbookName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, automationAccountName, runbookName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.RunbookClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -77,7 +76,7 @@ func (client RunbookClient) CreateOrUpdate(ctx context.Context, resourceGroupNam resp, err := client.CreateOrUpdateSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.Response = resp err = autorest.NewErrorWithError(err, "automation.RunbookClient", "CreateOrUpdate", resp, "Failure sending request") return } @@ -91,10 +90,10 @@ func (client RunbookClient) CreateOrUpdate(ctx context.Context, resourceGroupNam } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client RunbookClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters RunbookCreateOrUpdateParameters) (*http.Request, error) { +func (client RunbookClient) CreateOrUpdatePreparer(ctx context.Context, automationAccountName string, runbookName string, parameters RunbookCreateOrUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -105,7 +104,7 @@ func (client RunbookClient) CreateOrUpdatePreparer(ctx context.Context, resource } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsJSON(), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}", pathParameters), @@ -123,29 +122,27 @@ func (client RunbookClient) CreateOrUpdateSender(req *http.Request) (*http.Respo // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. -func (client RunbookClient) CreateOrUpdateResponder(resp *http.Response) (result Runbook, err error) { +func (client RunbookClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusBadRequest), - autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} + result.Response = resp return } // Delete delete the runbook by name. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName -// is the runbook name. -func (client RunbookClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result autorest.Response, err error) { +// automationAccountName is the automation account name. runbookName is the runbook name. +func (client RunbookClient) Delete(ctx context.Context, automationAccountName string, runbookName string) (result autorest.Response, 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.NewError("automation.RunbookClient", "Delete", err.Error()) + {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") } - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, runbookName) + req, err := client.DeletePreparer(ctx, automationAccountName, runbookName) if err != nil { err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Delete", nil, "Failure preparing request") return @@ -167,10 +164,10 @@ func (client RunbookClient) Delete(ctx context.Context, resourceGroupName string } // DeletePreparer prepares the Delete request. -func (client RunbookClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { +func (client RunbookClient) DeletePreparer(ctx context.Context, automationAccountName string, runbookName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -201,7 +198,7 @@ func (client RunbookClient) DeleteResponder(resp *http.Response) (result autores err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByClosing()) result.Response = resp return @@ -209,16 +206,15 @@ func (client RunbookClient) DeleteResponder(resp *http.Response) (result autores // Get retrieve the runbook identified by runbook name. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName -// is the runbook name. -func (client RunbookClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result Runbook, err error) { +// automationAccountName is the automation account name. runbookName is the runbook name. +func (client RunbookClient) Get(ctx context.Context, automationAccountName string, runbookName string) (result Runbook, 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.NewError("automation.RunbookClient", "Get", err.Error()) + {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") } - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + req, err := client.GetPreparer(ctx, automationAccountName, runbookName) if err != nil { err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Get", nil, "Failure preparing request") return @@ -240,10 +236,10 @@ func (client RunbookClient) Get(ctx context.Context, resourceGroupName string, a } // GetPreparer prepares the Get request. -func (client RunbookClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { +func (client RunbookClient) GetPreparer(ctx context.Context, automationAccountName string, runbookName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -283,16 +279,15 @@ func (client RunbookClient) GetResponder(resp *http.Response) (result Runbook, e // GetContent retrieve the content of runbook identified by runbook name. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName -// is the runbook name. -func (client RunbookClient) GetContent(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result String, err error) { +// automationAccountName is the automation account name. runbookName is the runbook name. +func (client RunbookClient) GetContent(ctx context.Context, automationAccountName string, runbookName string) (result ReadCloser, 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.NewError("automation.RunbookClient", "GetContent", err.Error()) + {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") } - req, err := client.GetContentPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + req, err := client.GetContentPreparer(ctx, automationAccountName, runbookName) if err != nil { err = autorest.NewErrorWithError(err, "automation.RunbookClient", "GetContent", nil, "Failure preparing request") return @@ -314,10 +309,10 @@ func (client RunbookClient) GetContent(ctx context.Context, resourceGroupName st } // GetContentPreparer prepares the GetContent request. -func (client RunbookClient) GetContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { +func (client RunbookClient) GetContentPreparer(ctx context.Context, automationAccountName string, runbookName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -344,29 +339,28 @@ func (client RunbookClient) GetContentSender(req *http.Request) (*http.Response, // GetContentResponder handles the response to the GetContent request. The method always // closes the http.Response Body. -func (client RunbookClient) GetContentResponder(resp *http.Response) (result String, err error) { +func (client RunbookClient) GetContentResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) + azure.WithErrorUnlessStatusCode(http.StatusOK)) result.Response = autorest.Response{Response: resp} return } // ListByAutomationAccount retrieve a list of runbooks. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -func (client RunbookClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result RunbookListResultPage, err error) { +// automationAccountName is the automation account name. +func (client RunbookClient) ListByAutomationAccount(ctx context.Context, automationAccountName string) (result RunbookListResultPage, 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.NewError("automation.RunbookClient", "ListByAutomationAccount", err.Error()) + {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") } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName) if err != nil { err = autorest.NewErrorWithError(err, "automation.RunbookClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -388,10 +382,10 @@ func (client RunbookClient) ListByAutomationAccount(ctx context.Context, resourc } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client RunbookClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { +func (client RunbookClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -450,23 +444,23 @@ func (client RunbookClient) listByAutomationAccountNextResults(lastResults Runbo } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client RunbookClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result RunbookListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) +func (client RunbookClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string) (result RunbookListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, automationAccountName) return } // Update update the runbook identified by runbook name. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName -// is the runbook name. parameters is the update parameters for runbook. -func (client RunbookClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters RunbookUpdateParameters) (result Runbook, err error) { +// automationAccountName is the automation account name. runbookName is the runbook name. parameters is the update +// parameters for runbook. +func (client RunbookClient) Update(ctx context.Context, automationAccountName string, runbookName string, parameters RunbookUpdateParameters) (result Runbook, 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.NewError("automation.RunbookClient", "Update", err.Error()) + {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") } - req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, runbookName, parameters) + req, err := client.UpdatePreparer(ctx, automationAccountName, runbookName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Update", nil, "Failure preparing request") return @@ -488,10 +482,10 @@ func (client RunbookClient) Update(ctx context.Context, resourceGroupName string } // UpdatePreparer prepares the Update request. -func (client RunbookClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters RunbookUpdateParameters) (*http.Request, error) { +func (client RunbookClient) UpdatePreparer(ctx context.Context, automationAccountName string, runbookName string, parameters RunbookUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -502,7 +496,7 @@ func (client RunbookClient) UpdatePreparer(ctx context.Context, resourceGroupNam } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsJSON(), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}", pathParameters), 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 b1bcf9e2ef5c..d5d8163374d1 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 @@ -22,6 +22,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/validation" + "io" "net/http" ) @@ -31,52 +32,47 @@ type RunbookDraftClient struct { } // NewRunbookDraftClient creates an instance of the RunbookDraftClient client. -func NewRunbookDraftClient(subscriptionID string) RunbookDraftClient { - return NewRunbookDraftClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewRunbookDraftClient(subscriptionID string, resourceGroupName string) RunbookDraftClient { + return NewRunbookDraftClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) } // NewRunbookDraftClientWithBaseURI creates an instance of the RunbookDraftClient client. -func NewRunbookDraftClientWithBaseURI(baseURI string, subscriptionID string) RunbookDraftClient { - return RunbookDraftClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewRunbookDraftClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) RunbookDraftClient { + return RunbookDraftClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} } -// Get retrieve the runbook draft identified by runbook name. +// CreateOrUpdate updates the runbook draft with runbookStream as its content. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName -// is the runbook name. -func (client RunbookDraftClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result RunbookDraft, err 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: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.RunbookDraftClient", "Get", err.Error()) + {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") } - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + req, err := client.CreateOrUpdatePreparer(ctx, automationAccountName, runbookName, runbookContent) if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "CreateOrUpdate", nil, "Failure preparing request") return } - resp, err := client.GetSender(req) + result, err = client.CreateOrUpdateSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Get", resp, "Failure responding to request") - } - return } -// GetPreparer prepares the Get request. -func (client RunbookDraftClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client RunbookDraftClient) CreateOrUpdatePreparer(ctx context.Context, automationAccountName string, runbookName string, runbookContent io.ReadCloser) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -87,70 +83,77 @@ func (client RunbookDraftClient) GetPreparer(ctx context.Context, resourceGroupN } preparer := autorest.CreatePreparer( - autorest.AsGet(), + autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content", pathParameters), + autorest.WithFile(runbookContent), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetSender sends the Get request. The method will close the +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client RunbookDraftClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) +func (client RunbookDraftClient) CreateOrUpdateSender(req *http.Request) (future RunbookDraftCreateOrUpdateFuture, 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 } -// GetResponder handles the response to the Get request. The method always +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. -func (client RunbookDraftClient) GetResponder(resp *http.Response) (result RunbookDraft, err error) { +func (client RunbookDraftClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} + result.Response = resp return } -// GetContent retrieve the content of runbook draft identified by runbook name. +// Get retrieve the runbook draft identified by runbook name. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName -// is the runbook name. -func (client RunbookDraftClient) GetContent(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result String, err error) { +// automationAccountName is the automation account name. runbookName is the runbook name. +func (client RunbookDraftClient) Get(ctx context.Context, automationAccountName string, runbookName string) (result RunbookDraft, 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.NewError("automation.RunbookDraftClient", "GetContent", err.Error()) + {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") } - req, err := client.GetContentPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + req, err := client.GetPreparer(ctx, automationAccountName, runbookName) if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "GetContent", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Get", nil, "Failure preparing request") return } - resp, err := client.GetContentSender(req) + resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "GetContent", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Get", resp, "Failure sending request") return } - result, err = client.GetContentResponder(resp) + result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "GetContent", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Get", resp, "Failure responding to request") } return } -// GetContentPreparer prepares the GetContent request. -func (client RunbookDraftClient) GetContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { +// GetPreparer prepares the Get request. +func (client RunbookDraftClient) GetPreparer(ctx context.Context, automationAccountName string, runbookName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -163,62 +166,67 @@ func (client RunbookDraftClient) GetContentPreparer(ctx context.Context, resourc preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetContentSender sends the GetContent request. The method will close the +// GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. -func (client RunbookDraftClient) GetContentSender(req *http.Request) (*http.Response, error) { +func (client RunbookDraftClient) GetSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } -// GetContentResponder handles the response to the GetContent request. The method always +// GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client RunbookDraftClient) GetContentResponder(resp *http.Response) (result String, err error) { +func (client RunbookDraftClient) GetResponder(resp *http.Response) (result RunbookDraft, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// Publish publish runbook draft. +// GetContent retrieve the content of runbook draft identified by runbook name. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName -// is the parameters supplied to the publish runbook operation. -func (client RunbookDraftClient) Publish(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result RunbookDraftPublishFuture, err error) { +// automationAccountName is the automation account name. runbookName is the runbook name. +func (client RunbookDraftClient) GetContent(ctx context.Context, automationAccountName string, runbookName string) (result ReadCloser, 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.NewError("automation.RunbookDraftClient", "Publish", err.Error()) + {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") } - req, err := client.PublishPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + req, err := client.GetContentPreparer(ctx, automationAccountName, runbookName) if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Publish", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "GetContent", nil, "Failure preparing request") return } - result, err = client.PublishSender(req) + resp, err := client.GetContentSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Publish", result.Response(), "Failure sending request") + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "GetContent", resp, "Failure sending request") return } + result, err = client.GetContentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "GetContent", resp, "Failure responding to request") + } + return } -// PublishPreparer prepares the Publish request. -func (client RunbookDraftClient) PublishPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { +// GetContentPreparer prepares the GetContent request. +func (client RunbookDraftClient) GetContentPreparer(ctx context.Context, automationAccountName string, runbookName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -229,71 +237,63 @@ func (client RunbookDraftClient) PublishPreparer(ctx context.Context, resourceGr } preparer := autorest.CreatePreparer( - autorest.AsPost(), + autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/publish", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// PublishSender sends the Publish request. The method will close the +// GetContentSender sends the GetContent request. The method will close the // http.Response Body if it receives an error. -func (client RunbookDraftClient) PublishSender(req *http.Request) (future RunbookDraftPublishFuture, 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 +func (client RunbookDraftClient) GetContentSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) } -// PublishResponder handles the response to the Publish request. The method always +// GetContentResponder handles the response to the GetContent request. The method always // closes the http.Response Body. -func (client RunbookDraftClient) PublishResponder(resp *http.Response) (result autorest.Response, err error) { +func (client RunbookDraftClient) GetContentResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp + azure.WithErrorUnlessStatusCode(http.StatusOK)) + result.Response = autorest.Response{Response: resp} return } -// ReplaceContent replaces the runbook draft content. +// Publish publish runbook draft. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName -// is the runbook name. runbookContent is the runbook draft content. -func (client RunbookDraftClient) ReplaceContent(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, runbookContent string) (result RunbookDraftReplaceContentFuture, err error) { +// 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: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.RunbookDraftClient", "ReplaceContent", err.Error()) + {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") } - req, err := client.ReplaceContentPreparer(ctx, resourceGroupName, automationAccountName, runbookName, runbookContent) + req, err := client.PublishPreparer(ctx, automationAccountName, runbookName) if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "ReplaceContent", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Publish", nil, "Failure preparing request") return } - result, err = client.ReplaceContentSender(req) + result, err = client.PublishSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "ReplaceContent", result.Response(), "Failure sending request") + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Publish", result.Response(), "Failure sending request") return } return } -// ReplaceContentPreparer prepares the ReplaceContent request. -func (client RunbookDraftClient) ReplaceContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, runbookContent string) (*http.Request, error) { +// PublishPreparer prepares the Publish request. +func (client RunbookDraftClient) PublishPreparer(ctx context.Context, automationAccountName string, runbookName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -304,18 +304,16 @@ func (client RunbookDraftClient) ReplaceContentPreparer(ctx context.Context, res } preparer := autorest.CreatePreparer( - autorest.AsContentType("text/powershell"), - autorest.AsPut(), + autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content", pathParameters), - autorest.WithJSON(runbookContent), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/publish", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ReplaceContentSender sends the ReplaceContent request. The method will close the +// PublishSender sends the Publish request. The method will close the // http.Response Body if it receives an error. -func (client RunbookDraftClient) ReplaceContentSender(req *http.Request) (future RunbookDraftReplaceContentFuture, err error) { +func (client RunbookDraftClient) PublishSender(req *http.Request) (future RunbookDraftPublishFuture, err error) { sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) future.Future = azure.NewFuture(req) future.req = req @@ -328,30 +326,30 @@ func (client RunbookDraftClient) ReplaceContentSender(req *http.Request) (future return } -// ReplaceContentResponder handles the response to the ReplaceContent request. The method always +// PublishResponder handles the response to the Publish request. The method always // closes the http.Response Body. -func (client RunbookDraftClient) ReplaceContentResponder(resp *http.Response) (result autorest.Response, err error) { +func (client RunbookDraftClient) PublishResponder(resp *http.Response) (result Runbook, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) - result.Response = resp + result.Response = autorest.Response{Response: resp} return } -// UndoEdit undo draft edit to last known published state identified by runbook name. +// UndoEdit retrieve the runbook identified by runbook name. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName -// is the runbook name. -func (client RunbookDraftClient) UndoEdit(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result RunbookDraftUndoEditResult, err error) { +// automationAccountName is the automation account name. runbookName is the runbook name. +func (client RunbookDraftClient) UndoEdit(ctx context.Context, automationAccountName string, runbookName string) (result RunbookDraftUndoEditResult, 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.NewError("automation.RunbookDraftClient", "UndoEdit", err.Error()) + {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") } - req, err := client.UndoEditPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + req, err := client.UndoEditPreparer(ctx, automationAccountName, runbookName) if err != nil { err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "UndoEdit", nil, "Failure preparing request") return @@ -373,10 +371,10 @@ func (client RunbookDraftClient) UndoEdit(ctx context.Context, resourceGroupName } // UndoEditPreparer prepares the UndoEdit request. -func (client RunbookDraftClient) UndoEditPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { +func (client RunbookDraftClient) UndoEditPreparer(ctx context.Context, automationAccountName string, runbookName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } 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 ee673e96001e..fdd00c4793dc 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 @@ -31,31 +31,31 @@ type ScheduleClient struct { } // NewScheduleClient creates an instance of the ScheduleClient client. -func NewScheduleClient(subscriptionID string) ScheduleClient { - return NewScheduleClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewScheduleClient(subscriptionID string, resourceGroupName string) ScheduleClient { + return NewScheduleClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) } // NewScheduleClientWithBaseURI creates an instance of the ScheduleClient client. -func NewScheduleClientWithBaseURI(baseURI string, subscriptionID string) ScheduleClient { - return ScheduleClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewScheduleClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) ScheduleClient { + return ScheduleClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} } // CreateOrUpdate create a schedule. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. scheduleName -// is the schedule name. parameters is the parameters supplied to the create or update schedule operation. -func (client ScheduleClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string, parameters ScheduleCreateOrUpdateParameters) (result Schedule, err error) { +// automationAccountName is the automation account name. scheduleName is the schedule name. parameters is the +// parameters supplied to the create or update schedule operation. +func (client ScheduleClient) CreateOrUpdate(ctx context.Context, automationAccountName string, scheduleName string, parameters ScheduleCreateOrUpdateParameters) (result Schedule, err error) { if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: client.ResourceGroupName, + Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {TargetValue: parameters, 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.NewError("automation.ScheduleClient", "CreateOrUpdate", err.Error()) + return result, validation.NewErrorWithValidationError(err, "automation.ScheduleClient", "CreateOrUpdate") } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, scheduleName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, automationAccountName, scheduleName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -77,10 +77,10 @@ func (client ScheduleClient) CreateOrUpdate(ctx context.Context, resourceGroupNa } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ScheduleClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string, parameters ScheduleCreateOrUpdateParameters) (*http.Request, error) { +func (client ScheduleClient) CreateOrUpdatePreparer(ctx context.Context, automationAccountName string, scheduleName string, parameters ScheduleCreateOrUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "scheduleName": autorest.Encode("path", scheduleName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -91,7 +91,7 @@ func (client ScheduleClient) CreateOrUpdatePreparer(ctx context.Context, resourc } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsJSON(), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}", pathParameters), @@ -122,16 +122,15 @@ func (client ScheduleClient) CreateOrUpdateResponder(resp *http.Response) (resul // Delete delete the schedule identified by schedule name. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. scheduleName -// is the schedule name. -func (client ScheduleClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string) (result autorest.Response, err error) { +// automationAccountName is the automation account name. scheduleName is the schedule name. +func (client ScheduleClient) Delete(ctx context.Context, automationAccountName string, scheduleName string) (result autorest.Response, 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.NewError("automation.ScheduleClient", "Delete", err.Error()) + {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") } - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, scheduleName) + req, err := client.DeletePreparer(ctx, automationAccountName, scheduleName) if err != nil { err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Delete", nil, "Failure preparing request") return @@ -153,10 +152,10 @@ func (client ScheduleClient) Delete(ctx context.Context, resourceGroupName strin } // DeletePreparer prepares the Delete request. -func (client ScheduleClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string) (*http.Request, error) { +func (client ScheduleClient) DeletePreparer(ctx context.Context, automationAccountName string, scheduleName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "scheduleName": autorest.Encode("path", scheduleName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -195,16 +194,15 @@ func (client ScheduleClient) DeleteResponder(resp *http.Response) (result autore // Get retrieve the schedule identified by schedule name. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. scheduleName -// is the schedule name. -func (client ScheduleClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string) (result Schedule, err error) { +// automationAccountName is the automation account name. scheduleName is the schedule name. +func (client ScheduleClient) Get(ctx context.Context, automationAccountName string, scheduleName string) (result Schedule, 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.NewError("automation.ScheduleClient", "Get", err.Error()) + {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") } - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, scheduleName) + req, err := client.GetPreparer(ctx, automationAccountName, scheduleName) if err != nil { err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Get", nil, "Failure preparing request") return @@ -226,10 +224,10 @@ func (client ScheduleClient) Get(ctx context.Context, resourceGroupName string, } // GetPreparer prepares the Get request. -func (client ScheduleClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string) (*http.Request, error) { +func (client ScheduleClient) GetPreparer(ctx context.Context, automationAccountName string, scheduleName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "scheduleName": autorest.Encode("path", scheduleName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -269,16 +267,16 @@ func (client ScheduleClient) GetResponder(resp *http.Response) (result Schedule, // ListByAutomationAccount retrieve a list of schedules. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -func (client ScheduleClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result ScheduleListResultPage, err error) { +// automationAccountName is the automation account name. +func (client ScheduleClient) ListByAutomationAccount(ctx context.Context, automationAccountName string) (result ScheduleListResultPage, 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.NewError("automation.ScheduleClient", "ListByAutomationAccount", err.Error()) + {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") } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName) if err != nil { err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -300,10 +298,10 @@ func (client ScheduleClient) ListByAutomationAccount(ctx context.Context, resour } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client ScheduleClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { +func (client ScheduleClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -362,23 +360,23 @@ func (client ScheduleClient) listByAutomationAccountNextResults(lastResults Sche } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client ScheduleClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result ScheduleListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) +func (client ScheduleClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string) (result ScheduleListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, automationAccountName) return } // Update update the schedule identified by schedule name. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. scheduleName -// is the schedule name. parameters is the parameters supplied to the update schedule operation. -func (client ScheduleClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string, parameters ScheduleUpdateParameters) (result Schedule, err error) { +// automationAccountName is the automation account name. scheduleName is the schedule name. parameters is the +// parameters supplied to the update schedule operation. +func (client ScheduleClient) Update(ctx context.Context, automationAccountName string, scheduleName string, parameters ScheduleUpdateParameters) (result Schedule, 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.NewError("automation.ScheduleClient", "Update", err.Error()) + {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") } - req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, scheduleName, parameters) + req, err := client.UpdatePreparer(ctx, automationAccountName, scheduleName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Update", nil, "Failure preparing request") return @@ -400,10 +398,10 @@ func (client ScheduleClient) Update(ctx context.Context, resourceGroupName strin } // UpdatePreparer prepares the Update request. -func (client ScheduleClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string, parameters ScheduleUpdateParameters) (*http.Request, error) { +func (client ScheduleClient) UpdatePreparer(ctx context.Context, automationAccountName string, scheduleName string, parameters ScheduleUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "scheduleName": autorest.Encode("path", scheduleName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -414,7 +412,7 @@ func (client ScheduleClient) UpdatePreparer(ctx context.Context, resourceGroupNa } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsJSON(), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}", pathParameters), 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 4ebfa7f129f5..16fdd5f85b92 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 @@ -31,24 +31,24 @@ type StatisticsClient struct { } // NewStatisticsClient creates an instance of the StatisticsClient client. -func NewStatisticsClient(subscriptionID string) StatisticsClient { - return NewStatisticsClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewStatisticsClient(subscriptionID string, resourceGroupName string) StatisticsClient { + return NewStatisticsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) } // NewStatisticsClientWithBaseURI creates an instance of the StatisticsClient client. -func NewStatisticsClientWithBaseURI(baseURI string, subscriptionID string) StatisticsClient { - return StatisticsClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewStatisticsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) StatisticsClient { + return StatisticsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} } // 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.NewError("automation.StatisticsClient", "ListByAutomationAccount", err.Error()) + return result, validation.NewErrorWithValidationError(err, "automation.StatisticsClient", "ListByAutomationAccount") } 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/testjob.go b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/testjobs.go similarity index 55% rename from vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/testjob.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/testjobs.go index 63af34493587..17d11ca09edc 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/testjob.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation/testjobs.go @@ -25,59 +25,60 @@ import ( "net/http" ) -// TestJobClient is the automation Client -type TestJobClient struct { +// TestJobsClient is the automation Client +type TestJobsClient struct { BaseClient } -// NewTestJobClient creates an instance of the TestJobClient client. -func NewTestJobClient(subscriptionID string) TestJobClient { - return NewTestJobClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewTestJobsClient creates an instance of the TestJobsClient client. +func NewTestJobsClient(subscriptionID string, resourceGroupName string) TestJobsClient { + return NewTestJobsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) } -// NewTestJobClientWithBaseURI creates an instance of the TestJobClient client. -func NewTestJobClientWithBaseURI(baseURI string, subscriptionID string) TestJobClient { - return TestJobClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewTestJobsClientWithBaseURI creates an instance of the TestJobsClient client. +func NewTestJobsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) TestJobsClient { + return TestJobsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} } // Create create a test job of the runbook. // -// resourceGroupName is the resource group name. 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 TestJobClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters TestJobCreateParameters) (result TestJob, err error) { +// 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: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.TestJobClient", "Create", err.Error()) + {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") } - req, err := client.CreatePreparer(ctx, resourceGroupName, automationAccountName, runbookName, parameters) + req, err := client.CreatePreparer(ctx, automationAccountName, runbookName, parameters) if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Create", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "automation.TestJobsClient", "Create", nil, "Failure preparing request") return } resp, err := client.CreateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Create", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "automation.TestJobsClient", "Create", resp, "Failure sending request") return } result, err = client.CreateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Create", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "automation.TestJobsClient", "Create", resp, "Failure responding to request") } return } // CreatePreparer prepares the Create request. -func (client TestJobClient) CreatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters TestJobCreateParameters) (*http.Request, error) { +func (client TestJobsClient) CreatePreparer(ctx context.Context, automationAccountName string, runbookName string, parameters TestJobCreateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -88,7 +89,7 @@ func (client TestJobClient) CreatePreparer(ctx context.Context, resourceGroupNam } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsJSON(), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob", pathParameters), @@ -99,14 +100,14 @@ func (client TestJobClient) CreatePreparer(ctx context.Context, resourceGroupNam // CreateSender sends the Create request. The method will close the // http.Response Body if it receives an error. -func (client TestJobClient) CreateSender(req *http.Request) (*http.Response, error) { +func (client TestJobsClient) CreateSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // CreateResponder handles the response to the Create request. The method always // closes the http.Response Body. -func (client TestJobClient) CreateResponder(resp *http.Response) (result TestJob, err error) { +func (client TestJobsClient) CreateResponder(resp *http.Response) (result TestJob, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -119,41 +120,40 @@ func (client TestJobClient) CreateResponder(resp *http.Response) (result TestJob // Get retrieve the test job for the specified runbook. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName -// is the runbook name. -func (client TestJobClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result TestJob, err error) { +// automationAccountName is the automation account name. runbookName is the runbook name. +func (client TestJobsClient) Get(ctx context.Context, automationAccountName string, runbookName string) (result TestJob, 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.NewError("automation.TestJobClient", "Get", err.Error()) + {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") } - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + req, err := client.GetPreparer(ctx, automationAccountName, runbookName) if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "automation.TestJobsClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "automation.TestJobsClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "automation.TestJobsClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. -func (client TestJobClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { +func (client TestJobsClient) GetPreparer(ctx context.Context, automationAccountName string, runbookName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -173,14 +173,14 @@ func (client TestJobClient) GetPreparer(ctx context.Context, resourceGroupName s // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. -func (client TestJobClient) GetSender(req *http.Request) (*http.Response, error) { +func (client TestJobsClient) 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 TestJobClient) GetResponder(resp *http.Response) (result TestJob, err error) { +func (client TestJobsClient) GetResponder(resp *http.Response) (result TestJob, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -193,41 +193,40 @@ func (client TestJobClient) GetResponder(resp *http.Response) (result TestJob, e // Resume resume the test job. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName -// is the runbook name. -func (client TestJobClient) Resume(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result autorest.Response, err error) { +// automationAccountName is the automation account name. runbookName is the runbook name. +func (client TestJobsClient) Resume(ctx context.Context, automationAccountName string, runbookName string) (result autorest.Response, 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.NewError("automation.TestJobClient", "Resume", err.Error()) + {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") } - req, err := client.ResumePreparer(ctx, resourceGroupName, automationAccountName, runbookName) + req, err := client.ResumePreparer(ctx, automationAccountName, runbookName) if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Resume", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "automation.TestJobsClient", "Resume", nil, "Failure preparing request") return } resp, err := client.ResumeSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Resume", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "automation.TestJobsClient", "Resume", resp, "Failure sending request") return } result, err = client.ResumeResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Resume", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "automation.TestJobsClient", "Resume", resp, "Failure responding to request") } return } // ResumePreparer prepares the Resume request. -func (client TestJobClient) ResumePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { +func (client TestJobsClient) ResumePreparer(ctx context.Context, automationAccountName string, runbookName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -247,14 +246,14 @@ func (client TestJobClient) ResumePreparer(ctx context.Context, resourceGroupNam // ResumeSender sends the Resume request. The method will close the // http.Response Body if it receives an error. -func (client TestJobClient) ResumeSender(req *http.Request) (*http.Response, error) { +func (client TestJobsClient) ResumeSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // ResumeResponder handles the response to the Resume request. The method always // closes the http.Response Body. -func (client TestJobClient) ResumeResponder(resp *http.Response) (result autorest.Response, err error) { +func (client TestJobsClient) ResumeResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -266,41 +265,40 @@ func (client TestJobClient) ResumeResponder(resp *http.Response) (result autores // Stop stop the test job. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName -// is the runbook name. -func (client TestJobClient) Stop(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result autorest.Response, err error) { +// automationAccountName is the automation account name. runbookName is the runbook name. +func (client TestJobsClient) Stop(ctx context.Context, automationAccountName string, runbookName string) (result autorest.Response, 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.NewError("automation.TestJobClient", "Stop", err.Error()) + {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") } - req, err := client.StopPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + req, err := client.StopPreparer(ctx, automationAccountName, runbookName) if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Stop", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "automation.TestJobsClient", "Stop", nil, "Failure preparing request") return } resp, err := client.StopSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Stop", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "automation.TestJobsClient", "Stop", resp, "Failure sending request") return } result, err = client.StopResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Stop", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "automation.TestJobsClient", "Stop", resp, "Failure responding to request") } return } // StopPreparer prepares the Stop request. -func (client TestJobClient) StopPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { +func (client TestJobsClient) StopPreparer(ctx context.Context, automationAccountName string, runbookName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -320,14 +318,14 @@ func (client TestJobClient) StopPreparer(ctx context.Context, resourceGroupName // StopSender sends the Stop request. The method will close the // http.Response Body if it receives an error. -func (client TestJobClient) StopSender(req *http.Request) (*http.Response, error) { +func (client TestJobsClient) StopSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // StopResponder handles the response to the Stop request. The method always // closes the http.Response Body. -func (client TestJobClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { +func (client TestJobsClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -339,41 +337,40 @@ func (client TestJobClient) StopResponder(resp *http.Response) (result autorest. // Suspend suspend the test job. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName -// is the runbook name. -func (client TestJobClient) Suspend(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result autorest.Response, err error) { +// automationAccountName is the automation account name. runbookName is the runbook name. +func (client TestJobsClient) Suspend(ctx context.Context, automationAccountName string, runbookName string) (result autorest.Response, 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.NewError("automation.TestJobClient", "Suspend", err.Error()) + {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") } - req, err := client.SuspendPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + req, err := client.SuspendPreparer(ctx, automationAccountName, runbookName) if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Suspend", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "automation.TestJobsClient", "Suspend", nil, "Failure preparing request") return } resp, err := client.SuspendSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Suspend", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "automation.TestJobsClient", "Suspend", resp, "Failure sending request") return } result, err = client.SuspendResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Suspend", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "automation.TestJobsClient", "Suspend", resp, "Failure responding to request") } return } // SuspendPreparer prepares the Suspend request. -func (client TestJobClient) SuspendPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { +func (client TestJobsClient) SuspendPreparer(ctx context.Context, automationAccountName string, runbookName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -393,14 +390,14 @@ func (client TestJobClient) SuspendPreparer(ctx context.Context, resourceGroupNa // SuspendSender sends the Suspend request. The method will close the // http.Response Body if it receives an error. -func (client TestJobClient) SuspendSender(req *http.Request) (*http.Response, error) { +func (client TestJobsClient) SuspendSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } // SuspendResponder handles the response to the Suspend request. The method always // closes the http.Response Body. -func (client TestJobClient) SuspendResponder(resp *http.Response) (result autorest.Response, err error) { +func (client TestJobsClient) SuspendResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), 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 5c7f9707cb26..36e94ffea401 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 @@ -31,27 +31,27 @@ type TestJobStreamsClient struct { } // NewTestJobStreamsClient creates an instance of the TestJobStreamsClient client. -func NewTestJobStreamsClient(subscriptionID string) TestJobStreamsClient { - return NewTestJobStreamsClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewTestJobStreamsClient(subscriptionID string, resourceGroupName string) TestJobStreamsClient { + return NewTestJobStreamsClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) } // NewTestJobStreamsClientWithBaseURI creates an instance of the TestJobStreamsClient client. -func NewTestJobStreamsClientWithBaseURI(baseURI string, subscriptionID string) TestJobStreamsClient { - return TestJobStreamsClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewTestJobStreamsClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) TestJobStreamsClient { + return TestJobStreamsClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} } -// Get retrieve a test job stream of the test job identified by runbook name and stream id. +// Get retrieve a test job streams identified by runbook name and stream id. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. runbookName -// is the runbook name. jobStreamID is the job stream id. -func (client TestJobStreamsClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, jobStreamID string) (result JobStream, err error) { +// 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: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.TestJobStreamsClient", "Get", err.Error()) + {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") } - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, runbookName, jobStreamID) + req, err := client.GetPreparer(ctx, automationAccountName, runbookName, jobStreamID) if err != nil { err = autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "Get", nil, "Failure preparing request") return @@ -73,11 +73,11 @@ func (client TestJobStreamsClient) Get(ctx context.Context, resourceGroupName st } // GetPreparer prepares the Get request. -func (client TestJobStreamsClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, jobStreamID string) (*http.Request, error) { +func (client TestJobStreamsClient) GetPreparer(ctx context.Context, automationAccountName string, runbookName string, jobStreamID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), "jobStreamId": autorest.Encode("path", jobStreamID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -117,17 +117,17 @@ func (client TestJobStreamsClient) GetResponder(resp *http.Response) (result Job // ListByTestJob retrieve a list of test job streams identified by runbook name. // -// resourceGroupName is the resource group name. 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, resourceGroupName string, automationAccountName string, runbookName string, filter string) (result JobStreamListResultPage, err error) { +// 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: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("automation.TestJobStreamsClient", "ListByTestJob", err.Error()) + {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") } result.fn = client.listByTestJobNextResults - req, err := client.ListByTestJobPreparer(ctx, resourceGroupName, automationAccountName, runbookName, filter) + req, err := client.ListByTestJobPreparer(ctx, automationAccountName, runbookName, filter) if err != nil { err = autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "ListByTestJob", nil, "Failure preparing request") return @@ -149,10 +149,10 @@ func (client TestJobStreamsClient) ListByTestJob(ctx context.Context, resourceGr } // ListByTestJobPreparer prepares the ListByTestJob request. -func (client TestJobStreamsClient) ListByTestJobPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, filter string) (*http.Request, error) { +func (client TestJobStreamsClient) ListByTestJobPreparer(ctx context.Context, automationAccountName string, runbookName string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "runbookName": autorest.Encode("path", runbookName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -215,7 +215,7 @@ func (client TestJobStreamsClient) listByTestJobNextResults(lastResults JobStrea } // ListByTestJobComplete enumerates all values, automatically crossing page boundaries as required. -func (client TestJobStreamsClient) ListByTestJobComplete(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, filter string) (result JobStreamListResultIterator, err error) { - result.page, err = client.ListByTestJob(ctx, resourceGroupName, automationAccountName, runbookName, filter) +func (client TestJobStreamsClient) ListByTestJobComplete(ctx context.Context, automationAccountName string, runbookName string, filter string) (result JobStreamListResultIterator, err error) { + result.page, err = client.ListByTestJob(ctx, automationAccountName, runbookName, filter) return } 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 9c8726a20aef..fa1bc1aab84f 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 @@ -31,13 +31,13 @@ type UsagesClient struct { } // NewUsagesClient creates an instance of the UsagesClient client. -func NewUsagesClient(subscriptionID string) UsagesClient { - return NewUsagesClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewUsagesClient(subscriptionID string, resourceGroupName string) UsagesClient { + return NewUsagesClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) } // NewUsagesClientWithBaseURI creates an instance of the UsagesClient client. -func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string) UsagesClient { - return UsagesClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) UsagesClient { + return UsagesClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} } // ListByAutomationAccount retrieve the usage for the account id. @@ -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.NewError("automation.UsagesClient", "ListByAutomationAccount", err.Error()) + return result, validation.NewErrorWithValidationError(err, "automation.UsagesClient", "ListByAutomationAccount") } 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 e957827d4a3f..313e8f194e1d 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 @@ -31,30 +31,30 @@ type VariableClient struct { } // NewVariableClient creates an instance of the VariableClient client. -func NewVariableClient(subscriptionID string) VariableClient { - return NewVariableClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewVariableClient(subscriptionID string, resourceGroupName string) VariableClient { + return NewVariableClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) } // NewVariableClientWithBaseURI creates an instance of the VariableClient client. -func NewVariableClientWithBaseURI(baseURI string, subscriptionID string) VariableClient { - return VariableClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewVariableClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) VariableClient { + return VariableClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} } // CreateOrUpdate create a variable. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. variableName -// is the variable name. parameters is the parameters supplied to the create or update variable operation. -func (client VariableClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string, parameters VariableCreateOrUpdateParameters) (result Variable, err error) { +// automationAccountName is the automation account name. variableName is the variable name. parameters is the +// parameters supplied to the create or update variable operation. +func (client VariableClient) CreateOrUpdate(ctx context.Context, automationAccountName string, variableName string, parameters VariableCreateOrUpdateParameters) (result Variable, err error) { if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: client.ResourceGroupName, + Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {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.NewError("automation.VariableClient", "CreateOrUpdate", err.Error()) + return result, validation.NewErrorWithValidationError(err, "automation.VariableClient", "CreateOrUpdate") } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, variableName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, automationAccountName, variableName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.VariableClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -76,10 +76,10 @@ func (client VariableClient) CreateOrUpdate(ctx context.Context, resourceGroupNa } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VariableClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string, parameters VariableCreateOrUpdateParameters) (*http.Request, error) { +func (client VariableClient) CreateOrUpdatePreparer(ctx context.Context, automationAccountName string, variableName string, parameters VariableCreateOrUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "variableName": autorest.Encode("path", variableName), } @@ -90,7 +90,7 @@ func (client VariableClient) CreateOrUpdatePreparer(ctx context.Context, resourc } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsJSON(), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}", pathParameters), @@ -121,16 +121,15 @@ func (client VariableClient) CreateOrUpdateResponder(resp *http.Response) (resul // Delete delete the variable. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. variableName -// is the name of variable. -func (client VariableClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string) (result autorest.Response, err error) { +// automationAccountName is the automation account name. variableName is the name of variable. +func (client VariableClient) Delete(ctx context.Context, automationAccountName string, variableName string) (result autorest.Response, 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.NewError("automation.VariableClient", "Delete", err.Error()) + {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") } - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, variableName) + req, err := client.DeletePreparer(ctx, automationAccountName, variableName) if err != nil { err = autorest.NewErrorWithError(err, "automation.VariableClient", "Delete", nil, "Failure preparing request") return @@ -152,10 +151,10 @@ func (client VariableClient) Delete(ctx context.Context, resourceGroupName strin } // DeletePreparer prepares the Delete request. -func (client VariableClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string) (*http.Request, error) { +func (client VariableClient) DeletePreparer(ctx context.Context, automationAccountName string, variableName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "variableName": autorest.Encode("path", variableName), } @@ -194,16 +193,15 @@ func (client VariableClient) DeleteResponder(resp *http.Response) (result autore // Get retrieve the variable identified by variable name. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. variableName -// is the name of variable. -func (client VariableClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string) (result Variable, err error) { +// automationAccountName is the automation account name. variableName is the name of variable. +func (client VariableClient) Get(ctx context.Context, automationAccountName string, variableName string) (result Variable, 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.NewError("automation.VariableClient", "Get", err.Error()) + {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") } - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, variableName) + req, err := client.GetPreparer(ctx, automationAccountName, variableName) if err != nil { err = autorest.NewErrorWithError(err, "automation.VariableClient", "Get", nil, "Failure preparing request") return @@ -225,10 +223,10 @@ func (client VariableClient) Get(ctx context.Context, resourceGroupName string, } // GetPreparer prepares the Get request. -func (client VariableClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string) (*http.Request, error) { +func (client VariableClient) GetPreparer(ctx context.Context, automationAccountName string, variableName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "variableName": autorest.Encode("path", variableName), } @@ -268,16 +266,16 @@ func (client VariableClient) GetResponder(resp *http.Response) (result Variable, // ListByAutomationAccount retrieve a list of variables. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -func (client VariableClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result VariableListResultPage, err error) { +// automationAccountName is the automation account name. +func (client VariableClient) ListByAutomationAccount(ctx context.Context, automationAccountName string) (result VariableListResultPage, 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.NewError("automation.VariableClient", "ListByAutomationAccount", err.Error()) + {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") } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName) if err != nil { err = autorest.NewErrorWithError(err, "automation.VariableClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -299,10 +297,10 @@ func (client VariableClient) ListByAutomationAccount(ctx context.Context, resour } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client VariableClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { +func (client VariableClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -361,23 +359,23 @@ func (client VariableClient) listByAutomationAccountNextResults(lastResults Vari } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client VariableClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result VariableListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) +func (client VariableClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string) (result VariableListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, automationAccountName) return } // Update update a variable. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. variableName -// is the variable name. parameters is the parameters supplied to the update variable operation. -func (client VariableClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string, parameters VariableUpdateParameters) (result Variable, err error) { +// automationAccountName is the automation account name. variableName is the variable name. parameters is the +// parameters supplied to the update variable operation. +func (client VariableClient) Update(ctx context.Context, automationAccountName string, variableName string, parameters VariableUpdateParameters) (result Variable, 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.NewError("automation.VariableClient", "Update", err.Error()) + {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") } - req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, variableName, parameters) + req, err := client.UpdatePreparer(ctx, automationAccountName, variableName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.VariableClient", "Update", nil, "Failure preparing request") return @@ -399,10 +397,10 @@ func (client VariableClient) Update(ctx context.Context, resourceGroupName strin } // UpdatePreparer prepares the Update request. -func (client VariableClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string, parameters VariableUpdateParameters) (*http.Request, error) { +func (client VariableClient) UpdatePreparer(ctx context.Context, automationAccountName string, variableName string, parameters VariableUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "variableName": autorest.Encode("path", variableName), } @@ -413,7 +411,7 @@ func (client VariableClient) UpdatePreparer(ctx context.Context, resourceGroupNa } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsJSON(), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}", pathParameters), 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 3b1202b345aa..238be6ca7270 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,7 +1,5 @@ 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"); @@ -21,10 +19,10 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + version.Number + " automation/2015-10-31" + return "Azure-SDK-For-Go/v12.5.0-beta services" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return version.Number + return "v12.5.0-beta" } 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 e55131849aba..3f49a2e3bd90 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 @@ -31,30 +31,30 @@ type WebhookClient struct { } // NewWebhookClient creates an instance of the WebhookClient client. -func NewWebhookClient(subscriptionID string) WebhookClient { - return NewWebhookClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewWebhookClient(subscriptionID string, resourceGroupName string) WebhookClient { + return NewWebhookClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName) } // NewWebhookClientWithBaseURI creates an instance of the WebhookClient client. -func NewWebhookClientWithBaseURI(baseURI string, subscriptionID string) WebhookClient { - return WebhookClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewWebhookClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string) WebhookClient { + return WebhookClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName)} } // CreateOrUpdate create the webhook identified by webhook name. // -// resourceGroupName is the resource group name. 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, resourceGroupName string, automationAccountName string, webhookName string, parameters WebhookCreateOrUpdateParameters) (result Webhook, err error) { +// 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: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: client.ResourceGroupName, + Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, {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.NewError("automation.WebhookClient", "CreateOrUpdate", err.Error()) + return result, validation.NewErrorWithValidationError(err, "automation.WebhookClient", "CreateOrUpdate") } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, webhookName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, automationAccountName, webhookName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.WebhookClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -76,10 +76,10 @@ func (client WebhookClient) CreateOrUpdate(ctx context.Context, resourceGroupNam } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client WebhookClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string, parameters WebhookCreateOrUpdateParameters) (*http.Request, error) { +func (client WebhookClient) CreateOrUpdatePreparer(ctx context.Context, automationAccountName string, webhookName string, parameters WebhookCreateOrUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "webhookName": autorest.Encode("path", webhookName), } @@ -90,7 +90,7 @@ func (client WebhookClient) CreateOrUpdatePreparer(ctx context.Context, resource } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsJSON(), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}", pathParameters), @@ -121,16 +121,15 @@ func (client WebhookClient) CreateOrUpdateResponder(resp *http.Response) (result // Delete delete the webhook by name. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. webhookName -// is the webhook name. -func (client WebhookClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string) (result autorest.Response, err error) { +// automationAccountName is the automation account name. webhookName is the webhook name. +func (client WebhookClient) Delete(ctx context.Context, automationAccountName string, webhookName string) (result autorest.Response, 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.NewError("automation.WebhookClient", "Delete", err.Error()) + {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") } - req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, webhookName) + req, err := client.DeletePreparer(ctx, automationAccountName, webhookName) if err != nil { err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Delete", nil, "Failure preparing request") return @@ -152,10 +151,10 @@ func (client WebhookClient) Delete(ctx context.Context, resourceGroupName string } // DeletePreparer prepares the Delete request. -func (client WebhookClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string) (*http.Request, error) { +func (client WebhookClient) DeletePreparer(ctx context.Context, automationAccountName string, webhookName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "webhookName": autorest.Encode("path", webhookName), } @@ -194,15 +193,15 @@ func (client WebhookClient) DeleteResponder(resp *http.Response) (result autores // GenerateURI generates a Uri for use in creating a webhook. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. -func (client WebhookClient) GenerateURI(ctx context.Context, resourceGroupName string, automationAccountName string) (result String, err error) { +// automationAccountName is the automation account name. +func (client WebhookClient) GenerateURI(ctx context.Context, automationAccountName string) (result String, 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.NewError("automation.WebhookClient", "GenerateURI", err.Error()) + {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") } - req, err := client.GenerateURIPreparer(ctx, resourceGroupName, automationAccountName) + req, err := client.GenerateURIPreparer(ctx, automationAccountName) if err != nil { err = autorest.NewErrorWithError(err, "automation.WebhookClient", "GenerateURI", nil, "Failure preparing request") return @@ -224,10 +223,10 @@ func (client WebhookClient) GenerateURI(ctx context.Context, resourceGroupName s } // GenerateURIPreparer prepares the GenerateURI request. -func (client WebhookClient) GenerateURIPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { +func (client WebhookClient) GenerateURIPreparer(ctx context.Context, automationAccountName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -266,16 +265,15 @@ func (client WebhookClient) GenerateURIResponder(resp *http.Response) (result St // Get retrieve the webhook identified by webhook name. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. webhookName -// is the webhook name. -func (client WebhookClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string) (result Webhook, err error) { +// automationAccountName is the automation account name. webhookName is the webhook name. +func (client WebhookClient) Get(ctx context.Context, automationAccountName string, webhookName string) (result Webhook, 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.NewError("automation.WebhookClient", "Get", err.Error()) + {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") } - req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, webhookName) + req, err := client.GetPreparer(ctx, automationAccountName, webhookName) if err != nil { err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Get", nil, "Failure preparing request") return @@ -297,10 +295,10 @@ func (client WebhookClient) Get(ctx context.Context, resourceGroupName string, a } // GetPreparer prepares the Get request. -func (client WebhookClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string) (*http.Request, error) { +func (client WebhookClient) GetPreparer(ctx context.Context, automationAccountName string, webhookName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "webhookName": autorest.Encode("path", webhookName), } @@ -340,17 +338,16 @@ func (client WebhookClient) GetResponder(resp *http.Response) (result Webhook, e // ListByAutomationAccount retrieve a list of webhooks. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. filter is -// the filter to apply on the operation. -func (client WebhookClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result WebhookListResultPage, err error) { +// automationAccountName is the automation account name. filter is the filter to apply on the operation. +func (client WebhookClient) ListByAutomationAccount(ctx context.Context, automationAccountName string, filter string) (result WebhookListResultPage, 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.NewError("automation.WebhookClient", "ListByAutomationAccount", err.Error()) + {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") } result.fn = client.listByAutomationAccountNextResults - req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) + req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName, filter) if err != nil { err = autorest.NewErrorWithError(err, "automation.WebhookClient", "ListByAutomationAccount", nil, "Failure preparing request") return @@ -372,10 +369,10 @@ func (client WebhookClient) ListByAutomationAccount(ctx context.Context, resourc } // ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. -func (client WebhookClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { +func (client WebhookClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string, filter string) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -437,23 +434,23 @@ func (client WebhookClient) listByAutomationAccountNextResults(lastResults Webho } // ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. -func (client WebhookClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result WebhookListResultIterator, err error) { - result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) +func (client WebhookClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string, filter string) (result WebhookListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, automationAccountName, filter) return } // Update update the webhook identified by webhook name. // -// resourceGroupName is the resource group name. automationAccountName is the automation account name. webhookName -// is the webhook name. parameters is the update parameters for webhook. -func (client WebhookClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string, parameters WebhookUpdateParameters) (result Webhook, err error) { +// automationAccountName is the automation account name. webhookName is the webhook name. parameters is the update +// parameters for webhook. +func (client WebhookClient) Update(ctx context.Context, automationAccountName string, webhookName string, parameters WebhookUpdateParameters) (result Webhook, 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.NewError("automation.WebhookClient", "Update", err.Error()) + {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") } - req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, webhookName, parameters) + req, err := client.UpdatePreparer(ctx, automationAccountName, webhookName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Update", nil, "Failure preparing request") return @@ -475,10 +472,10 @@ func (client WebhookClient) Update(ctx context.Context, resourceGroupName string } // UpdatePreparer prepares the Update request. -func (client WebhookClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string, parameters WebhookUpdateParameters) (*http.Request, error) { +func (client WebhookClient) UpdatePreparer(ctx context.Context, automationAccountName string, webhookName string, parameters WebhookUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "automationAccountName": autorest.Encode("path", automationAccountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "webhookName": autorest.Encode("path", webhookName), } @@ -489,7 +486,7 @@ func (client WebhookClient) UpdatePreparer(ctx context.Context, resourceGroupNam } preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsJSON(), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}", pathParameters), diff --git a/vendor/vendor.json b/vendor/vendor.json index 72b876f7a1c6..59367c0060c8 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -19,12 +19,12 @@ "versionExact": "v15.0.0" }, { - "checksumSHA1": "A6izWwgFLD54iHpocS2ZA0JG87c=", + "checksumSHA1": "0SGJv3vkB3mDzm2fEqyRhGBL+b0=", "path": "github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation", - "revision": "56332fec5b308fbb6615fa1af6117394cdba186d", - "revisionTime": "2018-03-26T23:29:47Z", - "version": "v15.0.0", - "versionExact": "v15.0.0" + "revision": "21b68149ccf7c16b3f028bb4c7fd0ab458fe308f", + "revisionTime": "2018-02-12T16:31:56Z", + "version": "v12.5.0-beta", + "versionExact": "v12.5.0-beta" }, { "checksumSHA1": "9zEuoQJZTVs2pUTQQOVwSL9KDvo=", From bf2dc117a8cd09148415f2df4de928699cff2b9d Mon Sep 17 00:00:00 2001 From: tombuildsstuff Date: Thu, 5 Apr 2018 13:52:40 +0200 Subject: [PATCH 4/7] Fixing the Storage SDK --- azurerm/config.go | 22 +++++++++++----------- azurerm/data_source_storage_account.go | 5 +++-- azurerm/tags.go | 12 ++++++------ 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/azurerm/config.go b/azurerm/config.go index 4f67ea4b7087..1db07c5a6673 100644 --- a/azurerm/config.go +++ b/azurerm/config.go @@ -463,7 +463,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 } @@ -905,7 +905,7 @@ var ( storageKeyCache = make(map[string]string) ) -func (armClient *ArmClient) getKeyForStorageAccount(resourceGroupName, storageAccountName string) (string, bool, error) { +func (armClient *ArmClient) getKeyForStorageAccount(ctx context.Context, resourceGroupName, storageAccountName string) (string, bool, error) { cacheIndex := resourceGroupName + "/" + storageAccountName storageKeyCacheMu.RLock() key, ok := storageKeyCache[cacheIndex] @@ -919,7 +919,7 @@ func (armClient *ArmClient) getKeyForStorageAccount(resourceGroupName, storageAc defer storageKeyCacheMu.Unlock() key, ok = storageKeyCache[cacheIndex] if !ok { - accountKeys, err := armClient.storageServiceClient.ListKeys(resourceGroupName, storageAccountName) + accountKeys, err := armClient.storageServiceClient.ListKeys(ctx, resourceGroupName, storageAccountName) if utils.ResponseWasNotFound(accountKeys.Response) { return "", false, nil } @@ -950,8 +950,8 @@ func (armClient *ArmClient) getKeyForStorageAccount(resourceGroupName, storageAc return key, true, nil } -func (armClient *ArmClient) getBlobStorageClientForStorageAccount(resourceGroupName, storageAccountName string) (*mainStorage.BlobStorageClient, bool, error) { - key, accountExists, err := armClient.getKeyForStorageAccount(resourceGroupName, storageAccountName) +func (armClient *ArmClient) getBlobStorageClientForStorageAccount(ctx context.Context, resourceGroupName, storageAccountName string) (*mainStorage.BlobStorageClient, bool, error) { + key, accountExists, err := armClient.getKeyForStorageAccount(ctx, resourceGroupName, storageAccountName) if err != nil { return nil, accountExists, err } @@ -969,8 +969,8 @@ func (armClient *ArmClient) getBlobStorageClientForStorageAccount(resourceGroupN return &blobClient, true, nil } -func (armClient *ArmClient) getFileServiceClientForStorageAccount(resourceGroupName, storageAccountName string) (*mainStorage.FileServiceClient, bool, error) { - key, accountExists, err := armClient.getKeyForStorageAccount(resourceGroupName, storageAccountName) +func (armClient *ArmClient) getFileServiceClientForStorageAccount(ctx context.Context, resourceGroupName, storageAccountName string) (*mainStorage.FileServiceClient, bool, error) { + key, accountExists, err := armClient.getKeyForStorageAccount(ctx, resourceGroupName, storageAccountName) if err != nil { return nil, accountExists, err } @@ -988,8 +988,8 @@ func (armClient *ArmClient) getFileServiceClientForStorageAccount(resourceGroupN return &fileClient, true, nil } -func (armClient *ArmClient) getTableServiceClientForStorageAccount(resourceGroupName, storageAccountName string) (*mainStorage.TableServiceClient, bool, error) { - key, accountExists, err := armClient.getKeyForStorageAccount(resourceGroupName, storageAccountName) +func (armClient *ArmClient) getTableServiceClientForStorageAccount(ctx context.Context, resourceGroupName, storageAccountName string) (*mainStorage.TableServiceClient, bool, error) { + key, accountExists, err := armClient.getKeyForStorageAccount(ctx, resourceGroupName, storageAccountName) if err != nil { return nil, accountExists, err } @@ -1007,8 +1007,8 @@ func (armClient *ArmClient) getTableServiceClientForStorageAccount(resourceGroup return &tableClient, true, nil } -func (armClient *ArmClient) getQueueServiceClientForStorageAccount(resourceGroupName, storageAccountName string) (*mainStorage.QueueServiceClient, bool, error) { - key, accountExists, err := armClient.getKeyForStorageAccount(resourceGroupName, storageAccountName) +func (armClient *ArmClient) getQueueServiceClientForStorageAccount(ctx context.Context, resourceGroupName, storageAccountName string) (*mainStorage.QueueServiceClient, bool, error) { + key, accountExists, err := armClient.getKeyForStorageAccount(ctx, resourceGroupName, storageAccountName) if err != nil { return nil, accountExists, err } diff --git a/azurerm/data_source_storage_account.go b/azurerm/data_source_storage_account.go index a228bdd6bb1d..298161c092c4 100644 --- a/azurerm/data_source_storage_account.go +++ b/azurerm/data_source_storage_account.go @@ -159,13 +159,14 @@ func dataSourceArmStorageAccount() *schema.Resource { } func dataSourceArmStorageAccountRead(d *schema.ResourceData, meta interface{}) error { + ctx := meta.(*ArmClient).StopContext client := meta.(*ArmClient).storageServiceClient 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 } diff --git a/azurerm/tags.go b/azurerm/tags.go index f229e3897b43..86a2377be75d 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,20 @@ 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) { +func flattenAndSetTags(d *schema.ResourceData, tagsMap map[string]*string) error { if tagsMap == nil { d.Set("tags", make(map[string]interface{})) return } - output := make(map[string]interface{}, len(*tagsMap)) + output := make(map[string]interface{}, len(tagsMap)) - for i, v := range *tagsMap { + for i, v := range tagsMap { output[i] = *v } - d.Set("tags", output) + return d.Set("tags", output) } From e44a901170a710276771f31482529708dc67cb99 Mon Sep 17 00:00:00 2001 From: tombuildsstuff Date: Thu, 5 Apr 2018 17:36:56 +0200 Subject: [PATCH 5/7] Upgrading to support SDKv15 --- azurerm/resource_arm_app_service.go | 37 ++++------- azurerm/resource_arm_automation_account.go | 15 +++-- azurerm/resource_arm_automation_runbook.go | 7 +- ...resource_arm_container_registry_migrate.go | 3 +- ...rce_arm_container_registry_migrate_test.go | 22 +++++-- azurerm/resource_arm_function_app.go | 21 +++--- azurerm/resource_arm_metric_alertrule.go | 4 +- azurerm/resource_arm_policy_assignment.go | 3 +- azurerm/resource_arm_policy_definition.go | 9 ++- azurerm/resource_arm_redis_cache.go | 27 ++++---- azurerm/resource_arm_sql_administrator.go | 11 ++-- .../resource_arm_sql_administrator_test.go | 6 +- azurerm/resource_arm_storage_account.go | 55 +++++++++------- azurerm/resource_arm_storage_account_test.go | 9 ++- azurerm/resource_arm_storage_blob.go | 12 ++-- azurerm/resource_arm_storage_blob_test.go | 12 ++-- azurerm/resource_arm_storage_container.go | 18 +++-- .../resource_arm_storage_container_test.go | 9 ++- azurerm/resource_arm_storage_queue.go | 9 ++- azurerm/resource_arm_storage_queue_test.go | 6 +- azurerm/resource_arm_storage_share.go | 12 ++-- azurerm/resource_arm_storage_share_test.go | 9 ++- azurerm/resource_arm_storage_table.go | 9 ++- azurerm/resource_arm_storage_table_test.go | 9 ++- azurerm/resource_arm_template_deployment.go | 66 ++++++++++--------- azurerm/resource_arm_virtual_machine.go | 5 +- .../resource_arm_virtual_machine_extension.go | 25 ++++--- .../resource_arm_virtual_machine_scale_set.go | 7 +- ...rm_virtual_machine_unmanaged_disks_test.go | 4 +- azurerm/tags.go | 4 +- azurerm/tags_test.go | 3 +- 31 files changed, 251 insertions(+), 197 deletions(-) diff --git a/azurerm/resource_arm_app_service.go b/azurerm/resource_arm_app_service.go index 10864b23bee0..7cf7b1d11545 100644 --- a/azurerm/resource_arm_app_service.go +++ b/azurerm/resource_arm_app_service.go @@ -329,12 +329,7 @@ func resourceArmAppServiceCreate(d *schema.ResourceData, meta interface{}) error siteEnvelope.SiteProperties.ClientAffinityEnabled = utils.Bool(enabled) } - // NOTE: these seem like sensible defaults, in lieu of any better documentation. - skipDNSRegistration := false - forceDNSRegistration := false - skipCustomDomainVerification := true - ttlInSeconds := "60" - createFuture, err := client.CreateOrUpdate(ctx, resGroup, name, siteEnvelope, &skipDNSRegistration, &skipCustomDomainVerification, &forceDNSRegistration, ttlInSeconds) + createFuture, err := client.CreateOrUpdate(ctx, resGroup, name, siteEnvelope) if err != nil { return err } @@ -392,16 +387,7 @@ func resourceArmAppServiceUpdate(d *schema.ResourceData, meta interface{}) error }, } - _, err := client.Update( - ctx, - resGroup, - name, - sitePatchResource, - nil, - nil, - nil, - "") - + _, err := client.Update(ctx, resGroup, name, sitePatchResource) if err != nil { return fmt.Errorf("Error updating App Service ARR Affinity setting %q: %+v", name, err) } @@ -546,9 +532,8 @@ func resourceArmAppServiceDelete(d *schema.ResourceData, meta interface{}) error deleteMetrics := true deleteEmptyServerFarm := false - skipDNSRegistration := true ctx := meta.(*ArmClient).StopContext - resp, err := client.Delete(ctx, resGroup, name, &deleteMetrics, &deleteEmptyServerFarm, &skipDNSRegistration) + resp, err := client.Delete(ctx, resGroup, name, &deleteMetrics, &deleteEmptyServerFarm) if err != nil { if !utils.ResponseWasNotFound(resp) { return err @@ -732,7 +717,7 @@ func flattenAppServiceSourceControl(input *web.SiteSourceControlProperties) []in return append(results, result) } -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)) @@ -740,10 +725,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)) @@ -760,13 +745,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) @@ -777,9 +762,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_automation_account.go b/azurerm/resource_arm_automation_account.go index 903e3353b784..65fa301f3c85 100644 --- a/azurerm/resource_arm_automation_account.go +++ b/azurerm/resource_arm_automation_account.go @@ -64,8 +64,9 @@ func resourceArmAutomationAccountCreateUpdate(d *schema.ResourceData, meta inter location := azureRMNormalizeLocation(d.Get("location").(string)) resGroup := d.Get("resource_group_name").(string) tags := d.Get("tags").(map[string]interface{}) + expandedTags := expandTags(tags) - sku := expandSku(d) + sku := expandAutomationAccountSku(d) parameters := automation.AccountCreateOrUpdateParameters{ AccountCreateOrUpdateProperties: &automation.AccountCreateOrUpdateProperties{ @@ -73,7 +74,7 @@ func resourceArmAutomationAccountCreateUpdate(d *schema.ResourceData, meta inter }, Location: &location, - Tags: expandTags(tags), + Tags: &expandedTags, } _, err := client.CreateOrUpdate(ctx, resGroup, name, parameters) @@ -121,9 +122,11 @@ func resourceArmAutomationAccountRead(d *schema.ResourceData, meta interface{}) d.Set("location", azureRMNormalizeLocation(*location)) } - flattenAndSetSku(d, resp.Sku) + flattenAndSetAutomationAccountSku(d, resp.Sku) - flattenAndSetTags(d, resp.Tags) + if tags := resp.Tags; tags != nil { + flattenAndSetTags(d, *tags) + } return nil } @@ -152,7 +155,7 @@ func resourceArmAutomationAccountDelete(d *schema.ResourceData, meta interface{} return nil } -func flattenAndSetSku(d *schema.ResourceData, sku *automation.Sku) { +func flattenAndSetAutomationAccountSku(d *schema.ResourceData, sku *automation.Sku) { results := make([]interface{}, 1) result := map[string]interface{}{} @@ -162,7 +165,7 @@ func flattenAndSetSku(d *schema.ResourceData, sku *automation.Sku) { d.Set("sku", &results) } -func expandSku(d *schema.ResourceData) automation.Sku { +func expandAutomationAccountSku(d *schema.ResourceData) automation.Sku { inputs := d.Get("sku").([]interface{}) input := inputs[0].(map[string]interface{}) name := automation.SkuNameEnum(input["name"].(string)) diff --git a/azurerm/resource_arm_automation_runbook.go b/azurerm/resource_arm_automation_runbook.go index 828d669a194a..6a5ecfb54979 100644 --- a/azurerm/resource_arm_automation_runbook.go +++ b/azurerm/resource_arm_automation_runbook.go @@ -118,6 +118,7 @@ func resourceArmAutomationRunbookCreateUpdate(d *schema.ResourceData, meta inter resGroup := d.Get("resource_group_name").(string) client.ResourceGroupName = resGroup tags := d.Get("tags").(map[string]interface{}) + expandedTags := expandTags(tags) accName := d.Get("account_name").(string) runbookType := automation.RunbookTypeEnum(d.Get("runbook_type").(string)) @@ -137,7 +138,7 @@ func resourceArmAutomationRunbookCreateUpdate(d *schema.ResourceData, meta inter }, Location: &location, - Tags: expandTags(tags), + Tags: &expandedTags, } _, err := client.CreateOrUpdate(ctx, accName, name, parameters) @@ -195,7 +196,9 @@ func resourceArmAutomationRunbookRead(d *schema.ResourceData, meta interface{}) d.Set("description", props.Description) } - flattenAndSetTags(d, resp.Tags) + if tags := resp.Tags; tags != nil { + flattenAndSetTags(d, *tags) + } return nil } diff --git a/azurerm/resource_arm_container_registry_migrate.go b/azurerm/resource_arm_container_registry_migrate.go index 5f485ee1fc8a..954164c8c52f 100644 --- a/azurerm/resource_arm_container_registry_migrate.go +++ b/azurerm/resource_arm_container_registry_migrate.go @@ -91,8 +91,9 @@ func updateV1ToV2StorageAccountName(is *terraform.InstanceState, meta interface{ } func findAzureStorageAccountIdFromName(name string, meta interface{}) (string, error) { + ctx := meta.(*ArmClient).StopContext client := meta.(*ArmClient).storageServiceClient - accounts, err := client.List() + 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..ae61dc359932 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 creation of Storage Account %q: %+v", resourceGroupName, err) + } + + account, err := storageClient.GetProperties(ctx, resourceGroupName, storageAccountName) + if err != nil { + return nil, fmt.Errorf("Error retrieving Storage Account %q: %+v", resourceGroupName, 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_function_app.go b/azurerm/resource_arm_function_app.go index a4dd7770a152..be2a80ca26b1 100644 --- a/azurerm/resource_arm_function_app.go +++ b/azurerm/resource_arm_function_app.go @@ -205,11 +205,7 @@ func resourceArmFunctionAppCreate(d *schema.ResourceData, meta interface{}) erro }, } - skipDNSRegistration := false - forceDNSRegistration := false - skipCustomDomainVerification := true - ttlInSeconds := "60" - createFuture, err := client.CreateOrUpdate(ctx, resGroup, name, siteEnvelope, &skipDNSRegistration, &skipCustomDomainVerification, &forceDNSRegistration, ttlInSeconds) + createFuture, err := client.CreateOrUpdate(ctx, resGroup, name, siteEnvelope) if err != nil { return err } @@ -376,9 +372,8 @@ func resourceArmFunctionAppDelete(d *schema.ResourceData, meta interface{}) erro deleteMetrics := true deleteEmptyServerFarm := false - skipDNSRegistration := true ctx := meta.(*ArmClient).StopContext - resp, err := client.Delete(ctx, resGroup, name, &deleteMetrics, &deleteEmptyServerFarm, &skipDNSRegistration) + resp, err := client.Delete(ctx, resGroup, name, &deleteMetrics, &deleteEmptyServerFarm) if err != nil { if !utils.ResponseWasNotFound(resp) { return err @@ -408,12 +403,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 @@ -469,7 +464,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)) @@ -486,13 +481,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_metric_alertrule.go b/azurerm/resource_arm_metric_alertrule.go index e9815485f418..d4eb1b7b67b9 100644 --- a/azurerm/resource_arm_metric_alertrule.go +++ b/azurerm/resource_arm_metric_alertrule.go @@ -260,7 +260,7 @@ func resourceArmMetricAlertRuleRead(d *schema.ResourceData, meta interface{}) er properties := make(map[string]string, 0) if props := webhookAction.Properties; props != nil { - for k, v := range *props { + for k, v := range props { if k != "$type" { properties[k] = *v } @@ -378,7 +378,7 @@ func expandAzureRmMetricThresholdAlertRule(d *schema.ResourceData) (*insights.Al webhookAction := insights.RuleWebhookAction{ ServiceURI: &service_uri, - Properties: &webhook_properties, + Properties: webhook_properties, } actions = append(actions, webhookAction) diff --git a/azurerm/resource_arm_policy_assignment.go b/azurerm/resource_arm_policy_assignment.go index 584cc930fd77..4a18126a0458 100644 --- a/azurerm/resource_arm_policy_assignment.go +++ b/azurerm/resource_arm_policy_assignment.go @@ -154,7 +154,8 @@ func resourceArmPolicyAssignmentRead(d *schema.ResourceData, meta interface{}) e d.Set("display_name", props.DisplayName) if params := props.Parameters; params != nil { - json, err := structure.FlattenJsonToString(*params) + paramsVal := params.(map[string]interface{}) + json, err := structure.FlattenJsonToString(paramsVal) if err != nil { return fmt.Errorf("Error serializing JSON from Parameters: %+v", err) } diff --git a/azurerm/resource_arm_policy_definition.go b/azurerm/resource_arm_policy_definition.go index 283ba2091b88..9bdfcb1bed8f 100644 --- a/azurerm/resource_arm_policy_definition.go +++ b/azurerm/resource_arm_policy_definition.go @@ -194,7 +194,8 @@ func resourceArmPolicyDefinitionRead(d *schema.ResourceData, meta interface{}) e d.Set("description", props.Description) if policyRule := props.PolicyRule; policyRule != nil { - policyRuleStr, err := structure.FlattenJsonToString(*policyRule) + policyRuleVal := policyRule.(map[string]interface{}) + policyRuleStr, err := structure.FlattenJsonToString(policyRuleVal) if err != nil { return fmt.Errorf("unable to flatten JSON for `policy_rule`: %s", err) } @@ -203,7 +204,8 @@ func resourceArmPolicyDefinitionRead(d *schema.ResourceData, meta interface{}) e } if metadata := props.Metadata; metadata != nil { - metadataStr, err := structure.FlattenJsonToString(*metadata) + metadataVal := metadata.(map[string]interface{}) + metadataStr, err := structure.FlattenJsonToString(metadataVal) if err != nil { return fmt.Errorf("unable to flatten JSON for `metadata`: %s", err) } @@ -212,7 +214,8 @@ func resourceArmPolicyDefinitionRead(d *schema.ResourceData, meta interface{}) e } if parameters := props.Parameters; parameters != nil { - parametersStr, err := structure.FlattenJsonToString(*props.Parameters) + paramsVal := props.Parameters.(map[string]interface{}) + parametersStr, err := structure.FlattenJsonToString(paramsVal) if err != nil { return fmt.Errorf("unable to flatten JSON for `parameters`: %s", err) } diff --git a/azurerm/resource_arm_redis_cache.go b/azurerm/resource_arm_redis_cache.go index 7455da12e4c2..c5637226370f 100644 --- a/azurerm/resource_arm_redis_cache.go +++ b/azurerm/resource_arm_redis_cache.go @@ -474,7 +474,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 { @@ -520,7 +520,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) { @@ -551,20 +551,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, len(input)) - 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_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_storage_account.go b/azurerm/resource_arm_storage_account.go index 64fdf7c3d0eb..1ae58a7a83c4 100644 --- a/azurerm/resource_arm_storage_account.go +++ b/azurerm/resource_arm_storage_account.go @@ -289,22 +289,28 @@ 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 Azure Storage Account %q: %+v", storageAccountName, err) } + err = future.WaitForCompletion(ctx, client.Client) + if err != nil { + return fmt.Errorf("Error waiting for Azure Storage Account %q to be created: %+v", storageAccountName, err) + } + + account, err := client.GetProperties(ctx, resourceGroupName, storageAccountName) + if err != nil { + return fmt.Errorf("Error retrieving Azure Storage Account %q: %+v", storageAccountName, err) + } + + 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) + return resourceArmStorageAccountRead(d, meta) } @@ -312,6 +318,7 @@ func resourceArmStorageAccountCreate(d *schema.ResourceData, meta interface{}) e // and idempotent operation for CreateOrUpdate. In particular updating all of the parameters // available requires a call to Update per parameter... func resourceArmStorageAccountUpdate(d *schema.ResourceData, meta interface{}) error { + ctx := meta.(*ArmClient).StopContext client := meta.(*ArmClient).storageServiceClient id, err := parseAzureResourceID(d.Id()) if err != nil { @@ -341,7 +348,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 +365,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 +379,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 +416,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 +430,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 +444,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) } @@ -450,6 +457,7 @@ func resourceArmStorageAccountUpdate(d *schema.ResourceData, meta interface{}) e } func resourceArmStorageAccountRead(d *schema.ResourceData, meta interface{}) error { + ctx := meta.(*ArmClient).StopContext client := meta.(*ArmClient).storageServiceClient endpointSuffix := meta.(*ArmClient).environment.StorageEndpointSuffix @@ -460,7 +468,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 +477,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 } @@ -569,6 +577,7 @@ func resourceArmStorageAccountRead(d *schema.ResourceData, meta interface{}) err } func resourceArmStorageAccountDelete(d *schema.ResourceData, meta interface{}) error { + ctx := meta.(*ArmClient).StopContext client := meta.(*ArmClient).storageServiceClient id, err := parseAzureResourceID(d.Id()) @@ -578,7 +587,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..8a50dca6654d 100644 --- a/azurerm/resource_arm_storage_account_test.go +++ b/azurerm/resource_arm_storage_account_test.go @@ -357,9 +357,10 @@ func testCheckAzureRMStorageAccountExists(name string) resource.TestCheckFunc { resourceGroup := rs.Primary.Attributes["resource_group_name"] // Ensure resource group exists in API + ctx := testAccProvider.Meta().(*ArmClient).StopContext conn := testAccProvider.Meta().(*ArmClient).storageServiceClient - resp, err := conn.GetProperties(resourceGroup, storageAccount) + resp, err := conn.GetProperties(ctx, resourceGroup, storageAccount) if err != nil { return fmt.Errorf("Bad: Get on storageServiceClient: %+v", err) } @@ -384,9 +385,10 @@ func testCheckAzureRMStorageAccountDisappears(name string) resource.TestCheckFun resourceGroup := rs.Primary.Attributes["resource_group_name"] // Ensure resource group exists in API + ctx := testAccProvider.Meta().(*ArmClient).StopContext conn := testAccProvider.Meta().(*ArmClient).storageServiceClient - _, err := conn.Delete(resourceGroup, storageAccount) + _, err := conn.Delete(ctx, resourceGroup, storageAccount) if err != nil { return fmt.Errorf("Bad: Delete on storageServiceClient: %+v", err) } @@ -396,6 +398,7 @@ func testCheckAzureRMStorageAccountDisappears(name string) resource.TestCheckFun } func testCheckAzureRMStorageAccountDestroy(s *terraform.State) error { + ctx := testAccProvider.Meta().(*ArmClient).StopContext conn := testAccProvider.Meta().(*ArmClient).storageServiceClient for _, rs := range s.RootModule().Resources { @@ -406,7 +409,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 := conn.GetProperties(ctx, resourceGroup, name) if err != nil { return nil } diff --git a/azurerm/resource_arm_storage_blob.go b/azurerm/resource_arm_storage_blob.go index 36645de0f850..dffc59b68496 100644 --- a/azurerm/resource_arm_storage_blob.go +++ b/azurerm/resource_arm_storage_blob.go @@ -132,11 +132,12 @@ func validateArmStorageBlobType(v interface{}, k string) (ws []string, errors [] func resourceArmStorageBlobCreate(d *schema.ResourceData, meta interface{}) error { armClient := meta.(*ArmClient) + ctx := armClient.StopContext resourceGroupName := d.Get("resource_group_name").(string) storageAccountName := d.Get("storage_account_name").(string) - blobClient, accountExists, err := armClient.getBlobStorageClientForStorageAccount(resourceGroupName, storageAccountName) + blobClient, accountExists, err := armClient.getBlobStorageClientForStorageAccount(ctx, resourceGroupName, storageAccountName) if err != nil { return err } @@ -525,11 +526,12 @@ func resourceArmStorageBlobBlockUploadWorker(ctx resourceArmStorageBlobBlockUplo func resourceArmStorageBlobRead(d *schema.ResourceData, meta interface{}) error { armClient := meta.(*ArmClient) + ctx := armClient.StopContext resourceGroupName := d.Get("resource_group_name").(string) storageAccountName := d.Get("storage_account_name").(string) - blobClient, accountExists, err := armClient.getBlobStorageClientForStorageAccount(resourceGroupName, storageAccountName) + blobClient, accountExists, err := armClient.getBlobStorageClientForStorageAccount(ctx, resourceGroupName, storageAccountName) if err != nil { return err } @@ -565,11 +567,12 @@ func resourceArmStorageBlobRead(d *schema.ResourceData, meta interface{}) error func resourceArmStorageBlobExists(d *schema.ResourceData, meta interface{}) (bool, error) { armClient := meta.(*ArmClient) + ctx := armClient.StopContext resourceGroupName := d.Get("resource_group_name").(string) storageAccountName := d.Get("storage_account_name").(string) - blobClient, accountExists, err := armClient.getBlobStorageClientForStorageAccount(resourceGroupName, storageAccountName) + blobClient, accountExists, err := armClient.getBlobStorageClientForStorageAccount(ctx, resourceGroupName, storageAccountName) if err != nil { return false, err } @@ -600,11 +603,12 @@ func resourceArmStorageBlobExists(d *schema.ResourceData, meta interface{}) (boo func resourceArmStorageBlobDelete(d *schema.ResourceData, meta interface{}) error { armClient := meta.(*ArmClient) + ctx := armClient.StopContext resourceGroupName := d.Get("resource_group_name").(string) storageAccountName := d.Get("storage_account_name").(string) - blobClient, accountExists, err := armClient.getBlobStorageClientForStorageAccount(resourceGroupName, storageAccountName) + blobClient, accountExists, err := armClient.getBlobStorageClientForStorageAccount(ctx, resourceGroupName, storageAccountName) if err != nil { return err } diff --git a/azurerm/resource_arm_storage_blob_test.go b/azurerm/resource_arm_storage_blob_test.go index 51f66e6e5442..2fea86ff4850 100644 --- a/azurerm/resource_arm_storage_blob_test.go +++ b/azurerm/resource_arm_storage_blob_test.go @@ -331,7 +331,8 @@ func testCheckAzureRMStorageBlobExists(name string) resource.TestCheckFunc { } armClient := testAccProvider.Meta().(*ArmClient) - blobClient, accountExists, err := armClient.getBlobStorageClientForStorageAccount(resourceGroup, storageAccountName) + ctx := armClient.StopContext + blobClient, accountExists, err := armClient.getBlobStorageClientForStorageAccount(ctx, resourceGroup, storageAccountName) if err != nil { return err } @@ -371,7 +372,8 @@ func testCheckAzureRMStorageBlobDisappears(name string) resource.TestCheckFunc { } armClient := testAccProvider.Meta().(*ArmClient) - blobClient, accountExists, err := armClient.getBlobStorageClientForStorageAccount(resourceGroup, storageAccountName) + ctx := armClient.StopContext + blobClient, accountExists, err := armClient.getBlobStorageClientForStorageAccount(ctx, resourceGroup, storageAccountName) if err != nil { return err } @@ -408,7 +410,8 @@ func testCheckAzureRMStorageBlobMatchesFile(name string, kind storage.BlobType, } armClient := testAccProvider.Meta().(*ArmClient) - blobClient, accountExists, err := armClient.getBlobStorageClientForStorageAccount(resourceGroup, storageAccountName) + ctx := armClient.StopContext + blobClient, accountExists, err := armClient.getBlobStorageClientForStorageAccount(ctx, resourceGroup, storageAccountName) if err != nil { return err } @@ -470,7 +473,8 @@ func testCheckAzureRMStorageBlobDestroy(s *terraform.State) error { } armClient := testAccProvider.Meta().(*ArmClient) - blobClient, accountExists, err := armClient.getBlobStorageClientForStorageAccount(resourceGroup, storageAccountName) + ctx := armClient.StopContext + blobClient, accountExists, err := armClient.getBlobStorageClientForStorageAccount(ctx, resourceGroup, storageAccountName) if err != nil { return nil } diff --git a/azurerm/resource_arm_storage_container.go b/azurerm/resource_arm_storage_container.go index 416eb03f127d..c028f69dcac1 100644 --- a/azurerm/resource_arm_storage_container.go +++ b/azurerm/resource_arm_storage_container.go @@ -70,9 +70,9 @@ func validateArmStorageContainerName(v interface{}, k string) (ws []string, erro func validateArmStorageContainerAccessType(v interface{}, k string) (ws []string, errors []error) { value := strings.ToLower(v.(string)) validTypes := map[string]struct{}{ - "private": struct{}{}, - "blob": struct{}{}, - "container": struct{}{}, + "private": {}, + "blob": {}, + "container": {}, } if _, ok := validTypes[value]; !ok { @@ -83,11 +83,12 @@ func validateArmStorageContainerAccessType(v interface{}, k string) (ws []string func resourceArmStorageContainerCreate(d *schema.ResourceData, meta interface{}) error { armClient := meta.(*ArmClient) + ctx := armClient.StopContext resourceGroupName := d.Get("resource_group_name").(string) storageAccountName := d.Get("storage_account_name").(string) - blobClient, accountExists, err := armClient.getBlobStorageClientForStorageAccount(resourceGroupName, storageAccountName) + blobClient, accountExists, err := armClient.getBlobStorageClientForStorageAccount(ctx, resourceGroupName, storageAccountName) if err != nil { return err } @@ -141,11 +142,12 @@ func checkContainerIsCreated(reference *storage.Container) func() *resource.Retr // read the status of the storage container off Azure. func resourceArmStorageContainerRead(d *schema.ResourceData, meta interface{}) error { armClient := meta.(*ArmClient) + ctx := armClient.StopContext resourceGroupName := d.Get("resource_group_name").(string) storageAccountName := d.Get("storage_account_name").(string) - blobClient, accountExists, err := armClient.getBlobStorageClientForStorageAccount(resourceGroupName, storageAccountName) + blobClient, accountExists, err := armClient.getBlobStorageClientForStorageAccount(ctx, resourceGroupName, storageAccountName) if err != nil { return err } @@ -189,11 +191,12 @@ func resourceArmStorageContainerRead(d *schema.ResourceData, meta interface{}) e func resourceArmStorageContainerExists(d *schema.ResourceData, meta interface{}) (bool, error) { armClient := meta.(*ArmClient) + ctx := armClient.StopContext resourceGroupName := d.Get("resource_group_name").(string) storageAccountName := d.Get("storage_account_name").(string) - blobClient, accountExists, err := armClient.getBlobStorageClientForStorageAccount(resourceGroupName, storageAccountName) + blobClient, accountExists, err := armClient.getBlobStorageClientForStorageAccount(ctx, resourceGroupName, storageAccountName) if err != nil { return false, err } @@ -224,11 +227,12 @@ func resourceArmStorageContainerExists(d *schema.ResourceData, meta interface{}) // delete a storage container off Azure. func resourceArmStorageContainerDelete(d *schema.ResourceData, meta interface{}) error { armClient := meta.(*ArmClient) + ctx := armClient.StopContext resourceGroupName := d.Get("resource_group_name").(string) storageAccountName := d.Get("storage_account_name").(string) - blobClient, accountExists, err := armClient.getBlobStorageClientForStorageAccount(resourceGroupName, storageAccountName) + blobClient, accountExists, err := armClient.getBlobStorageClientForStorageAccount(ctx, resourceGroupName, storageAccountName) if err != nil { return err } diff --git a/azurerm/resource_arm_storage_container_test.go b/azurerm/resource_arm_storage_container_test.go index e0924cf06b44..b844000ada76 100644 --- a/azurerm/resource_arm_storage_container_test.go +++ b/azurerm/resource_arm_storage_container_test.go @@ -97,7 +97,8 @@ func testCheckAzureRMStorageContainerExists(name string, c *storage.Container) r } armClient := testAccProvider.Meta().(*ArmClient) - blobClient, accountExists, err := armClient.getBlobStorageClientForStorageAccount(resourceGroup, storageAccountName) + ctx := armClient.StopContext + blobClient, accountExists, err := armClient.getBlobStorageClientForStorageAccount(ctx, resourceGroup, storageAccountName) if err != nil { return err } @@ -138,6 +139,7 @@ func testAccARMStorageContainerDisappears(name string, c *storage.Container) res } armClient := testAccProvider.Meta().(*ArmClient) + ctx := armClient.StopContext storageAccountName := rs.Primary.Attributes["storage_account_name"] resourceGroup, hasResourceGroup := rs.Primary.Attributes["resource_group_name"] @@ -145,7 +147,7 @@ func testAccARMStorageContainerDisappears(name string, c *storage.Container) res return fmt.Errorf("Bad: no resource group found in state for storage container: %s", c.Name) } - blobClient, accountExists, err := armClient.getBlobStorageClientForStorageAccount(resourceGroup, storageAccountName) + blobClient, accountExists, err := armClient.getBlobStorageClientForStorageAccount(ctx, resourceGroup, storageAccountName) if err != nil { return err } @@ -179,7 +181,8 @@ func testCheckAzureRMStorageContainerDestroy(s *terraform.State) error { } armClient := testAccProvider.Meta().(*ArmClient) - blobClient, accountExists, err := armClient.getBlobStorageClientForStorageAccount(resourceGroup, storageAccountName) + ctx := armClient.StopContext + blobClient, accountExists, err := armClient.getBlobStorageClientForStorageAccount(ctx, resourceGroup, storageAccountName) if err != nil { //If we can't get keys then the blob can't exist return nil diff --git a/azurerm/resource_arm_storage_queue.go b/azurerm/resource_arm_storage_queue.go index 755b8852683b..d6c58ae9a207 100644 --- a/azurerm/resource_arm_storage_queue.go +++ b/azurerm/resource_arm_storage_queue.go @@ -64,11 +64,12 @@ func validateArmStorageQueueName(v interface{}, k string) (ws []string, errors [ func resourceArmStorageQueueCreate(d *schema.ResourceData, meta interface{}) error { armClient := meta.(*ArmClient) + ctx := armClient.StopContext resourceGroupName := d.Get("resource_group_name").(string) storageAccountName := d.Get("storage_account_name").(string) - queueClient, accountExists, err := armClient.getQueueServiceClientForStorageAccount(resourceGroupName, storageAccountName) + queueClient, accountExists, err := armClient.getQueueServiceClientForStorageAccount(ctx, resourceGroupName, storageAccountName) if err != nil { return err } @@ -107,11 +108,12 @@ func resourceArmStorageQueueRead(d *schema.ResourceData, meta interface{}) error func resourceArmStorageQueueExists(d *schema.ResourceData, meta interface{}) (bool, error) { armClient := meta.(*ArmClient) + ctx := armClient.StopContext resourceGroupName := d.Get("resource_group_name").(string) storageAccountName := d.Get("storage_account_name").(string) - queueClient, accountExists, err := armClient.getQueueServiceClientForStorageAccount(resourceGroupName, storageAccountName) + queueClient, accountExists, err := armClient.getQueueServiceClientForStorageAccount(ctx, resourceGroupName, storageAccountName) if err != nil { return false, err } @@ -140,11 +142,12 @@ func resourceArmStorageQueueExists(d *schema.ResourceData, meta interface{}) (bo func resourceArmStorageQueueDelete(d *schema.ResourceData, meta interface{}) error { armClient := meta.(*ArmClient) + ctx := armClient.StopContext resourceGroupName := d.Get("resource_group_name").(string) storageAccountName := d.Get("storage_account_name").(string) - queueClient, accountExists, err := armClient.getQueueServiceClientForStorageAccount(resourceGroupName, storageAccountName) + queueClient, accountExists, err := armClient.getQueueServiceClientForStorageAccount(ctx, resourceGroupName, storageAccountName) if err != nil { return err } diff --git a/azurerm/resource_arm_storage_queue_test.go b/azurerm/resource_arm_storage_queue_test.go index bfa673fdaca7..223835c15814 100644 --- a/azurerm/resource_arm_storage_queue_test.go +++ b/azurerm/resource_arm_storage_queue_test.go @@ -86,7 +86,8 @@ func testCheckAzureRMStorageQueueExists(name string) resource.TestCheckFunc { } armClient := testAccProvider.Meta().(*ArmClient) - queueClient, accountExists, err := armClient.getQueueServiceClientForStorageAccount(resourceGroup, storageAccountName) + ctx := armClient.StopContext + queueClient, accountExists, err := armClient.getQueueServiceClientForStorageAccount(ctx, resourceGroup, storageAccountName) if err != nil { return err } @@ -122,7 +123,8 @@ func testCheckAzureRMStorageQueueDestroy(s *terraform.State) error { } armClient := testAccProvider.Meta().(*ArmClient) - queueClient, accountExists, err := armClient.getQueueServiceClientForStorageAccount(resourceGroup, storageAccountName) + ctx := armClient.StopContext + queueClient, accountExists, err := armClient.getQueueServiceClientForStorageAccount(ctx, resourceGroup, storageAccountName) if err != nil { return nil } diff --git a/azurerm/resource_arm_storage_share.go b/azurerm/resource_arm_storage_share.go index 4c92d920a937..865953c8f1b8 100644 --- a/azurerm/resource_arm_storage_share.go +++ b/azurerm/resource_arm_storage_share.go @@ -44,11 +44,12 @@ func resourceArmStorageShare() *schema.Resource { } func resourceArmStorageShareCreate(d *schema.ResourceData, meta interface{}) error { armClient := meta.(*ArmClient) + ctx := armClient.StopContext resourceGroupName := d.Get("resource_group_name").(string) storageAccountName := d.Get("storage_account_name").(string) - fileClient, accountExists, err := armClient.getFileServiceClientForStorageAccount(resourceGroupName, storageAccountName) + fileClient, accountExists, err := armClient.getFileServiceClientForStorageAccount(ctx, resourceGroupName, storageAccountName) if err != nil { return err } @@ -80,11 +81,12 @@ func resourceArmStorageShareCreate(d *schema.ResourceData, meta interface{}) err func resourceArmStorageShareRead(d *schema.ResourceData, meta interface{}) error { armClient := meta.(*ArmClient) + ctx := armClient.StopContext resourceGroupName := d.Get("resource_group_name").(string) storageAccountName := d.Get("storage_account_name").(string) - fileClient, accountExists, err := armClient.getFileServiceClientForStorageAccount(resourceGroupName, storageAccountName) + fileClient, accountExists, err := armClient.getFileServiceClientForStorageAccount(ctx, resourceGroupName, storageAccountName) if err != nil { return err } @@ -118,11 +120,12 @@ func resourceArmStorageShareRead(d *schema.ResourceData, meta interface{}) error func resourceArmStorageShareExists(d *schema.ResourceData, meta interface{}) (bool, error) { armClient := meta.(*ArmClient) + ctx := armClient.StopContext resourceGroupName := d.Get("resource_group_name").(string) storageAccountName := d.Get("storage_account_name").(string) - fileClient, accountExists, err := armClient.getFileServiceClientForStorageAccount(resourceGroupName, storageAccountName) + fileClient, accountExists, err := armClient.getFileServiceClientForStorageAccount(ctx, resourceGroupName, storageAccountName) if err != nil { return false, err } @@ -151,11 +154,12 @@ func resourceArmStorageShareExists(d *schema.ResourceData, meta interface{}) (bo func resourceArmStorageShareDelete(d *schema.ResourceData, meta interface{}) error { armClient := meta.(*ArmClient) + ctx := armClient.StopContext resourceGroupName := d.Get("resource_group_name").(string) storageAccountName := d.Get("storage_account_name").(string) - fileClient, accountExists, err := armClient.getFileServiceClientForStorageAccount(resourceGroupName, storageAccountName) + fileClient, accountExists, err := armClient.getFileServiceClientForStorageAccount(ctx, resourceGroupName, storageAccountName) if err != nil { return err } diff --git a/azurerm/resource_arm_storage_share_test.go b/azurerm/resource_arm_storage_share_test.go index fc9bd3e61f9b..df13f8622eb7 100644 --- a/azurerm/resource_arm_storage_share_test.go +++ b/azurerm/resource_arm_storage_share_test.go @@ -74,7 +74,8 @@ func testCheckAzureRMStorageShareExists(name string, sS *storage.Share) resource } armClient := testAccProvider.Meta().(*ArmClient) - fileClient, accountExists, err := armClient.getFileServiceClientForStorageAccount(resourceGroupName, storageAccountName) + ctx := armClient.StopContext + fileClient, accountExists, err := armClient.getFileServiceClientForStorageAccount(ctx, resourceGroupName, storageAccountName) if err != nil { return err } @@ -115,6 +116,7 @@ func testAccARMStorageShareDisappears(name string, sS *storage.Share) resource.T } armClient := testAccProvider.Meta().(*ArmClient) + ctx := armClient.StopContext storageAccountName := rs.Primary.Attributes["storage_account_name"] resourceGroupName, hasResourceGroup := rs.Primary.Attributes["resource_group_name"] @@ -122,7 +124,7 @@ func testAccARMStorageShareDisappears(name string, sS *storage.Share) resource.T return fmt.Errorf("Bad: no resource group found in state for storage share: %s", sS.Name) } - fileClient, accountExists, err := armClient.getFileServiceClientForStorageAccount(resourceGroupName, storageAccountName) + fileClient, accountExists, err := armClient.getFileServiceClientForStorageAccount(ctx, resourceGroupName, storageAccountName) if err != nil { return err } @@ -157,7 +159,8 @@ func testCheckAzureRMStorageShareDestroy(s *terraform.State) error { } armClient := testAccProvider.Meta().(*ArmClient) - fileClient, accountExists, err := armClient.getFileServiceClientForStorageAccount(resourceGroupName, storageAccountName) + ctx := armClient.StopContext + fileClient, accountExists, err := armClient.getFileServiceClientForStorageAccount(ctx, resourceGroupName, storageAccountName) if err != nil { //If we can't get keys then the blob can't exist return nil diff --git a/azurerm/resource_arm_storage_table.go b/azurerm/resource_arm_storage_table.go index 4867e0a6f69f..e5cc2e14e10a 100644 --- a/azurerm/resource_arm_storage_table.go +++ b/azurerm/resource_arm_storage_table.go @@ -50,11 +50,12 @@ func validateArmStorageTableName(v interface{}, k string) (ws []string, errors [ func resourceArmStorageTableCreate(d *schema.ResourceData, meta interface{}) error { armClient := meta.(*ArmClient) + ctx := armClient.StopContext resourceGroupName := d.Get("resource_group_name").(string) storageAccountName := d.Get("storage_account_name").(string) - tableClient, accountExists, err := armClient.getTableServiceClientForStorageAccount(resourceGroupName, storageAccountName) + tableClient, accountExists, err := armClient.getTableServiceClientForStorageAccount(ctx, resourceGroupName, storageAccountName) if err != nil { return err } @@ -81,11 +82,12 @@ func resourceArmStorageTableCreate(d *schema.ResourceData, meta interface{}) err func resourceArmStorageTableRead(d *schema.ResourceData, meta interface{}) error { armClient := meta.(*ArmClient) + ctx := armClient.StopContext resourceGroupName := d.Get("resource_group_name").(string) storageAccountName := d.Get("storage_account_name").(string) - tableClient, accountExists, err := armClient.getTableServiceClientForStorageAccount(resourceGroupName, storageAccountName) + tableClient, accountExists, err := armClient.getTableServiceClientForStorageAccount(ctx, resourceGroupName, storageAccountName) if err != nil { return err } @@ -122,11 +124,12 @@ func resourceArmStorageTableRead(d *schema.ResourceData, meta interface{}) error func resourceArmStorageTableDelete(d *schema.ResourceData, meta interface{}) error { armClient := meta.(*ArmClient) + ctx := armClient.StopContext resourceGroupName := d.Get("resource_group_name").(string) storageAccountName := d.Get("storage_account_name").(string) - tableClient, accountExists, err := armClient.getTableServiceClientForStorageAccount(resourceGroupName, storageAccountName) + tableClient, accountExists, err := armClient.getTableServiceClientForStorageAccount(ctx, resourceGroupName, storageAccountName) if err != nil { return err } diff --git a/azurerm/resource_arm_storage_table_test.go b/azurerm/resource_arm_storage_table_test.go index cecc6eebf7df..983c3ff5edc8 100644 --- a/azurerm/resource_arm_storage_table_test.go +++ b/azurerm/resource_arm_storage_table_test.go @@ -74,7 +74,8 @@ func testCheckAzureRMStorageTableExists(name string, t *storage.Table) resource. } armClient := testAccProvider.Meta().(*ArmClient) - tableClient, accountExists, err := armClient.getTableServiceClientForStorageAccount(resourceGroup, storageAccountName) + ctx := armClient.StopContext + tableClient, accountExists, err := armClient.getTableServiceClientForStorageAccount(ctx, resourceGroup, storageAccountName) if err != nil { return err } @@ -113,6 +114,7 @@ func testAccARMStorageTableDisappears(name string, t *storage.Table) resource.Te } armClient := testAccProvider.Meta().(*ArmClient) + ctx := armClient.StopContext storageAccountName := rs.Primary.Attributes["storage_account_name"] resourceGroup, hasResourceGroup := rs.Primary.Attributes["resource_group_name"] @@ -120,7 +122,7 @@ func testAccARMStorageTableDisappears(name string, t *storage.Table) resource.Te return fmt.Errorf("Bad: no resource group found in state for storage table: %s", t.Name) } - tableClient, accountExists, err := armClient.getTableServiceClientForStorageAccount(resourceGroup, storageAccountName) + tableClient, accountExists, err := armClient.getTableServiceClientForStorageAccount(ctx, resourceGroup, storageAccountName) if err != nil { return err } @@ -155,7 +157,8 @@ func testCheckAzureRMStorageTableDestroy(s *terraform.State) error { } armClient := testAccProvider.Meta().(*ArmClient) - tableClient, accountExists, err := armClient.getTableServiceClientForStorageAccount(resourceGroup, storageAccountName) + ctx := armClient.StopContext + tableClient, accountExists, err := armClient.getTableServiceClientForStorageAccount(ctx, resourceGroup, storageAccountName) if err != nil { //If we can't get keys then the table can't exist return nil diff --git a/azurerm/resource_arm_template_deployment.go b/azurerm/resource_arm_template_deployment.go index 97c6f3f76256..029803d5323c 100644 --- a/azurerm/resource_arm_template_deployment.go +++ b/azurerm/resource_arm_template_deployment.go @@ -169,39 +169,41 @@ func resourceArmTemplateDeploymentRead(d *schema.ResourceData, meta interface{}) } 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 + if outs := resp.Properties.Outputs; outs != nil { + outsVal := outs.(map[string]interface{}) + if len(outsVal) > 0 { + for key, output := range outsVal { + 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) + + 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 } - 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 } } diff --git a/azurerm/resource_arm_virtual_machine.go b/azurerm/resource_arm_virtual_machine.go index 6d161b6f398a..ac6160869bd1 100644 --- a/azurerm/resource_arm_virtual_machine.go +++ b/azurerm/resource_arm_virtual_machine.go @@ -817,7 +817,10 @@ func resourceArmVirtualMachineDeleteVhd(uri string, meta interface{}) error { return fmt.Errorf("Error finding resource group for storage account %s: %+v", storageAccountName, err) } - blobClient, saExists, err := meta.(*ArmClient).getBlobStorageClientForStorageAccount(storageAccountResourceGroupName, storageAccountName) + armClient := meta.(*ArmClient) + ctx := armClient.StopContext + + blobClient, saExists, err := armClient.getBlobStorageClientForStorageAccount(ctx, storageAccountResourceGroupName, storageAccountName) if err != nil { return fmt.Errorf("Error creating blob store client for VHD deletion: %+v", err) } diff --git a/azurerm/resource_arm_virtual_machine_extension.go b/azurerm/resource_arm_virtual_machine_extension.go index 94a9d8fb43f2..d4a72c591ef0 100644 --- a/azurerm/resource_arm_virtual_machine_extension.go +++ b/azurerm/resource_arm_virtual_machine_extension.go @@ -171,17 +171,24 @@ func resourceArmVirtualMachineExtensionsRead(d *schema.ResourceData, meta interf } 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 settings := props.Settings; settings != nil { + settingsVal := settings.(map[string]interface{}) + settingsJson, err := structure.FlattenJsonToString(settingsVal) + if err != nil { + return fmt.Errorf("unable to parse settings from response: %s", err) + } + d.Set("settings", settingsJson) } - d.Set("settings", settings) + } + + if resp.VirtualMachineExtensionProperties.Settings != nil { } flattenAndSetTags(d, resp.Tags) diff --git a/azurerm/resource_arm_virtual_machine_scale_set.go b/azurerm/resource_arm_virtual_machine_scale_set.go index 45007d096902..eabf8cdbf59a 100644 --- a/azurerm/resource_arm_virtual_machine_scale_set.go +++ b/azurerm/resource_arm_virtual_machine_scale_set.go @@ -1171,12 +1171,13 @@ func flattenAzureRmVirtualMachineScaleSetExtensionProfile(profile *compute.Virtu e["auto_upgrade_minor_version"] = *properties.AutoUpgradeMinorVersion } - if properties.Settings != nil { - settings, err := structure.FlattenJsonToString(*properties.Settings) + if settings := properties.Settings; settings != nil { + settingsVal := settings.(map[string]interface{}) + settingsJson, err := structure.FlattenJsonToString(settingsVal) if err != nil { return nil, err } - e["settings"] = settings + e["settings"] = settingsJson } } diff --git a/azurerm/resource_arm_virtual_machine_unmanaged_disks_test.go b/azurerm/resource_arm_virtual_machine_unmanaged_disks_test.go index 538e14d62003..4cac5fafa08c 100644 --- a/azurerm/resource_arm_virtual_machine_unmanaged_disks_test.go +++ b/azurerm/resource_arm_virtual_machine_unmanaged_disks_test.go @@ -2936,7 +2936,9 @@ func testCheckAzureRMVirtualMachineVHDExistence(name string, shouldExist bool) r resourceGroup := rs.Primary.Attributes["resource_group_name"] storageAccountName := rs.Primary.Attributes["storage_account_name"] containerName := rs.Primary.Attributes["name"] - storageClient, _, err := testAccProvider.Meta().(*ArmClient).getBlobStorageClientForStorageAccount(resourceGroup, storageAccountName) + armClient := testAccProvider.Meta().(*ArmClient) + ctx := armClient.StopContext + storageClient, _, err := armClient.getBlobStorageClientForStorageAccount(ctx, resourceGroup, storageAccountName) if err != nil { return fmt.Errorf("Error creating Blob storage client: %+v", err) } diff --git a/azurerm/tags.go b/azurerm/tags.go index 86a2377be75d..fdc6c6a0ed13 100644 --- a/azurerm/tags.go +++ b/azurerm/tags.go @@ -79,7 +79,7 @@ func expandTags(tagsMap map[string]interface{}) map[string]*string { return output } -func flattenAndSetTags(d *schema.ResourceData, tagsMap map[string]*string) error { +func flattenAndSetTags(d *schema.ResourceData, tagsMap map[string]*string) { if tagsMap == nil { d.Set("tags", make(map[string]interface{})) return @@ -91,5 +91,5 @@ func flattenAndSetTags(d *schema.ResourceData, tagsMap map[string]*string) error output[i] = *v } - return d.Set("tags", output) + 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)) From a9a6cb06b88dc435f085cb81a4def3172c77a6ae Mon Sep 17 00:00:00 2001 From: tombuildsstuff Date: Thu, 5 Apr 2018 21:49:24 +0200 Subject: [PATCH 6/7] Fixing a race condition in the Role Assignment tests ``` $ acctests azurerm TestAccAzureRMRoleAssignment === RUN TestAccAzureRMRoleAssignment === RUN TestAccAzureRMRoleAssignment/basic === RUN TestAccAzureRMRoleAssignment/basic/roleName === RUN TestAccAzureRMRoleAssignment/basic/builtin === RUN TestAccAzureRMRoleAssignment/basic/custom === RUN TestAccAzureRMRoleAssignment/basic/emptyName === RUN TestAccAzureRMRoleAssignment/import === RUN TestAccAzureRMRoleAssignment/import/basic === RUN TestAccAzureRMRoleAssignment/import/custom --- PASS: TestAccAzureRMRoleAssignment (446.84s) --- PASS: TestAccAzureRMRoleAssignment/basic (113.85s) --- PASS: TestAccAzureRMRoleAssignment/basic/roleName (32.06s) --- PASS: TestAccAzureRMRoleAssignment/basic/builtin (24.82s) --- PASS: TestAccAzureRMRoleAssignment/basic/custom (26.03s) --- PASS: TestAccAzureRMRoleAssignment/basic/emptyName (30.94s) --- PASS: TestAccAzureRMRoleAssignment/import (332.99s) --- PASS: TestAccAzureRMRoleAssignment/import/basic (30.90s) --- PASS: TestAccAzureRMRoleAssignment/import/custom (302.09s) PASS ok github.com/terraform-providers/terraform-provider-azurerm/azurerm 446.872s ``` --- azurerm/import_arm_role_assignment_test.go | 8 +-- azurerm/resource_arm_role_assignment_test.go | 53 +++++++++++++++----- 2 files changed, 45 insertions(+), 16 deletions(-) diff --git a/azurerm/import_arm_role_assignment_test.go b/azurerm/import_arm_role_assignment_test.go index 3dc1afeef682..c2b433eccc42 100644 --- a/azurerm/import_arm_role_assignment_test.go +++ b/azurerm/import_arm_role_assignment_test.go @@ -8,13 +8,13 @@ import ( "github.com/hashicorp/terraform/helper/resource" ) -func TestAccAzureRMRoleAssignment_importBasic(t *testing.T) { +func testAccAzureRMRoleAssignment_importBasic(t *testing.T) { resourceName := "azurerm_role_assignment.test" roleDefinitionId := uuid.New().String() roleAssignmentId := uuid.New().String() ri := acctest.RandInt() - config := testAccAzureRMRoleAssignment_custom(roleDefinitionId, roleAssignmentId, ri) + config := testAccAzureRMRoleAssignment_customConfig(roleDefinitionId, roleAssignmentId, ri) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -33,13 +33,13 @@ func TestAccAzureRMRoleAssignment_importBasic(t *testing.T) { }) } -func TestAccAzureRMRoleAssignment_importCustom(t *testing.T) { +func testAccAzureRMRoleAssignment_importCustom(t *testing.T) { resourceName := "azurerm_role_assignment.test" roleDefinitionId := uuid.New().String() roleAssignmentId := uuid.New().String() ri := acctest.RandInt() - config := testAccAzureRMRoleAssignment_custom(roleDefinitionId, roleAssignmentId, ri) + config := testAccAzureRMRoleAssignment_customConfig(roleDefinitionId, roleAssignmentId, ri) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, diff --git a/azurerm/resource_arm_role_assignment_test.go b/azurerm/resource_arm_role_assignment_test.go index eea5c60fc8b8..c031b2d54b5c 100644 --- a/azurerm/resource_arm_role_assignment_test.go +++ b/azurerm/resource_arm_role_assignment_test.go @@ -11,9 +11,38 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) -func TestAccAzureRMRoleAssignment_emptyName(t *testing.T) { +func TestAccAzureRMRoleAssignment(t *testing.T) { + // NOTE: this is a combined test rather than separate split out tests due to + // Azure only being happy about provisioning a couple at a time + testCases := map[string]map[string]func(t *testing.T){ + "basic": { + "emptyName": testAccAzureRMRoleAssignment_emptyName, + "roleName": testAccAzureRMRoleAssignment_roleName, + "builtin": testAccAzureRMRoleAssignment_builtin, + "custom": testAccAzureRMRoleAssignment_custom, + }, + "import": { + "basic": testAccAzureRMRoleAssignment_importBasic, + "custom": testAccAzureRMRoleAssignment_importCustom, + }, + } + + for group, m := range testCases { + m := m + t.Run(group, func(t *testing.T) { + for name, tc := range m { + tc := tc + t.Run(name, func(t *testing.T) { + tc(t) + }) + } + }) + } +} + +func testAccAzureRMRoleAssignment_emptyName(t *testing.T) { resourceName := "azurerm_role_assignment.test" - config := testAccAzureRMRoleAssignment_emptyName() + config := testAccAzureRMRoleAssignment_emptyNameConfig() resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -31,10 +60,10 @@ func TestAccAzureRMRoleAssignment_emptyName(t *testing.T) { }) } -func TestAccAzureRMRoleAssignment_roleName(t *testing.T) { +func testAccAzureRMRoleAssignment_roleName(t *testing.T) { id := uuid.New().String() resourceName := "azurerm_role_assignment.test" - config := testAccAzureRMRoleAssignment_roleName(id) + config := testAccAzureRMRoleAssignment_roleNameConfig(id) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -52,9 +81,9 @@ func TestAccAzureRMRoleAssignment_roleName(t *testing.T) { }) } -func TestAccAzureRMRoleAssignment_builtin(t *testing.T) { +func testAccAzureRMRoleAssignment_builtin(t *testing.T) { id := uuid.New().String() - config := testAccAzureRMRoleAssignment_builtin(id) + config := testAccAzureRMRoleAssignment_builtinConfig(id) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -71,11 +100,11 @@ func TestAccAzureRMRoleAssignment_builtin(t *testing.T) { }) } -func TestAccAzureRMRoleAssignment_custom(t *testing.T) { +func testAccAzureRMRoleAssignment_custom(t *testing.T) { roleDefinitionId := uuid.New().String() roleAssignmentId := uuid.New().String() rInt := acctest.RandInt() - config := testAccAzureRMRoleAssignment_custom(roleDefinitionId, roleAssignmentId, rInt) + config := testAccAzureRMRoleAssignment_customConfig(roleDefinitionId, roleAssignmentId, rInt) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -144,7 +173,7 @@ func testCheckAzureRMRoleAssignmentDestroy(s *terraform.State) error { return nil } -func testAccAzureRMRoleAssignment_emptyName() string { +func testAccAzureRMRoleAssignment_emptyNameConfig() string { return ` data "azurerm_subscription" "primary" {} @@ -162,7 +191,7 @@ resource "azurerm_role_assignment" "test" { ` } -func testAccAzureRMRoleAssignment_roleName(id string) string { +func testAccAzureRMRoleAssignment_roleNameConfig(id string) string { return fmt.Sprintf(` data "azurerm_subscription" "primary" {} @@ -177,7 +206,7 @@ resource "azurerm_role_assignment" "test" { `, id) } -func testAccAzureRMRoleAssignment_builtin(id string) string { +func testAccAzureRMRoleAssignment_builtinConfig(id string) string { return fmt.Sprintf(` data "azurerm_subscription" "primary" {} @@ -196,7 +225,7 @@ resource "azurerm_role_assignment" "test" { `, id) } -func testAccAzureRMRoleAssignment_custom(roleDefinitionId string, roleAssignmentId string, rInt int) string { +func testAccAzureRMRoleAssignment_customConfig(roleDefinitionId string, roleAssignmentId string, rInt int) string { return fmt.Sprintf(` data "azurerm_subscription" "primary" {} From 7f4cb6cd120e0c7cbbd816c3d00b4e90ed213c63 Mon Sep 17 00:00:00 2001 From: tombuildsstuff Date: Thu, 5 Apr 2018 21:55:17 +0200 Subject: [PATCH 7/7] Fixing the Template Deployment tests ``` $ acctests azurerm TestAccAzureRMTemplateDeployment_withOutputs === RUN TestAccAzureRMTemplateDeployment_withOutputs --- PASS: TestAccAzureRMTemplateDeployment_withOutputs (226.89s) PASS ok github.com/terraform-providers/terraform-provider-azurerm/azurerm 226.921s ``` --- azurerm/resource_arm_template_deployment.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azurerm/resource_arm_template_deployment.go b/azurerm/resource_arm_template_deployment.go index 029803d5323c..ff57b7086490 100644 --- a/azurerm/resource_arm_template_deployment.go +++ b/azurerm/resource_arm_template_deployment.go @@ -168,7 +168,7 @@ 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 + outputs := make(map[string]string, 0) if outs := resp.Properties.Outputs; outs != nil { outsVal := outs.(map[string]interface{}) if len(outsVal) > 0 {